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: 

If you'd like to be able to put variables directly into strings, please vote!

0 REPLIES 0
Reply
Message 1 of 1
DRoam
282 Views, 0 Replies

If you'd like to be able to put variables directly into strings, please vote!

An update to iLogic could enable a really convenient way to insert variables into strings, called "String Interpolation". It works like this:

 

myString = $"Part {doc.DisplayName} has {compDef.Features.Count} features and {compDef.SurfaceBodies.Count} bodies.")

' Sample result:
' "Part MainBracket.ipt has 7 features and 2 solid bodies."

 

You basically just type in each variable name directly where you want it in the string. This is much easier to write (and read) than the string concatenation or composite formatting techniques that we have to use now.

 

This feature was added in a newer version of the compilers for VB.NET (the language beneath iLogic). There are several other miscellaneous features that were added in the newer compiler versions (full list here). Updating iLogic to use the latest compiler would enable all of these new features.

 

If you think you would find string interpolation or any of those other features useful in your iLogic programming, please give the idea below a vote!

 

Vote here: Update iLogic compiler to support modern and useful VB.NET features.

 

Thanks!

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report