Reading Occurrence Visibility

Reading Occurrence Visibility

Anonymous
Not applicable
353 Views
1 Reply
Message 1 of 2

Reading Occurrence Visibility

Anonymous
Not applicable

Hello, am trying to read occurrence visibility using

 

VARIANT_BOOL isVisible; 

occurrence->get_Visibility (&isVisible); 

 

but above function does not return anything , is there any other way to read occurrence visibility ?

 

Regards. 

0 Likes
354 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I am not sure what language you are using, but this is all that is needed in VB

 

Of course you would need to set it up recursive to check all components in sub assemblies.

 

Public Sub isVisible()

Dim oAssemDoc As AssemblyDocument
Set oAssemDoc = ThisApplication.ActiveDocument

Dim oAssemCompDef As ComponentDefinition
Set oAssemCompDef = oAssemDoc.ComponentDefinition

Dim ooCC As ComponentOccurrence

For Each ooCC In oAssemCompDef.Occurrences
    MsgBox (ooCC.Name & ": " & ooCC.Visible)
Next


End Sub

0 Likes