SolidWorks API - Pulling Evaulated Custom Property values

Sep 21, 2005 4 Replies

Does anyone know how to get the evaluated value from a custom propert to show in a text box instead of the linked solidworks' dimension pat after an engineer links the dimension to the property (a practice lot of us are doing at my work)



I have a field in a userform that shows the length of a part, but



when my user links that custom property to an actual dimension in th model, he will then see the solidworks pathway to that dimension i the user form text box, when, it would be much more useful to sho him what the value is (instead of the pathway)... like 6" fo example



I have a single picture that shows the solidworks properties interfac



and my userform and the problem I'm talking about. Link below



formatting link



Something interesting to me, is, when this data is eventually writte



to a BOM on a drawing, it pulls the evaluated property (6"), which more or less tells me it's storing that value somewhere



Thanks -d


Typically, API returns the evaluated property, not the formula. In the past, I have tried in vain to do the opposite (extract the formula, not the evaluated value). I'm actually a bit surprised to see what you are showing.

If anyone cares to know..

cPartQtyEval = Part.GetCustomInfoValue(Config.Name

"Length_Area_Assy") 'Grabs evaluated valu ' Where.. ' Part = Active SolidWorks Documen ' Config.Name = Active configuratio ' Length_Area_Assy = Custom Property field of interes

Pretty clean and simple. I was just using the wrong call

The opposite also is worth mentioning. If you have a program that performs calculations and need to show the resultant values on a drawing, it is very easy to programmatically set the custom property value and link that propety to text in a note.

Tony

What call were you using before?

As I mentioned earlier, I have unsuccessfully tried in the past to get the unevaluated value.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required