Adding Custom Iproperty with formula

Adding Custom Iproperty with formula

J.VandeMerckt
Advocate Advocate
311 Views
4 Replies
Message 1 of 5

Adding Custom Iproperty with formula

J.VandeMerckt
Advocate
Advocate

Hi everyone

I want to add a Custom Iproperty looking like this

JVandeMerckt_0-1710514896592.png

 

Right now I'm using this code but it just adds the Iproperty and uses the current appearance.

iProperties.Value("Custom", "Color")=iProperties.PartColor

 The value should change when the color changes.

Therefore the value should be =<Appearance>

 

I can't figure out how I can add this value using Ilogic.

Can anyone help me update the code?
Can't find it on trusty google.

 

Thanks in advance!
BR

0 Likes
312 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @J.VandeMerckt.  Try this:

 

iProperties.Value("Custom", "Color") = "=<Appearance>"

It just so happens that there is a standard iProperty already named "Appearance" near the end of the third PropertySet, which makes this work, because otherwise you would have to have a custom iProperty named Appearance, then have a way to keep its value up to date every time the appearance changed.  And there is no event in the Event Triggers dialog for only changing the appearance of a part, but there is one for changing its material.

 

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

WCrihfield
Mentor
Mentor

Below are two different ways to access the standard iProperty, so that you do not even need to create the custom one.

Dim sAppearance1 As String = iProperties.Value("Project", "Appearance")
Logger.Info("Appearance 1 = " & sAppearance1)
Dim sAppearance2 As String = ThisDoc.Document.PropertySets.Item(3).Item("Appearance").Value
Logger.Info("Appearance 2 = " & sAppearance2)

When I ran that rule on my part, the results in my iLogic Log window were as follows (which was correct, and stayed up to date):

INFO| 3: >>---------------------------
INFO|Appearance 1 = Dark Gray
INFO|Appearance 2 = Dark Gray

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 5

J.VandeMerckt
Advocate
Advocate
Hi Thank you for your response.

Good to know but I still need to know how to add a custom iProperties with a formula as value.
The system I'm using is now programmed to search for the custom iProperties and not the imbedded Inventor properties.
Br
0 Likes
Message 5 of 5

J.VandeMerckt
Advocate
Advocate
On a second look.
It seems that the people who setup this "system" have cleaned up their code.
Now it looks for the imbedded appearance Property instead of a custom one.
So no problem anymore.

Tnx for the help either way.
0 Likes