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: 

iLogic check if grounded

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Cosmin_V
447 Views, 3 Replies

iLogic check if grounded

Hello everyone

 

Is there a way to check if a certain component is grounded or not?

 

Thanks!

 

3 REPLIES 3
Message 2 of 4
marcin_otręba
in reply to: Cosmin_V

Dim occ As ComponentOccurrence
Dim ass As AssemblyDocument=ThisDoc.Document
For Each occ In ass.ComponentDefinition.Occurrences
If occ.Grounded Then
	MessageBox.Show(occ.Name & " is grounded", "Title")
End If

Next
Message 3 of 4
Cosmin_V
in reply to: marcin_otręba

Thanks

 

It works, but it's not really what I need.
I want to check in parts, if a certain one is grounded.
It is an assembly with 4 parts and 2 of them shout not to be grounded.
And I want if someone will ground them to receive a message.

Message 4 of 4
marcin_otręba
in reply to: Cosmin_V

If Component.InventorComponent("40-4-019626:1").Grounded Then
	MessageBox.Show(Component.InventorComponent("40-4-019626:1").Name & " is grounded", "Title")
End If

change  40-4-019626:1 to your component name

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

Post to forums  

Autodesk Design & Make Report