elmundo777
Automotive
- Jun 23, 2020
- 93
Hi everyone!
I'm interested in the issue of automating boolean operations. There are always two bodies statically. But always different names. How can I assign a button to remove the second body from the first?
What the macro records when executed is not entirely correct. And there is a link to the name of the documents:
I'm interested in the issue of automating boolean operations. There are always two bodies statically. But always different names. How can I assign a button to remove the second body from the first?
What the macro records when executed is not entirely correct. And there is a link to the name of the documents:
Code:
Sub CATMain()
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim shapeFactory1 As ShapeFactory
Set shapeFactory1 = part1.ShapeFactory
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("[b][COLOR=#8AE234]new77777777777777777777777777777777.1\PartBody[/color][/b][i][s][/s][/i]") [COLOR=#EF2929]<--Something universal is needed here. since it is known that the second body is always removed from the first.
and this automatically recorded macro does not work, but only deletes the body.[/color]
shapeFactory1.AddNewRemove body1
part1.Update
End Sub