Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

boolean with text

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
martinhoos
924 Views, 10 Replies

boolean with text

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

10 REPLIES 10
Message 2 of 11

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:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !

Message 3 of 11
dgreatice
in reply to: martinhoos

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
Message 4 of 11

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:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !

Message 5 of 11
martinhoos
in reply to: dgreatice

Hello dgreatice,

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

Thank you very much.

Regards Martin

 

 

Message 6 of 11
dgreatice
in reply to: martinhoos

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

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:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !

Message 8 of 11

Thank you very much - your code is running.

Regards Martin

Message 9 of 11
aronmatheus
in reply to: martinhoos

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

Message 10 of 11
martinhoos
in reply to: aronmatheus

Hello Aron,

sorry, but i didnt understand your question.

Regards from Germany

Martin

Message 11 of 11
aronmatheus
in reply to: martinhoos

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

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

Post to forums  

Autodesk Design & Make Report