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!
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
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.
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.