I am trying to write a routine that changes the Drawing file name based on the Part or assy properties. I must not be searching for the right thing. I am not finding what I am looking for.
I have the routine written for savinging the current document (part or assy). But I want this to work for the drawing. combining the custom properties of the referenced file of the drawing.
I am not getting how to grab the variables. I have not programed significantly in years.
I assume what I am wanting to do has been written but I have not found something similar.
any help, hints or direction would be greatly appreciated.
Robert ONeill
Hi Robert
With API you can get first the drawing (swApp.ActiveDoc) then drawing sheet (swdraw.GetCurrentSheet) and All views(swSheet.GetViews)
From each view (or maybe 1st view in your case) you can get a referenced model (Set refModel = swView.ReferencedDocument)
And then using CustomPropertyManager get the required property and rename the drawing using it.
Regards
Viktor