Yes or No on a Form to Suppress a feature

Yes or No on a Form to Suppress a feature

AMN3161
Advocate Advocate
2,154 Views
19 Replies
Message 1 of 20

Yes or No on a Form to Suppress a feature

AMN3161
Advocate
Advocate

Hello everyone,

 

I am rather new to ilogic, i just do simple rules most of the time.

 

What I am trying to is that I build a form to automatically created a lifting diagram for lifting our sytems. I want a option to better show the position of something through a Custom "Yes or No" Iproperty to suppress a feature. All of the search results have been for building a yes or no pop up through the Ilogic. 

 

I want to use the Custom Yes or No Iproperty that is controlled through a Form, then that form selection will tell a certain feature to be suppressed.

 

How would i go about doing that? just even a small example will be enough for me to build off of

 

thank you

0 Likes
Accepted solutions (1)
2,155 Views
19 Replies
Replies (19)
Message 2 of 20

philip1009
Advisor
Advisor

Here's a quick sample:

 

SyntaxEditor Code Snippet

If iProperties.Value("Custom", "PropertyName") = "Yes" Then
	Feature.IsActive("featurename") = True
	'Or
	Component.IsActive("Part1:1") = True
	'Etc.
ElseIf iProperties.Value("Custom", "PropertyName") = "No" Then
	'Etc.
End If

Also, on your Ribbon, go to Manage > iLogic > Event Triggers, and then you can set the rule to run automatically when the right event occurs, such as iProperty Change.

0 Likes
Message 3 of 20

AMN3161
Advocate
Advocate

I will give this a shot, out of curiosity, what does "Etc." do?

0 Likes
Message 4 of 20

philip1009
Advisor
Advisor

Sorry I should have explained, whenever you put an ' in code, anything typed in after that will be ignored by the code and will be grayed out in the iLogic code editing window.  It's basically used for personal notes or comments, same thing with the 'Or, you can just erase that and put in your code.

 

EDIT:  If you're interested, here's a YouTube playlist for a tutorial on Visual Basic, which is what iLogic uses, there are slight differences between Visual Basic and iLogic, but it's mostly the same:

 

https://www.youtube.com/watch?v=1mg3NHwGkas&index=4&list=PLC601DEA22187BBF1

0 Likes
Message 5 of 20

AMN3161
Advocate
Advocate

I tried using that rule and i am getting a error saying that it can only be used in a assembly. I may of not described it well but i need the  Yes or No form box to suppress a feature within a part file.

0 Likes
Message 6 of 20

philip1009
Advisor
Advisor

If you meant turning a part feature on or off from an assembly level:

 

SyntaxEditor Code Snippet

Feature.IsActive("Part1:1", "featurename")
0 Likes
Message 7 of 20

AMN3161
Advocate
Advocate

I am trying to suppress a feature within a ipart. There is no assembly in this situation. I tried to manipulate the code you originally gave me to try to get it to work at the part level. I think is see how you built the first sample you gave me.

 

I am getting this error now "Conversion from string "Yes" to type 'Boolean' is not valid."

 

Basically what I am trying to build is a lifting spreader bar so we can show lifting details on how to lift out 20,000 lb + systems. This lifting ipart will be used on many different size and orientation skids.  

 

SyntaxEditor Code Snippet

If iProperties.Value("Custom", "Lifting_Ears_Option") = "Yes" Then
		Feature.IsActive("Rotate 1") = True
ElseIf iProperties.Value("Custom", "Lifting_Ears_Option") = "No"
End If

 

0 Likes
Message 8 of 20

bradeneuropeArthur
Mentor
Mentor
You can do this without programming.
Do you like to know how?
Or isn't this what you need?

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 9 of 20

philip1009
Advisor
Advisor

There's the issue, iParts use a different line of code.  Any different iParts have to be managed in an iPart master file.  Then you change the iPart row to use in an assembly, if it's an iAssembly, then manage iPart rows in the iAssembly table.  If it's a regular assembly and you want to change which iPart row to use in an assembly you have to use the snippet:

 

SyntaxEditor Code Snippet

iPart.FindRow("iComponentName:1", "columnName", "<=", 0.2, "columnName", "<=", 4.1)

You don't need to use the last 3 statements if you don't need them, just leave them blank.  Input the column name such as part number or Length, then use = < > or a combination of those, then input the number, boolean or string to compare.

0 Likes
Message 10 of 20

AMN3161
Advocate
Advocate

The part I have is not a ipart factory, it is just a standard ipart with a form driving a couple dimensions. I just need the a custom iproptery that i created that has a "Yes or No" option to drive the suppression on a "Move Body" Feature.

0 Likes
Message 11 of 20

philip1009
Advisor
Advisor
Accepted solution

Every iPart is either the factory master or is exported from an iPart factory.  I'm guessing you're just copying a factory master as a template.  Here's a sample code for you:

 

SyntaxEditor Code Snippet

'Yes on Custom Property = True, No on Custom Property = False
If ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties").Item("PropertyName").Value = True Then
	Feature.IsActive("Move Body") = True
Else
	Feature.IsActive("Move Body") = False
End If

Make sure to set this rule in your Event Triggers under iProperty Change.

 

If this doesn't work you might have to provide a sample of some kind.

0 Likes
Message 12 of 20

AMN3161
Advocate
Advocate

That is exactly what i needed, really appreciate it!

 

Thank you!

0 Likes
Message 13 of 20

bradeneuropeArthur
Mentor
Mentor

This all can be done easier without programming.

Why you need illogic or any programming for this if you can do  it with parameters and suppression.

This is out of the box inventor and no additional knowledge is required!!!!

please let me know if you need an example!

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 14 of 20

AMN3161
Advocate
Advocate

I wast not aware that a iproperty Yes or No selection can be used to suppress a feature. Can you show me a example?

0 Likes
Message 15 of 20

bradeneuropeArthur
Mentor
Mentor

SuppressFeature.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
Message 16 of 20

philip1009
Advisor
Advisor

What @bradeneuropeArthur is talking about is if you right click a feature and select Properties, you can choose to have the feature suppressed based on a parameter, but it's not possible to use this for iProperties.

0 Likes
Message 17 of 20

bradeneuropeArthur
Mentor
Mentor

That's correct, but you can export the parameter as property too.

This means the suppression is based on the parameter, but the same property will be created...

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 18 of 20

AMN3161
Advocate
Advocate

Well that will help me later on something other features that I am building into this part. thank you

0 Likes
Message 19 of 20

philip1009
Advisor
Advisor

You can only export numbers from Parameters to iProperties, text and boolean has to be through code.

0 Likes
Message 20 of 20

bradeneuropeArthur
Mentor
Mentor

@philip1009

That is correct.

But this is inventor out of the box.

I thought it would help.

 

Regards,

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