boolean with text

boolean with text

martinhoos
Advocate Advocate
1,150 Views
10 Replies
Message 1 of 11

boolean with text

martinhoos
Advocate
Advocate

Hello,

i dont understand that following code is not running...

 

boolean1 = True
boolean2 = False

If Typ = "left" Then
Typ_1 = boolean1
ElseIf Typ Then
Typ_1 = boolean2
End If

If Typ = "right" Then
Typ_2 = boolean1
ElseIf Typ Then
Typ_2 = boolean2
End If

If Typ = "middle" Then
Typ_3 = boolean1
ElseIf Typ Then
Typ_3 = boolean2
End If

 

If i Change the code from text to number (1, 2, 3) it will run. What is wrong?

Thanks in advance.

Regards

Martin

0 Likes
Accepted solutions (1)
1,151 Views
10 Replies
Replies (10)
Message 2 of 11

bradeneuropeArthur
Mentor
Mentor

Change to this:

 

Dim boolean1 As Boolean
Dim boolean2 As Boolean
boolean1 = True
boolean2 = False

If Parameter.Param("Typ").Value = "left" Then
	msgbox ("d")
End If

If Parameter.Param("Typ").Value = "left" Then
	iProperties.Value("Custom", "Typ_1") =  boolean1
Else
iProperties.Value("Custom", "Typ_1") =  Boolean2
End If

If Parameter.Param("Typ").Value = "right" Then
	iProperties.Value("Custom", "Typ_2") =  boolean1
Else
iProperties.Value("Custom", "Typ_2") = Boolean2
End If

If Parameter.Param("Typ").Value = "middle" Then
	iProperties.Value("Custom", "Typ_3") =  boolean1
Else
iProperties.Value("Custom", "Typ_3") =  Boolean2
End If

If you have questions please let me know.

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 3 of 11

dgreatice
Collaborator
Collaborator

hi,

 

are this workflow?

1. Create rule ?

2. then Create UserParameter?

 

I got same error.

 

but if you change workflow

1. create UserParameter

2. then create rule, and capture all UserParameter.

 

its not showing error. I don't know its bug or what else.

 

my screencast are pending, you can see at:

http://autode.sk/2DlXgcT

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 4 of 11

bradeneuropeArthur
Mentor
Mentor

if all parameters and custom properties are defined then this give no error.

 

I assume that this is the case.

 

Seems to be buggy what you showed.

 

 

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 5 of 11

martinhoos
Advocate
Advocate

Hello dgreatice,

i did it your way - but it didnt run. Please check the sample part.

Thank you very much.

Regards Martin

 

 

0 Likes
Message 6 of 11

dgreatice
Collaborator
Collaborator

I'm sorry @martinhoos

 

I cant open higher version. I using inventor 2014.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 7 of 11

bradeneuropeArthur
Mentor
Mentor
Accepted solution
boolean1 = True
boolean2 = False
MsgBox (Typ)
If Parameter.Param("Typ").Value = "left" Then
Parameter.Param("Typ_1").Value = boolean1
Else
Parameter.Param("Typ_1").Value = Boolean2
End If


If Parameter.Param("Typ").Value = "right" Then
Parameter.Param("Typ_2").Value = boolean1
Else
Parameter.Param("Typ_2").Value = Boolean2
End If

If Parameter.Param("Typ").Value = "middle" Then
Parameter.Param("Typ_3").Value = boolean1
Else
Parameter.Param("Typ_3").Value = Boolean2
End If

I have tested and this works. 

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

Message 8 of 11

martinhoos
Advocate
Advocate

Thank you very much - your code is running.

Regards Martin

0 Likes
Message 9 of 11

aronmatheus
Advocate
Advocate

How is take the part number the side forms how the consequence the dimensions I chose in form?

0 Likes
Message 10 of 11

martinhoos
Advocate
Advocate

Hello Aron,

sorry, but i didnt understand your question.

Regards from Germany

Martin

Message 11 of 11

aronmatheus
Advocate
Advocate

Hi, Martin! I would like to change a dimension in the form there the consequence change a part number to the same form, to show when I change the dimensions see what part I'm chosen.

6.png

0 Likes