Hello, Guys
I think this is very simple script, but I can't make it.
I made a script to add bodies on Product, not open the window a part.
Of course, I can make it with the selection.
But I don't know how to add bodies without the selection on the Product.
Could you check below my scripts?
The first script is with the Selection, the second script is without the selection.
I think this is very simple script, but I can't make it.
I made a script to add bodies on Product, not open the window a part.
Of course, I can make it with the selection.
But I don't know how to add bodies without the selection on the Product.
Could you check below my scripts?
The first script is with the Selection, the second script is without the selection.
Code:
Sub CATMain()
Set Selection1 = CATIA.ActiveDocument.Selection
Set Selection2 = Selection1.Item(1).Value
Set partDocument1 = CATIA.Documents.Item(Selection2.Name+".CATPart")
Set part1 = partDocument1.Part
Set bodies1 = part1.Bodies
Set body1 = bodies1.Add()
part1.Update
End Sub
Code:
Sub CATMain()
Set partDocument1 = CATIA.Documents.Item(1)
Set part1 = partDocument1.Part
Set bodies1 = part1.Bodies
Set body1 = bodies1.Add()
part1.Update
End Sub