Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trim parameter values for trailing zeros

2 REPLIES 2
Reply
Message 1 of 3
Skadborg.NTI
313 Views, 2 Replies

Trim parameter values for trailing zeros

If I set the value of a numerical parameter with this code:

SyntaxEditor Code Snippet

ThisDoc.Document.ComponentDefinition.Parameters.Item("test").Value=100

then the parameter actually gets the value 1000,00000000 mm. Of course it has no impact on my model, but the visual presentation of my input forms are cluttered by all these trailing zeros.

Any suggestion on how to trim the trailing zeros?

2 REPLIES 2
Message 2 of 3
ekinsb
in reply to: Skadborg.NTI

What do you mean by "input forms"?  Do you mean Inventor dialogs or your custom dialogs?


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3
Skadborg.NTI
in reply to: ekinsb

If I make an iLogic form, and then expose the parameter on that form:

 

Forms.png

 

 

 

 

 

 

 

 

 

 

 

 

The first is when the value is entered through build-in Inventor dialogs. like fx.

The second is after changing the value through the API with this:

ThisDoc.Document.ComponentDefinition.Parameters.Item("test").Value=100

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

Post to forums  

Autodesk Design & Make Report