Ilogic suppress component

Ilogic suppress component

bespel
Advocate Advocate
706 Views
4 Replies
Message 1 of 5

Ilogic suppress component

bespel
Advocate
Advocate

Hi,

 

very simple case.

 

I just want, from the main assembly, to suppress a componnet in a subassembly.

 

es.

 

MAIN_ASSY.IAM

 

      SUB_ASSY.IAM

         COMPONENT.IPT

 

 

I want to suppress the component.ipt with arule in the main assembly.

It should be simple, but it is not

 

0 Likes
707 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

     Are you sure you want to 'suppress' the component, and not just 'turn its visibility off'?  When you suppress components within an assembly, you then have to create a 'level of detail representation' in that assembly to save that suppression state into.  Then whenever you place that assembly into another assembly, and you want it to be represented the same way, you have to set that, now sub-assembly component's representation to the one you saved within it.  Suppression and level of detail representations are pretty much only useful for conserving system memory, for performance purposes in larger assemblies.  It's not even very useful for BOM management, because you still have to change the 'BOM Structure' of the component from 'Default(Norman)' to either 'Reference' or something else for it to have the desired effect in the BOM.

     I usually recommend simply turning visibility of components off, then using 'design view representations' to save their visibility state into.  Then same situation when putting them into other assemblies, you have to ensure the representation is set where you want it.  However, with view representations, you can make them 'associative' so that when something changes in the source component, it will automatically update in any parent assemblies.

 

Here is another link which discusses the 3 types of representations, and what their best used for.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

bespel
Advocate
Advocate

Yes, we want to suppress.

 

View reps are pretty useless for BOM

0 Likes
Message 4 of 5

J-Camper
Advisor
Advisor

Not sure how you want to determine which component to suppress, so this will let the user select the component to suppress:

Sub Main
	If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then MessageBox.Show("This rule is designed to only work in assembly documents.", "Wrong Document Type") : Exit Sub
	
	Dim PickLeafOC As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select a Component to Supress")
	If IsNothing(PickLeafOC) Then Exit Sub ' If nothing gets selected then we're done
	
	PickLeafOC.Suppress()
	
End Sub

It is set up to select "Leaf" Occurrences so if you want to suppress an assembly, you would have to select it in the model browser instead of view window.  Parts will be selectable in both locations.

 

Let me know if you have question, or if this is not working as intended.

Message 5 of 5

bespel
Advocate
Advocate

Thank you!

 

In the meanwhile I have already solved with this.

 

Many thanks!

 

Dim oAsm As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition = oAsm.ComponentDefinition
Dim oSubAsm As ComponentOccurrence = oDef.Occurrences.ItemByName("mysubassy")
Dim oSubDef As AssemblyComponentDefinition = oSubAsm.Definition
Try
	oDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic").Activate
Catch
	oDef.RepresentationsManager.LevelOfDetailRepresentations("iLogic").Activate
End Try

Try
	oSubDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic")
Catch
End Try
oSubAsm.SetLevelOfDetailRepresentation("iLogic")

oSubAsm = oDef.Occurrences.ItemByName("mysubassy")
oSubDef = oSubAsm.Definition



Component.IsActive("Part1:1")=False
0 Likes