コード例 #1
0
        // Pre
        public override void TranslateC2T(MECMOD.Shape cShape)
        {
            PARTITF.RectPattern cRectPattern = (PARTITF.RectPattern)cShape;

            object[] firstDir  = new object[3];
            object[] secondDir = new object[3];

            GetDirections(cRectPattern, firstDir, secondDir);

            int    firstCount   = cRectPattern.FirstDirectionRepartition.InstancesCount.Value;
            double firstSpacing = Math.Abs(cRectPattern.FirstDirectionRepartition.Spacing.Value);

            int    secondCount   = cRectPattern.SecondDirectionRepartition.InstancesCount.Value;
            double secondSpacing = Math.Abs(cRectPattern.SecondDirectionRepartition.Spacing.Value);

            TransCAD.References refElements = PartManager.tPart.CreateReferences();
            TransCAD.Reference  refElement  = PartManager.tPart.SelectFeatureByName(cRectPattern.ItemToCopy.get_Name());

            if (refElement != null)
            {
                refElements.Add(refElement);
            }

            PartManager.tFeatures.AddNewSolidOperatePatternRectangularFeature(cRectPattern.get_Name(), refElements, firstSpacing, (double)firstDir[0], (double)firstDir[1], (double)firstDir[2],
                                                                              firstCount, secondSpacing, (double)secondDir[0], (double)secondDir[1], (double)secondDir[2], secondCount);
        }
コード例 #2
0
        // Pre
        public override void TranslateC2T(MECMOD.Shape cShape)
        {
            PARTITF.CircPattern cCircPattern = (PARTITF.CircPattern)cShape;

            object[] center = new object[3];
            object[] axis   = new object[3];

            cCircPattern.GetRotationCenter(center);
            cCircPattern.GetRotationAxis(axis);

            int    angularCount   = cCircPattern.AngularRepartition.InstancesCount.Value;
            double angularSpacing = cCircPattern.AngularRepartition.AngularSpacing.Value;

            int    radialCount   = cCircPattern.RadialRepartition.InstancesCount.Value;
            double radialSpacing = cCircPattern.RadialRepartition.Spacing.Value;

            bool isRadiallyAligned = cCircPattern.RadialAlignment;

            TransCAD.References refElements = PartManager.tPart.CreateReferences();
            TransCAD.Reference  refElement  = PartManager.tPart.SelectFeatureByName(cCircPattern.ItemToCopy.get_Name());

            if (refElement != null)
            {
                refElements.Add(refElement);
            }

            PartManager.tFeatures.AddNewSolidOperatePatternCircularFeature(cCircPattern.get_Name(), refElements, (double)center[0], (double)center[1], (double)center[2],
                                                                           (double)axis[0], (double)axis[1], (double)axis[2], angularCount, angularSpacing, radialCount, radialSpacing, isRadiallyAligned);
        }
コード例 #3
0
        // Pre
        public override void TranslateC2T(MECMOD.Shape cShape)
        {
            PARTITF.ConstRadEdgeFillet cFillet = (PARTITF.ConstRadEdgeFillet)cShape;

            double radius = cFillet.Radius.Value;

            TransCAD.PropagationType propagation = TransCAD.PropagationType.Tangency;

            if (cFillet.EdgePropagation == PARTITF.CatFilletEdgePropagation.catMinimalFilletEdgePropagation)
            {
                propagation = TransCAD.PropagationType.Minimal;
            }

            TransCAD.References refElements = PartManager.tPart.CreateReferences();

            for (int i = 1; i <= cFillet.ObjectsToFillet.Count; i++)
            {
                string elementName = cFillet.ObjectsToFillet.Item(i).DisplayName;
                elementName = PartManager.ReferenceManager.GetTransCADNameFromCATIAName(elementName);

                TransCAD.Reference refElement = PartManager.tPart.SelectBrepByName(elementName);

                refElements.Add(refElement);
            }

            PartManager.tFeatures.AddNewSolidFilletConstantFeature(cFillet.get_Name(), refElements, radius, propagation);
        }
コード例 #4
0
        // Pre
        public override void TranslateC2T(MECMOD.Shape cShape)
        {
            PARTITF.Chamfer cChamfer = (PARTITF.Chamfer)cShape;

            double length = cChamfer.Length1.Value;

            TransCAD.References refElements = PartManager.tPart.CreateReferences();

            for (int i = 1; i <= cChamfer.ElementsToChamfer.Count; i++)
            {
                string elementName = cChamfer.ElementsToChamfer.Item(i).DisplayName;
                elementName = PartManager.ReferenceManager.GetTransCADNameFromCATIAName(elementName);

                TransCAD.Reference refElement = PartManager.tPart.SelectBrepByName(elementName);
                refElements.Add(refElement);
            }

            PartManager.tFeatures.AddNewSolidChamferFeature(cChamfer.get_Name(), refElements, length);
        }