iLogic Layer Suppession

iLogic Layer Suppession

Anonymous
Not applicable
548 Views
2 Replies
Message 1 of 3

iLogic Layer Suppession

Anonymous
Not applicable

Hello,

I am trying to suppress a layer using iLogic. I want the layer to be suppressed when i have a certian part suppressed in my automated assembly and .idw.

Is it even possible?

0 Likes
549 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Hi,

 I have used something simmilar in one of my idw's.

 

This ilogic rule looks for a custom iproperty called "Type" and depending on it's value suppresses or unsupresses the layers "Detail1" & "Detail2".

I have this under the event triggers, After Open Document.

 

hope this helps.

'Change name of iProp and value to suit
If iProperties.Value(docFname, "Custom", "Type") = "Type1" Then

'change name of layers to suit.
ThisDrawing.Document.StylesManager.Layers("Detail1").Visible = False
ThisDrawing.Document.StylesManager.Layers("Detail2").Visible = True

Else

ThisDrawing.Document.StylesManager.Layers("Detail1").Visible = True
ThisDrawing.Document.StylesManager.Layers("Detail2").Visible = False


End If
0 Likes
Message 3 of 3

Anonymous
Not applicable

this should check the assembly for the component and if suppressed change the custom iprop to suit.

 

 

Dim doc As AssemblyDocument = ThisDoc.Document
Dim oAsmCompDef As ComponentDefinition
oAsmCompDef = doc.ComponentDefinition
Dim oCompOcc As Inventor.ComponentOccurrence
'search through assembly sub components to find one with correct name
For Each oCompOcc in oAsmCompDef.Occurrences

if oCompoCC.name = "INSERT NAME OF COMPONENT HERE"
'if item is not enabled then set Custom iProp "Type" to "False" 
If Component.iComponentIsActive("INSERT NAME OF COMPONENT HERE") = False then
iProperties.Value("Custom", "Type") = "False"
Else
iProperties.Value("Custom", "Type") = "True"
end if

end if

On Error Resume Next
Next
 

This is all from memory but should work.

 

you need to link the custom iprop between the assembly and the drawing.

if you need any further help let me know.

0 Likes