combining text and parameter in ilogic

Geertvdheide92
Enthusiast
Enthusiast

combining text and parameter in ilogic

Geertvdheide92
Enthusiast
Enthusiast

Hello, 

 

I am trying to combine a parameter and text in ilogic if then statement.

the code is saying ')'excpected.

 

the code i'm using is this: 

 

SyntaxEditor Code Snippet

If Standard=1 Then
Size= (Size_2, "In")
ElseIf Standard=2 Then
Size=(Size_2,"mm")
End If

 Size_2 is defined using a excel sheet. 

I set the parameter property format to 0 decimals and no units showing. 

 

So if standard 1 and size_2 is 6mm 

In NXTdim the property Size should show 6 in

 

Or can i edit the formula of "Size" using a formula in custom properties

for example Size= <Size_2> <unit> 

 

but i cant export a text format to custom properties, so not sure if this is possible. 

 

is there a simple option for this issue?

 

kind regards

0 Likes
Reply
Accepted solutions (1)
1,344 Views
6 Replies
Replies (6)

bradeneuropeArthur
Mentor
Mentor

I assume you are Dutch Op based Van NXTDIM?

 

Could you please explain:

 

Standard:  is a parameter or a property and comes from excel

Size: is a parameter or a property and comes from excel

Size_2: is a parameter or a property and comes from excel

Standard :is a parameter or a property and comes from excel.

 

kun je wat meer details geven mbt je wil doen.

Ik begrijp niet helemaal wat je wil doen.

 

Misschien dat nederlands helpt!!

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

Geertvdheide92
Enthusiast
Enthusiast

yes im dutch, 

 

i continue in english so it may help other people

I want to describe the size of a part. 

Depending on the values i get from my excel the units should say "in" or "mm"

 

in my  case the standard and size are values i put in inventor, so i get multiple values from excel.

depending on only the standard value i want to change the units described in the Size.

 

 

currently i found a workaround that works fine. 

the code is: 

SyntaxEditor Code Snippet

If Standard=1 Then
iProperties.Value("Custom","A")=GoExcel.CurrentRowValue("A_1")
iProperties.Value("Custom","B")=""
ElseIf Standard=2 Then
iProperties.Value("Custom","A")=""
iProperties.Value("Custom","B")=GoExcel.CurrentRowValue("B_1")
End If

in Excel column A has the value "in" and Column B has the value"mm"

 

next in custom properties for Size i have the formula

Size= <Size_2><A><B>

 

 

so if standard=1 then A= in and B is empty

 

this way i can combine numbers and text in the custom properties. 

 

0 Likes

bradeneuropeArthur
Mentor
Mentor

So may I understand you solved it yourselves?

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Could be a little bit shorter and less code:

 

If Standard=1 Then
iProperties.Value("Custom","Size")=Size_2.Value  & GoExcel.CurrentRowValue("A_1")
ElseIf Standard=2 Then
iProperties.Value("Custom","Size")=Size_2.Value  & GoExcel.CurrentRowValue("B_1")
End If
If Standard=1 Then
iProperties.Value("Custom","Size")= Parameter.Param("Size_2").Value & GoExcel.CurrentRowValue("A_1")
ElseIf Standard=2 Then
iProperties.Value("Custom","Size")= Parameter.Param("Size_2").Value & GoExcel.CurrentRowValue("B_1")
End If

 

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

Geertvdheide92
Enthusiast
Enthusiast

Ah thank you, 

 

this is indeed the way i was trying to find to combine 2 different types of parameters.

 

 

0 Likes

bradeneuropeArthur
Mentor
Mentor

Maybe it could be easier without Excel if you want too!

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes