Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Excel parameters - disable parts

3 REPLIES 3
Reply
Message 1 of 4
m.rondeel
1010 Views, 3 Replies

Excel parameters - disable parts

Hi there,

 

I have linked my inventor drawing to excel to adjust some parameters. Is it also possible to have a enable/disable function in excel so a part in an assembly can be disabled at will?

 

Thanks in advance!

 

 

3 REPLIES 3
Message 2 of 4
Passi
in reply to: m.rondeel

Hi,

 

which version of Inventor do you use?

 

If you have ilogic on board you can solve it by using a specific value in your excel.

 

If value_x=1 then suppress feature y 

 

You only need a trigger to give inventor the start sign. 

 

Best Regards

 

Passi 

Message 3 of 4
m.rondeel
in reply to: Passi

Thanks for the reply,

 

I use the lastest version, 2012 SP1, only i never worked with iparts. 

 

I tried to 'add rule' and then inserted this

If value_x=0 Then suppress Component.IsActive("part") = True
But this generates errors (not english)
translated:
Error on Line 1: The name was not suppress declared.
Error on Line 1: Method arguments must be enclosed in brackets.
Message 4 of 4
Passi
in reply to: m.rondeel

I hope you don't insert the code example that way, it was only a text for describing what I mean and not a correct syntax 😉

 

I thinked about it and i think, I'ts not possible to create it via ilogic, because in my opinion you have to create a single LOD  for each variant. But I will think about it later on 🙂

 

So it's better to create it via VBA.

 

This is a example for Suppressing a part in an assembly, if you know the correct name and folder of the part you want to suppress: In this case it's the part "flange.ipt" in "c:\"

 

Public Sub Suppress()
    Dim AssemblyDoc As AssemblyDocument
    Set AssemblyDoc = ThisApplication.ActiveDocument

    Dim AssemblyDef As AssemblyComponentDefinition
    Set AssemblyDef = AssemblyDoc.ComponentDefinition
    
    On Error GoTo Error1:
    Dim SearchPart As Document
    Set SearchPart = ThisApplication.Documents.ItemByName("C:\flange.ipt")
    
    Dim SearchPartOccurrence As ComponentOccurrencesEnumerator
    Set SearchPartOccurrence = AssemblyDef.Occurrences.AllReferencedOccurrences(SearchPart)

    Dim OccurrenceOfSearchPart As ComponentOccurrence
    For Each OccurrenceOfSearchPart In SearchPartOccurrence
OccurrenceOfSearchPart.Suppress True
Next Error1: End Sub

 

Then Inventor will create a LOD by it's own. But you have to execute the Macro to create the changes. Or you create a start for the macro by open the assembly doc.

 

 

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

Post to forums  

Autodesk Design & Make Report