change value of parametrized iproperty

change value of parametrized iproperty

dibujocad
Enthusiast Enthusiast
681 Views
2 Replies
Message 1 of 3

change value of parametrized iproperty

dibujocad
Enthusiast
Enthusiast

Hi everybody, I'd like to change the text included in an iproperty value through VBA.

The problem is that the value of this iproperty is linked to a parameter of the part and I wouldn't like to break this link.

I mean, if my value is "#15 mm ST52", I'd like to change it to "#15 mm ST44".

The value "15" is linked to a parameter of the part, but the text "ST52" isn't.

I know that it's possible make changes without losing the link manually, clicking the symbol "fx" next to the iproperty value. However, if I directly change the value through VBA, I lose the link

Would it be possible to change the text through a macro without lose the link?

 

 

0 Likes
Accepted solutions (1)
682 Views
2 Replies
  • VBA
Replies (2)
Message 2 of 3

theo.bot
Collaborator
Collaborator
Accepted solution

Expression is a value from the iproperty that you can get or set. Here's a sample:

 

Dim oDoc As PartDocument
oDoc = ThisDoc.Document 

'Get/Set property:Description
oDescription = oDoc.PropertySets.Item("Design Tracking Properties").Item("Description")

oDescription.Expression = "=<Thickness>mm is my expression" 

 

0 Likes
Message 3 of 3

dibujocad
Enthusiast
Enthusiast

Thanks @theo.bot . That's exactly what I was looking for