Hey everyone,
I'm very new to ilogic, infact only started looking into it 3 days ago.
so I may ask some really stupid questions. please bare with me.
the idea i want to acheive is inside ilogic i want to write a rule
that turns on and off parts in BOM (Component.IsActive) and also
show how this component is structured eg: normal, phantom.
eg:
Component.IsActive("Lock Bracket Kit:1")=1
then a code here that references "Lock Bracket Kit:1"
and have an option to tell it to show in the BOM Structure as normal or phantom
is this possible?
use this as you will:
not really a solution but a good starting point.
Public Sub Main() If Component.IsActive("DETAIL B 26310C:1") Then Dim fullName1 As String fullName1 = ThisDoc.Path & "\shell outer _ 26310c rev -.iam" ThisApplication.Documents.Open(fullName1, True) End If If Component.IsActive("DETAIL B 26310C REV1:1") Then Dim fullName2 As String fullName2 = ThisDoc.Path & "\shell outer _ 26310c rev -.iam" ThisApplication.Documents.Open(fullName2, True) End If If Component.IsActive("DETAIL B 26310C REV2:1") Then Dim fullName3 As String fullName3 = ThisDoc.Path & "\shell outer _ 26310c rev -.iam" ThisApplication.Documents.Open(fullName3, True) End If End Sub
thanks m.teleguz1
that is indeed a step in the right direction.
so i need to define the part to be active or not then a if then statement to say IF active THEN show phantom BOM
looking though the forums ive also found another way of doing things instead of using supression to govern bom it uses visiblity.
i wonder which one is the easier code to maintain and keep clean on 3500 part assembly
'This sets to Reference
Component.Visible(ComponentName) = False Component.InventorComponent(ComponentName).BOMStructure = BOMStructureEnum.kReferenceBOMStructure
'This sets to Normal Component.Visible(ComponentName) = True Component.InventorComponent(ComponentName).BOMStructure = BOMStructureEnum.kDefaultBOMStructure
I very recently found this somewhere on http://inventortrenches.blogspot.com/ or http://inventortrenches.blogspot.com/
Can't remember which. But replace Component name with "Lock Bracket Kit:1", and there you go.
Hey dkatz
thanks for your input
i played with the code you provided
'This sets to Reference
Component.Visible(ComponentName) = False Component.InventorComponent(ComponentName).BOMStructure = BOMStructureEnum.kReferenceBOMStructure
'This sets to Normal Component.Visible(ComponentName) = True Component.InventorComponent(ComponentName).BOMStructure = BOMStructureEnum.kDefaultBOMStructure
the 2nd line is not needed
Component.Visible("Part1:1")=1 will show bom normal, 0 will hide and set to reference
Component.IsActive("part1:1")=1 or 0 does the same thing but supress instead of visiblity
which is useful on its own
what i want to acheive is to have a master assembly with sub assemblies and loose iparts within
and have ilogic rules that are capable of controling which sub-assembly shows or doesnt show in the BOM with the ablility to toggle between show sub-assembly as default or show as phantom.
eg:
Component.IsActive("sub-assembly1:1")=True
show ("sub-assembly1:1") in BOM as "Normal"
Component.IsActive("sub-assembly2:1")=True
show ("sub-assembly2:1") in BOM as "Phantom"
etc..
thanks