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!

Get Custom Properties (Solidworks)

Status
Not open for further replies.

bguenther

Mechanical
Nov 3, 2008
37
Hi,
There are tonns of macros and small programs out there for custom properties but I cannot get out of them what I want. All I am looking to do is have a part or maybe and assembly open, then run the macro and a msgbox will appear giving me the property that I specify in the macro. There is one macro in the API Help but it loops through all the properties and gives you all of them in the debug Window. I would just like to specify which property i want to see.
Any body know this ? Thanks.
 
Replies continue below

Recommended for you

Are you wanting to create the property if it doesn't exist, or edit it if it does, or just read it from the part/assy?

[cheers]
 
The following macro will give the value of the custom property named "Description" for the active document in a message box.

Code:
Sub main()
MsgBox Application.SldWorks.ActiveDoc.Extension.CustomPropertyManager("").Get("Description")
End Sub

-handleman, CSWP (The new, easy test)
 
CorBlimeyLimey I just wanted to get the description property. What handleman has is exactly what i need thanks to both of you.
 
Unless you are mapping the macro to an icon or shortcut key, it would be quicker to assign a key to File > Properties to enable viewing of all properties.

[cheers]
 
I do the same as CorBlimeyLimey, I have a macro as well to have pulldown list but wait for 2009, it is complete and really efficient!
 
I certainly wouldn't go so far as to say that, Matt. It depends on how customized your macro is. Ours stores about five pieces of information about our currently active job, and fills in all five custom properties with a single click.

-handleman, CSWP (The new, easy test)
 
Howdy,

This may have something to do with my next API project. I've seen the demo of 2009 and it looks nice :), but there is one feature related to this that we would like to see. When the drawing is active we'd like to see a list box report/display the custom properties from the model that are not being used on the drawing. I'm still using 2007 SP5.0 - Would someone let me know - Does 2009 give us this information?

Thanks

Tobin Sparks
 
Matt,

You're being too modest. It will probably take SolidWorks 3 or 4 service packs worth of debugging before they're on par with your RigidCustomProperties. [thumbsup]

Joe
SW Office 2008 SP4.0
P4 3.0Ghz 3GB
ATI FireGL X1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor