tpalsl125
Automotive
- Apr 24, 2015
- 44
Hello, guys.
I'm trying to make a macro which can make coordiante points as much as what I want.
So I recorded to make coordinate points with Axis System and I modified this code.
And I got a problem in here.
If I select the Axis which is in the "Axis Systems", then it works very well.
On the other hand, if I select the Axis which is in a "Geometrical Set", then it doesn't work.
Actually I would like to get the coodinate points with reference AxisSystem in the both side, in the "Axis Systems" and the "Geometrical Set".
I have also googled about this theme, but I didn't find anything.
Could you check my code inside, please?
I'm trying to make a macro which can make coordiante points as much as what I want.
So I recorded to make coordinate points with Axis System and I modified this code.
And I got a problem in here.
If I select the Axis which is in the "Axis Systems", then it works very well.
On the other hand, if I select the Axis which is in a "Geometrical Set", then it doesn't work.
Actually I would like to get the coodinate points with reference AxisSystem in the both side, in the "Axis Systems" and the "Geometrical Set".
I have also googled about this theme, but I didn't find anything.
Could you check my code inside, please?
Code:
Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Dim InputObjectType(0)
InputObjectType(0)="AxisSystem"
Set partDocument1 = CATIA.ActiveDocument
Set selection1 = partDocument1.Selection
Set part1 = CATIA.ActiveDocument.Part
Do
selection1.Clear
Status1 = selection1.SelectElement2(InputObjectType, "Select an AnyObject", True)
Set selectionAxis1 = selection1.item(1).value
Set hybridShapeFactory1 = part1.HybridShapeFactory
Set hybridShapePointCoord1 = hybridShapeFactory1.AddNewPointCoord(100.000000, 100.000000, 100.000000)
Set axisSystems1 = part1.AxisSystems
Set axisSystem1 = axisSystems1.Item(selectionAxis1.name)
Set reference1 = part1.CreateReferenceFromObject(axisSystem1)
hybridShapePointCoord1.RefAxisSystem = reference1
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.2")
hybridBody1.AppendHybridShape hybridShapePointCoord1
part1.InWorkObject = hybridShapePointCoord1
part1.Update
Loop