How to suppress the assembly using I logic

How to suppress the assembly using I logic

Anonymous
Not applicable
979 Views
9 Replies
Message 1 of 10

How to suppress the assembly using I logic

Anonymous
Not applicable
 

Hello All

 

 

Please let me know how to hide the sub assembly in  Main assembly using I logic 

I am unable to solve , Kindly help required

 

the i logic is below , 

 

If DR_RTNR_FRT = True Then
	Component.IsActive(MakePath("AS005000", "DT005000")) = True
	
ElseIf DR_RTNR_FRT = False Then
	Component.IsActive(MakePath("AS005000", "DT005000")) = False
End If



 

0 Likes
Accepted solutions (2)
980 Views
9 Replies
Replies (9)
Message 2 of 10

WCrihfield
Mentor
Mentor

First of all, the 'Component.IsActive' function will "suppress" the component, not turn its visibility off.

This would need to use a LevelOfDetail other than 'Master'.  It will turn the component into a Reference Component within the Structured & Parts Only levels of the Main Assembly's BOM, but leave it visible in the Model Data section.

If you just want to 'hide' it within the model screen, you would use the 'Component.Visible("component") = False' line.

 

It kind of looks like you are trying to supress a sub-component of the sub-assembly. Is this what you want?

If this sub-assembly is directly within the main assembly, you would only need to specify the name of that sub-assembly in the () after IsActive, not MakePath("xx","xx").

Also keep in mind, when dealing with component names within an assembly, the name also has the : (colon) plus an Integer at the end of it, to deal with the possibility of having multiple occurrences of the same component within the assembly.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 10

Anonymous
Not applicable

Thanks for suggestion

Basically I have migrated from Creo Platform to Inventor , I believe Creo rules will not to be help full

 

I have attached a snap shot of assembly , My idea is to suppress the assembly "AS00500"

by I logic , Not simply turn off the Visibility which could replicate in BOM

 

I had created Parameter with option of assembly with TRUE/False 

Assembly is selected w.r.t to TRUE/False ( Agenda is to Integrate with Sub assembly with Variety of Options )

 

Is there any way , to do without level of Detailing 

 

If possible can you , Please elaborate ??

Thanks 

Vijay

0 Likes
Message 4 of 10

WCrihfield
Mentor
Mentor

Try something like this.

 

Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
For Each oOcc As ComponentOccurrence In oADef.Occurrences
	If oOcc.Name.Contains("AS00500") Then
		oOcc.Suppress
		'oOcc.Enabled = False
		'oOcc.Visible = False
	End If
Next

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 10

DRoam
Mentor
Mentor

Hi @Anonymous, as you may have discovered, using LoD/suppression is just setting yourself up for headaches. LoD is a memory (as in RAM) management tool. Using it for anything else, like configurations, will just be a pain.

 

If you only ever need to use ONE configuration of your "AS000001" assembly at any given time, your best bet is to "remove" the "AS005000" occurrence by turning its visibility off and overriding its BOM structure to "Reference". This will have the effect of removing it from view AND from the BOM and mass calculations. To "include" it again, you would just turn back on its visibility and reset its BOM structure to "Default".

 

If, however, you might need to place your "AS000001" assembly in some places with "AS005000" included and other places with it excluded, then you'll want to use iAssemblies, which are Inventor's best (though not great) offering for assembly configurations at the moment.

 

Pick which of those options is best for your needs, and let me know if you need help doing it.

0 Likes
Message 6 of 10

Anonymous
Not applicable

Thanks for quick response and your tremendous knowledge 

Solution is looks very simply to supress but to retain by using options .

I believe if I accept the solution , my idea of will be supressed and I really want gain some more knowledge from this forum

 

Let me brief ,  my requirement 

1. I am verge of Semi automate the Panel assembly Which is shown in Image : AS000001

2. Subassembly which is AS005000 need supress by using TRUE/False in Main assembly   AS000001 by using I logic

3. the main idea behind supress  "AS005000" dividing the partions , next level door design

4. If I could supress the "AS005000" , next step I would supress the cut out aswell

5. It cant be done Level of details  , Coz someone use the MAster model without any knowledge of parametric 

   shall be able to use it with min Conditions by selecting the Multi values in parametric 

 

hope I have done my best to brief my idea behind suppress

 

In simple language 

 

If my Parameter : DR_RTN_FRT= True/ False 

if its true the assembly "AS005000 " should appear 

If its False he assembly "AS005000 " should suppress

 

(DR_RTN_FRT ) is nothing but DOOR  FRONT RETAINER

if some could help simple I logic rules would be much appreciated without Level of details

 

Thanks 

Vijay 

 

 

0 Likes
Message 7 of 10

WCrihfield
Mentor
Mentor
Accepted solution

OK. Try this version.

Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
For Each oOcc As ComponentOccurrence In oADef.Occurrences
	If oOcc.Name.Contains("AS00500") Then
		If Parameter("DR_RTN_FRT") = True Then
			If oOcc.Suppressed = True Then
				oOcc.Unsuppress
			End If
			'oOcc.Enabled = True
			'oOcc.Visible = True
		ElseIf Parameter("DR_RTN_FRT") = False Then
			If oOcc.Suppressed = False Then
				oOcc.Suppress
			End If
			'oOcc.Enabled = False
			'oOcc.Visible = False
		End If
	End If
Next

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 10

Anonymous
Not applicable

Thanks a lot ,  I found it help full 

but it is taking to LOD 1 , After Regenerating rule 

 

Wish I could do it in Master itself..

Any how Thanks a lot .

 

I still have one Doubt to clarify

is there any way to Include level of detail in Parameter

Else How to control the level by choosing with either configurations 

 

If any Tutorial , Please share the link

 

Thanks 

Vijay

0 Likes
Message 9 of 10

Anonymous
Not applicable

Again the Issue goes like this 

IF we suppress the assembly with LOD 

in BOM suppressed assembly is showing 

 

 

 

0 Likes
Message 10 of 10

WCrihfield
Mentor
Mentor
Accepted solution

Your image is showing the Model Data tab of the BOM.  That will always show all items within the Assembly.

Use the Structured tab of the BOM, for a more accurate view of what a Parts List would show.

The following code specifically changes the sub-assembly's status within the BOM, from Normal (or wherever it was) to Reference.  It then simply turns its visibility off in the model screen.  Because as I said earlier, suppress and LOD's are mainly just used for reducing memory use.

Try this.

Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
For Each oOcc As ComponentOccurrence In oADef.Occurrences
	If oOcc.Name.Contains("AS00500") Then
		If Parameter("DR_RTN_FRT") = True Then
			oOcc.BOMStructure = BOMStructureEnum.kNormalBOMStructure
			oOcc.Visible = True
		ElseIf Parameter("DR_RTN_FRT") = False Then
			oOcc.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
			oOcc.Visible = False
		End If
	End If
Next

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes