Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB programming function name help ? 1

Status
Not open for further replies.

2000mustanggtguy

Mechanical
Mar 16, 2005
83
Can anybody tell me the correct programming function name that allows me to make a "cutom property" name in SW, lets take for example I have a custom property name called "PLNOTE" i want my macro to add PLNOTE to every drawing I open up, this after I press the play button on my macro toolbar, and for the Type I want Text String, and for the value I want a "-" dash for now. I thought Property Let, Property Get, and Property Set where the right programming functions but I have a bad feeling I'm barking up the wrong tree using these functions, I've tried to use help on custom properties I didn't get anywhere, can anyone help me?

[hammer]

Printed Circuit Board Designer
Salt Lake City, Utah
Stangs rule!
 
Replies continue below

Recommended for you

Respectfully, you are quite disoriented. Property Let/Get/Set are used for module-level property definitions in VB programs. They do not set SW object properties.

The commands you want are ModelDoc2::AddCustomInfo3 and ModelDoc2::CustomInfo2. These require a ModelDoc2 object st to your document of interest. Keep in mind that AddCustomInfo3 does not change or overwrite existing properties.

There is a "Copy Custom Info" macro at < that you may dissect and use, but not plagiarize.

[bat]I could be the world's greatest underachiever, if I could just learn to apply myself.[bat]
-SolidWorks API VB programming help
 
TheTick,

Thanks for you help on AddCustomInfo, the program works great ! I have the program delete all Custom Properties and VB creates the new one, you save me a lot of time. I really didn't feel like entering new properties in a hundred drawings.

[cheers] I drink a pint for you !

Printed Circuit Board Designer
Salt Lake City, Utah
Stangs rule!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor