Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILogic Set Description in IProperties....

4 REPLIES 4
Reply
Message 1 of 5
Ionfreefly
1759 Views, 4 Replies

ILogic Set Description in IProperties....

I am sure this is extremely simple to do but I am missing something. I am wanting to set the Description of a part in the Iproperties using values from the parameters. For instance, if the part has a length value of 10 and a width value of 5 I want the Description to say: 10 x 5 Floor Sheet

I cannot figure out how to extract the parameter values and place them into the iproperties. Here is what I have tried:

iProperties.Value("Project", "Description")="=<Length> x <Width> Floor Sheet"

 

This gives me the following result in my description:

  x  Floor Sheet

 

I am sure I am missing something simple so help would be appreciated. Thanks!

4 REPLIES 4
Message 2 of 5
Ionfreefly
in reply to: Ionfreefly

I figured it out for anyone interested. Here is what I did...

iProperties.Value("Project", "Description")=Floor_Sheet_Length & " x " & Floor_Sheet_Width & " Sub-Floor Sheet"
Message 3 of 5
cwhetten
in reply to: Ionfreefly

Your first bit of code will also work if you make sure your parameters are exported.  Go to the parameters editor, and click the export check box for each parameter that needs to show up in the description.  See below.

 

Export Parameter.png

 

You can then control how the value is displayed in the description by right-clicking on the parameter (in the editor) and choosing Custom Propery Format.  The results are shown below:

 

Custom Property Formatting.png

 

Cameron Whetten
Inventor 2014

Message 4 of 5

Hi Ionfreefly,

 

To add to what cwhetten has shown, you can also export and format the parameters using code as illustrated in this example:

 

oWidth = Parameter.Param("Width")
oWidth.ExposedAsProperty = True
oFormat=oWidth.CustomPropertyFormat
oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
oFormat.Units="in"
oFormat.ShowUnitsString=False

oDepth = Parameter.Param("Depth")
oDepth.ExposedAsProperty = True
oFormat=oDepth.CustomPropertyFormat
oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
oFormat.Units="in"
oFormat.ShowUnitsString=False

oThickness = Parameter.Param("Thickness")
oThickness.ExposedAsProperty = True
oFormat=oThickness.CustomPropertyFormat
oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
oFormat.Units="in"
oFormat.ShowUnitsString=False

iProperties.Value("Project", "Description") = "= TS <Width> x <Depth> x <Thickness>"

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

Message 5 of 5
Ionfreefly
in reply to: Ionfreefly

I was wondering about that! Thanks for the info. Thats a great help!

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

Post to forums  

Autodesk Design & Make Report