I made a simple dialog to access some of the iproperties. This is quite handy when working on a drawing of a part, but there is one flaw with this script. If the part's description has a function referencing the parts dimensions for instance, when my script gets the description it gets the plain text and not the formula. Meaning if the part's description is "=<d0> X <d1> X <d2>" and appears as "1 X 2 X 3" the script will get "1 X 2 X 3" and when it resaves the description it will over write the formula with plain text.
Is it possible to get the formula so my script could display that for editing instead of the plain text?
Below is a part of the code I'm using and it's the standard code I've seen for retreiving ipropterties.
Dim invDoc As Document Set invDoc = ThisApplication.Documents.ItemByName(GetToken(Part
List.Value, 3, Chr(1))) Dim invDesignInfo As PropertySet Set invDesignInfo = invDoc.PropertySets.Item("Design Tracking Properties") Dim invProperty(1 To 4) As Property Set invProperty(1) = invDesignInfo.Item("Part Number") partnumber.Value = invProperty(1).Value Set invProperty(2) = invDesignInfo.Item("Description") description.Value = invProperty(2).Value
Solved! Go to Solution.
Inventor.Property.Expression returns formula.
You may create Expression programmatically as well.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register