AnsweredAssumed Answered

Macro to get material from a drawing

Question asked by Lewis Russell on Aug 7, 2018
Latest reply on Aug 7, 2018 by Alex Burnett

I am trying to write a macro which will get the weight and material of the part/model the drawing is of, to check that they are not the default values/empty. How do I get the material properties, as I would rather have it that the part does not need to be open while it is, although if the part needs to be open temporary to get the material that would be fine but I would rather it didn't need to be.


The easiest way I would think of would be to make a new custom property on the sheet which was the material which would link to the material of the part, but I can't work out how to do that.

The macro also will be read/doing other things to the drawing, so it needs to stay open and used just for that, and it needs to be one macro to get the material and the other things, as otherwise the macro will not always be used.


Any help would be appreciated, and if there is any questions please ask.