Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Preserv Functions in Iproperties when accessing them with a VBA script

1 REPLY 1
SOLVED
Reply
Message 1 of 2
pball
263 Views, 1 Reply

Preserv Functions in Iproperties when accessing them with a VBA script

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(PartList.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

 

1 REPLY 1
Message 2 of 2
Vladimir.Ananyev
in reply to: pball

Inventor.Property.Expression returns formula.

You may create Expression programmatically as well.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report