Convert Numeric parameter to Text parameter

Convert Numeric parameter to Text parameter

DRoam
Mentor Mentor
1,020 Views
4 Replies
Message 1 of 5

Convert Numeric parameter to Text parameter

DRoam
Mentor
Mentor

Was surprised I couldn't find this somewhere. Is it possible to use iLogic to convert a numeric parameter to a text parameter?

 

I have dozens and dozens of "smart parts" in our designs with a unitless parameter and we recently came upon a need to enter non-numeric values. We control these smart parts with iLogic so if I can add a snippet to convert the parameters to Text then all will be fine. If not then we'd have to delete and recreate which will lose all references to the parameter in drawings, etc.

0 Likes
1,021 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

It's not supported to be able to convert an existing numeric parameter to a text parameter.  However, a relatively easy workaround is to delete the numeric parameter and create a new text parameter using the same name. 

 

Some functionality is only supported by numeric parameters, so if you're taking advantage of that functionality, you'll lose it.  For example, only numeric parameters can be exported as iProperties.  Also, it's only numeric parameters that can reference other parameters in an equation.  In fact, you won't be able to delete an existing parameter if it's being referenced in the equation of another parameter.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 5

bradeneuropeArthur
Mentor
Mentor
Please explain what you want to achieve. What is your goal with the text parameter? Maybe there are other, easier solutions...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 5

DRoam
Mentor
Mentor

Sorry for the delay in getting back.

 

To give a little more context, the parameter is currently in a Pipe template file and represents the Schedule of the pipe. Up till now we've only really used Sch. 10, 40, and 80, but recently started using some "STD" schedule pipe.

 

These "smart" template files use iLogic to look up the proper pipe dimensions in an Excel file. The iLogic looks at the "Schedule" and "Nominal size" parameters, and cross-references that with the Excel table to determine the proper OD and thickness.

 

In addition, the iLogic also checks the Excel spreadsheet for the available Schedule sizes and uses that to populate a multivalue list for the Schedule parameter. Hence the problem with the Schedule parameter being numeric. If I add some "STD" schedule rows to the Excel table, the iLogic will try to add those to the Schedule multivalue parameter list, which will result in an error because "STD" is not numeric.

 

Changing my template so that the Schedule parameter is a text parameter isn't an issue. I can just delete and re-create it. The problem is my dozens to hundreds of existing files.

 

I guess the best solution for them is to have the iLogic rule check if the "Schedule" parameter is numeric or text-type, and if it's numeric, delete it and re-create it as a Text parameter. Then proceed to populate the multi-value list.

 

I was hoping to avoid that because deleting and re-creating parameters breaks any existing references to that parameter. But I suppose text parameters can't be referenced anyway...

 

So I guess having my iLogic rule delete and re-create hopefully shouldn't be an issue...

 

Is that my best option?

0 Likes
Message 5 of 5

bradeneuropeArthur
Mentor
Mentor
  1. you could also replace the Excel file that is filled in like you said and update this. I have a code for this.
    if you do a loop for all parts and replace the excel file than this should be solved easier.
  2. otherwise can't you export a complete new parameter with the Xls file and base your ilogic code on that. so do a combination of two parameters to a new parameter like par1 = SH par2 = 40 and par3 = par1 & par2 with result SH4

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes