Component.Visible (iam)

Component.Visible (iam)

marcin_bargiel
Advocate Advocate
1,596 Views
20 Replies
Message 1 of 21

Component.Visible (iam)

marcin_bargiel
Advocate
Advocate

i got subassembly  abc.iam which has three parts :  a:1, b:1, c:1 (one or two of them are always hidden)

 

when first time i put it to main assembly ---> main.iam,  some part are visible other are hidden - that GREAT !

but then when i need to  set on demand :  visible or not  - abc:1 using below function - all parts are set as visible !

 

SyntaxEditor Code Snippet

Component.Visible("abc:1")=True 
Component.Visible("abc:1")=False

and now a big question : why this function set visibility to all of my parts in "abc:1" not just to only ones which has set visibility   !????

it is at least not understandable behavior ...

 

i don't want to set visibility or hidden of all parts separately one more time in main.iam !

 

 

 

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes
Accepted solutions (1)
1,597 Views
20 Replies
Replies (20)
Message 21 of 21

marcin_bargiel
Advocate
Advocate

THANK'S A LOT FOR YOUR TIME !  Now works great !!!

 

In the meanwhile i did workaround, that also is OK.

SyntaxEditor Code Snippet

For Each comp In doc.ComponentDefinition.Occurrences
 comp.Visible = False
 Try
 comp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
 Catch
 End Try
 comp.Excluded = True 
 Next
End If

 

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes