private CAD.LimitReferenceType CreateLimitRef(Datum d, string role)
 {
     CAD.LimitReferenceType limitref = new CAD.LimitReferenceType();
     limitref.ComponentID = d.ComponentID;
     limitref.FeatureGeometryType = d.Type.ToString().ToUpper();
     limitref.FeatureName = d.DatumName;
     limitref.Role = role;
     return limitref;
 }
예제 #2
0
        private CAD.PairType MakeRootConstraint(string location,
                                                string componentDispID,
                                                string assemblyID,
                                                bool rootIsAsmType,
                                                Datum datum)
        {
            CAD.PairType pair = new CAD.PairType();
            pair._id = UtilityHelpers.MakeUdmID();
            pair.FeatureGeometryType = "SURFACE";
            pair.FeatureAlignmentType = "ALIGN";
            pair.FeatureInterfaceType = "CAD_DATUM";

            List<CAD.ConstraintFeatureType> featurelist = new List<CAD.ConstraintFeatureType>();
            CAD.ConstraintFeatureType constraintFeature = new CAD.ConstraintFeatureType();
            constraintFeature._id = UtilityHelpers.MakeUdmID();
            constraintFeature.ComponentID = componentDispID;
            constraintFeature.FeatureOrientationType = "SIDE_A";
            if (rootIsAsmType)
            {
                constraintFeature.FeatureName = "ASM_" + location;
            }
            else
            {
                constraintFeature.FeatureName = location;
            }
            
            // META-3555 hack
            if (datum != null && datum.Marker != null)
            {
                constraintFeature.GeometryMarker = datum.Marker.ToCADXml();
            }

            featurelist.Add(constraintFeature);

            CAD.ConstraintFeatureType asmConstraint = new CAD.ConstraintFeatureType();
            asmConstraint._id = UtilityHelpers.MakeUdmID();
            asmConstraint.ComponentID = assemblyID;
            asmConstraint.FeatureOrientationType = "SIDE_A";
            asmConstraint.FeatureName = "ASM_" + location;
            featurelist.Add(asmConstraint);
            pair.ConstraintFeature = featurelist.ToArray();

            return pair;
        }