×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Reading Custom Properties for Macros

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

RE: Reading Custom Properties for Macros

value = Part.GetCustomInfoValue("mud", "material sz")
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources