Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Can I use iLogic to write a description similar to how the "<>" works in the iproperties "description"?

chris
Advisor
Advisor

Can I use iLogic to write a description similar to how the "<>" works in the iproperties "description"?

chris
Advisor
Advisor

I am wondering how to create a description from parameters and regular text similar to how you are able to create descriptions in the iProperties "Description" slot.

 

Description example: =<TUBING, SQUARE <Width> X <Height> X <Length> LONG

 

how would I write this same type of "description" in iLogic using the parameters (Width, Height, Length) and the plain text of TUBING, SQUARE & Long)

0 Likes
Reply
Accepted solutions (1)
605 Views
8 Replies
Replies (8)

tyler.warner
Advocate
Advocate

How about something like this. The underscores are to break the text into multiple lines.

 

 

iProperties.Value("Project", "Description") = "<TUBING, SQUARE <" _
& Parameter("Width") _
& "> X <" & Parameter("Height") _
& "> X <" & Parameter("Length") _
& "> LONG"

 

 

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes

Curtis_Waguespack
Consultant
Consultant

Hi @chris 

 

I don't think you can insert the Parameters to be a "live" formula in this way, instead you must use iproperties.

 

Meaning that if you use Parameters it will simply get the value of the parameter at the moment, and will not update the description if the parameter changes in the future ( unless the rule runs).

 

What you can do though is export the parameter as an iProperty:

 

Curtis_Waguespack_0-1674688023931.png

 

Then you can use something like this to set the formula in the description:

 

iProperties.Value("Project", "Description") = _
"= TUBING, SQUARE <Width> X <Height> X <Length> LONG"

 

This will give you a result such as this:

 

Curtis_Waguespack_4-1674688344243.png

 

 

Recall that you can format the way the parameter export by right clicking them as shown:

Curtis_Waguespack_3-1674688177298.png

 

And then using these options:

 

Curtis_Waguespack_2-1674688160077.png

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

0 Likes

chris
Advisor
Advisor

@Curtis_Waguespack Yes, this is how I have always done this, except last night it wasn't working.

 

see video

 

0 Likes

chris
Advisor
Advisor

what I want to do with the square / Rect tubing is to have the parameter "Shape" be available in the description... but it's not working 

chris_0-1674689471502.png

 

 

0 Likes

A.Acheson
Mentor
Mentor

If the parameter is a text parameter this won't work directly because of the lack of export option to iproperty.

 

You need the ilogic rule first to create a custom iproperty and set it to the parameter value.  

iProperties.Value("Custom", "Shape") = Shape

What is being used in the forumula is not the parameter but rather the iproperty name either. 

AAcheson_0-1674693283351.png

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

chris
Advisor
Advisor

@A.Acheson @Curtis_Waguespack @tyler.warner 

 

Tyler, I've never seen the "case" word in iLogic, what is that?

 

0 Likes

A.Acheson
Mentor
Mentor
Accepted solution

Here is how to remove unit identifier for inches [ " ]  from a string. Use the string function replace. 

 

AAcheson_3-1674703042640.png

 

 

1. Populate Description by code

 

 

'Trigering Criteria, Local Parameters are only used to trigger the rule to run. 
a = Width 
b = Height
c = Thk

'Replaces " with Empty String.
Dim width As String = iProperties.Value("Custom", "Width").ToString.Replace("""", "")
Dim height As String = iProperties.Value("Custom", "Height").ToString.Replace("""", "")
Dim thk As String = iProperties.Value("Custom", "Thk").ToString.Replace("""", "")

'Set Description iproperty.
iProperties.Value("Project", "Description") = "L " & width & " x " & height & " x " & thk & " x "

 

 

 Result:

AAcheson_2-1674701145488.png

 

2. Populate Description by expression:

= L <Width> X <Height> X <Thk>

 

AAcheson_5-1674703974214.png

 

 

 

 

'Trigering Criteria, Local Parameters are only used to trigger the rule to run. 
a = Width 
b = Height
c = Thk

'Replaces " with Empty String.
iProperties.Value("Custom", "Width") = iProperties.Value("Custom", "Width").ToString.Replace("""", "")
iProperties.Value("Custom", "Height") = iProperties.Value("Custom", "Height").ToString.Replace("""", "")
iProperties.Value("Custom", "Thk") = iProperties.Value("Custom", "Thk").ToString.Replace("""", "")

 

 

 

 

Triggering this rule was a lot trickier than I had imagined.

What did Work:

It is necessary to have the local parameters in the rule in order for the rule to be automatically triggered on parameter change.

What didn't work:

  • Simply setting the rule to run on the event trigger of change of iproperties did not work. Changing the parameter and exporting the parameter is not considered a change to iproperty it seems. 

AAcheson_4-1674703307703.png

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

chris
Advisor
Advisor

FYI, I got it figured out !!!!!

0 Likes