I am writing a macro in VBA to automatically create views for a shipping / lifting drawing.
I am missing how to import the center of mass symbol.
I have tried recording using import model items and it gives me
vAnnotations = Part.InsertModelAnnotations3(0, 0, True, True, False, True)
But the second "0" doesnt do anything.
I then tried recording using the right click "show" on the feature.
boolstatus = Part.Extension.SelectByID2("Center of Mass@prt1-1@Drawing View9", "CENTEROFMASS", 0, 0, 0, False, 0, Nothing, 0)
That is closer, but without the name of the center of mass & view, i am unable to do this for every view/page.
Currently i have it;
- getting a list of files from a directory
- Copying "Sheet1" of a drawing and renaming it to match the part file
- opening the part file, creating (3x) 3d sketches one for bounding box, one for center of mass, and finally one for suggested sling locations/angles.
- While it has the part open it creates a "Center Of Mass Feature"
- It also adds a display state, and hides all other reference geometry but these sketches.
- Adding an isometric view centered in the sheet of the part in the correct display state onto the correct sheet
- importing the model dimensions that are marked for the drawing, and locating them about right.
- Adding a view label with the name of the part file.