Reading 'evaluated value' from custom properties
Reading 'evaluated value' from custom properties
(OP)
I am trying to read the Evaluated Value from my property table but I keep getting text expression. eg. "sw-Material@part.sldprt" rather than Stainless steel.






RE: Reading 'evaluated value' from custom properties
The fourth out parameter of this method "ResolvedValOut" should return evaluated value.
Artem Taturevich
CSWP
RE: Reading 'evaluated value' from custom properties
I've not used this before so if anyone has a few lines of sample code that would be nice.
RE: Reading 'evaluated value' from custom properties
evalValOut is the evaluated value.
Note this macro gets the general custom property named "TestField". To get configuration specific custom property specify the configuration name while retrieving the pointer to Custom Property Manager (Set swCustPropMgr = swModel.Extension.CustomPropertyManager("ConfName"))
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
Dim valOut As String
Dim evalValOut As String
swCustPropMgr.Get3 "TestField", False, valOut, evalValOut
End Sub
Artem Taturevich
CSWP
RE: Reading 'evaluated value' from custom properties
I couldn't get your code to work. I Adjusted it to this:
swCustPropMgr.Get2 "Material", valOut, evalValOut
...and it worked for me
Is the get3 something special? My autocomplete in the compiler doesn't offer it.
RE: Reading 'evaluated value' from custom properties
Do you have an earlier version of SolidWorks?
Artem Taturevich
CSWP
RE: Reading 'evaluated value' from custom properties
RE: Reading 'evaluated value' from custom properties
Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
RE: Reading 'evaluated value' from custom properties
Artem Taturevich
CSWP