Reading Custom Properties for Macros
Reading Custom Properties for Macros
(OP)
I've been trying to write a macro to automate saving my models and drawings into a couple different formats.
The macro works great except that I can't get the macro to automate naming my parts. If I bring up an InputBox and ask the user to input the info it works fine. But I really want to be able to read data from the property table which I can't figure out how to do.
Under the custom tab of properties I have a property called "PartNo" of the type "text" and the value "012345". How exactly can I specify in the VBA script that I want to read the value for that property?
Thanks
The macro works great except that I can't get the macro to automate naming my parts. If I bring up an InputBox and ask the user to input the info it works fine. But I really want to be able to read data from the property table which I can't figure out how to do.
Under the custom tab of properties I have a property called "PartNo" of the type "text" and the value "012345". How exactly can I specify in the VBA script that I want to read the value for that property?
Thanks






RE: Reading Custom Properties for Macros
If value = "" Then matsz(x) = Part.GetCustomInfoValue("", "material sz")
This reads value from the custom properties (material sz in this case - this is used for a BOM macro)for the "mud" configuration. If the property does not exist in that configuration, it reads it from the root properties.
value is a string
part is a modeldoc2 (object)
"mud" is the configuration name (string)if it is "", then it reads the properties from the root.