Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
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)
Solved! Go to Solution.
Solved by A.Acheson. Go to Solution.
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"
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:
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:
Recall that you can format the way the parameter export by right clicking them as shown:
And then using these options:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Inventor Forum links: Inventor iLogic , API and Customization Forum | Inventor Ideas Forum | General Inventor Forum
@Curtis_Waguespack Yes, this is how I have always done this, except last night it wasn't working.
see video
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
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.
@A.Acheson @Curtis_Waguespack @tyler.warner
Tyler, I've never seen the "case" word in iLogic, what is that?
Here is how to remove unit identifier for inches [ " ] from a string. Use the string function replace.
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:
2. Populate Description by expression:
= L <Width> X <Height> X <Thk>
'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:
Can't find what you're looking for? Ask the community or share your knowledge.