iLogic Sub Assembly

iLogic Sub Assembly

Cosmin_V
Advocate Advocate
707 Views
7 Replies
Message 1 of 8

iLogic Sub Assembly

Cosmin_V
Advocate
Advocate

Hi

I have a Assembly whit some Sub Assemblys in.

Because I use Vault and I have to change the name of Assembly when I do copy design, I use this: in Assembly

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition
oDef = oDoc.ComponentDefinition

Dim oSilo1 As ComponentOccurrence = oDef.Occurrences.Item(1)
Dim oSilo2 As ComponentOccurrence = oDef.Occurrences.Item(2)
Dim oSilo3 As ComponentOccurrence = oDef.Occurrences.Item(3)
Dim oSilo4 As ComponentOccurrence = oDef.Occurrences.Item(4)
Dim oSilo5 As ComponentOccurrence = oDef.Occurrences.Item(5)
Dim oSilo6 As ComponentOccurrence = oDef.Occurrences.Item(6)
Dim oSilo7 As ComponentOccurrence = oDef.Occurrences.Item(7)
Dim oSilo8 As ComponentOccurrence = oDef.Occurrences.Item(8)
Dim oSilo9 As ComponentOccurrence = oDef.Occurrences.Item(9)
Dim oSilo10 As ComponentOccurrence = oDef.Occurrences.Item(10)
Dim oSilo11 As ComponentOccurrence = oDef.Occurrences.Item(11)
Dim oSilo12 As ComponentOccurrence = oDef.Occurrences.Item(12)

and this in Sub Assembly:

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition
oDef = oDoc.ComponentDefinition
Dim oFoundation As ComponentOccurrence = oDef.Occurrences.Item(1)
Dim oSilo As ComponentOccurrence = oDef.Occurrences.Item(2)
Dim oConv As ComponentOccurrence = oDef.Occurrences.Item(3)

It is ok is work ok but I have a problem when I want to call a part from Sub Assembly

I don't know how the code should be.

like this is not working:......

If SUPRESS_SILO="Yes" Then
Component.IsActive(MakePath(oSilo1.Name, oSilo.Name))=True
End If

Somebody know how this rule shout be?

 

Many Thanks!

0 Likes
Accepted solutions (1)
708 Views
7 Replies
Replies (7)
Message 2 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support

@Cosmin_V,

 

To suppress the part inside subassembly, try below changes.

 

If SUPRESS_SILO="Yes" Then
Component.IsActive(MakePath(oSilo1.Name, oSilo.Name))= false
End If

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 8

Cosmin_V
Advocate
Advocate

Hi

If SUPRESS_SILO="Yes" Then
Component.IsActive(MakePath(oSilo1.Name, oSilo.Name))=False
ElseIf SUPRESS_SILO="No" Then
Component.IsActive(MakePath(oSilo1.Name, oSilo.Name))=True
End If

 

0 Likes
Message 4 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support

@Cosmin_V,

 

Please provide non confidential and steps to reproduce the error.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 8

Cosmin_V
Advocate
Advocate

Hi           

I am not allowed to share the original one, and I do something quick and same as the original.

I hope is helps.

 

Many Thanks

0 Likes
Message 6 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support

@Cosmin_V,

 

Thanks for data to test,

 

In attached data, complete sub assembly is not present and unable to reproduce the error. Original files are not required to test. But simulate the same hierarchy in assembly.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 7 of 8

Cosmin_V
Advocate
Advocate

Hi                               

Sorry...I was i a hurry. See now

 

Many Thanks!

0 Likes
Message 8 of 8

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@Cosmin_V,

 

Try below iLogic code to suppress part of subassembly.

 

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition
oDef = oDoc.ComponentDefinition

Dim oSilo1 As ComponentOccurrence = oDef.Occurrences.Item(1)
Dim oSilo2 As ComponentOccurrence = oDef.Occurrences.Item(2)
Dim oSilo3 As ComponentOccurrence = oDef.Occurrences.Item(3)

Dim oSilo As ComponentOccurrence = oSilo1.SubOccurrences.Item(2)


MultiValue.SetList("Type", "S120", "S140", "S160")


If Supress_Silo="Yes" Then
Call oSilo.Suppress

ElseIf Supress_Silo="No" Then
Call oSilo.Unsuppress()
End If

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes