AnsweredAssumed Answered

VBA Macro get custom property value from drawing when run from model

Question asked by Paul Chaplin on Feb 17, 2016
Latest reply on Feb 17, 2016 by Josh Brady

My company currently has a macro that will create a flat pattern drawing of a sheet metal part and save it as a DXF. In saving the flat pattern drawing as a DXF it grabs the part number, configuration name, and revision of the model from which the flat pattern drawing was made. However we have found that there are certain instances where the revision letter of the model may not be the same as the revision letter of the solidworks drawing for that part (this generally occurs when there are multiple configurations of the part that might have gotten added after the initial revisions, or when one configuration may require a revision that does not apply to the other), and I would like to pull the custom property value for "Revision" from the drawing document. So far I have gotten a macro to pull the custom property value for "Revision" from the drawing, but only by first opening the drawing in question. Depending on the part this could add considerable time to the running of the DXF macro. Is there a way that I can pull the custom property value for "Revision" (or really any custom property value from the drawing document) when the macro is run from the part model (without having the drawing document open), or must I first open the drawing to read its custom properties? All this is being coded in VBA.

Outcomes