iLogic Parameter Issue - Inventor 2018.2.3

iLogic Parameter Issue - Inventor 2018.2.3

MattH_Work
Collaborator Collaborator
285 Views
1 Reply
Message 1 of 2

iLogic Parameter Issue - Inventor 2018.2.3

MattH_Work
Collaborator
Collaborator

Can someone check this.

 

Open the attached Part (or create your own)

Using the following code, create an external rule

Run the rule

 

If Parameter("Thickness") = 6 Then
	MessageBox.Show(Parameter("Thickness"), "Thickness")
End If
	
If Parameter("Width") = 10 Then
	MessageBox.Show(Parameter("Width"), "Width")
End If 

 

How come "Width" generates a MsgBox, but "Thickness" does not .

 

 

Note that the code works in an internal rule as expected

If Thickness = 6 Then
	MessageBox.Show(Thickness, "Thickness")
End If
	
If Width = 10 Then
	MessageBox.Show(Width, "Width")
End If

 

If I change the code to the following (adding  .ToString)  then the code works

If Parameter("Thickness").ToString = 6 Then
	MessageBox.Show(Parameter("Thickness"), "Thickness")
End If
	
If Parameter("Width").ToString = 10 Then
	MessageBox.Show(Parameter("Width"), "Width")
End If

 

It seems that the way Inventor reports/records a number to ther user is different to how it keeps the number internally

 

Regards

 

MattH


MattH
Product Design Collection 2026
Vault Pro 2026
0 Likes
286 Views
1 Reply
Reply (1)
Message 2 of 2

bradeneuropeArthur
Mentor
Mentor

Hi,

 

They are both defined as "object" that is why you need the .tostring!

 

If Parameter("Thickness") = 6 Then ' output as object
	MessageBox.Show(Parameter("Thickness"), "Thickness")
End If
	
If Parameter("Width") = 10 Then ' output as object
	MessageBox.Show(Parameter("Width"), "Width")
End If 

Par.Object.png

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