iLogic BOM structure to specific part

iLogic BOM structure to specific part

Cosmin_V
Advocate Advocate
1,392 Views
4 Replies
Message 1 of 5

iLogic BOM structure to specific part

Cosmin_V
Advocate
Advocate

Hi,

Can anyone help me?

I have an assembly in which I wanted to change the BOM Structure from "Default" to "Reference" if that part is not visible! 

I managed to change on all the parts that are not visible ... but I only want to 2 of them!

 

Many thanks!

0 Likes
1,393 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Can you explain what your problem is in more detail, so we can better understand the situation, and possibly offer a more precise solution.  Are you wanting someone to post an iLogic rule to loop through all top level assembly components, check whether they are visible or not, and if not visible, change their BOMStructure to Reference?  It sounds like you may have already done this, but it is somehow not exactly what you wanted.  Is there another factor that needs to be checked, and if that factor checks out a certain way, then don't change its BOMStructure, even if it is not visible?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

Cosmin_V
Advocate
Advocate

Hi, @WCrihfield 

 

I want to change the BOM structure to a part that is sometimes visible sometimes not.

I was thinking of something like that....

 

If Component.Visible("00255026:39") = False Then
	Component.Visible("00255026:39") = BOMStructure  Reference
	Else
	Component.Visible("00255026:39") = BOMStructure Default
End If

If the component is visible, then the structure BOM = Default. If not, the BOM structure = reference.

 

0 Likes
Message 4 of 5

Ralf_Krieg
Advisor
Advisor

Hello

 

I think this is not possible in the way you want. If there is more than one occurence of this part in your assembly, one could be visible, another one not. These two occurrences are represented in only one row in BOM. BOM structure Reference or Default?


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 5 of 5

WCrihfield
Mentor
Mentor

Actually, in reference to either the 'Structured' view or 'Parts Only' view of the BOM, I believe that even if there are multiple instances of that same occurrence within the assembly, and you set one or more instances of that component to Reference, but not all of them, it will simply change the total quantity of that component shown within that one line of the BOM, instead of change the state of the whole line in the BOM.

But in reference to the 'Model Data' tab of the BOM, when some, but not all, of the instances of a component are set to Reference, while the rest remain as Default, it will also reduce the total quantity of that component in the one line of the BOM, but it will also create a new line in the BOM to represent just the quantity of that component that have been set to Reference, so they are still being represented/accounted for.

 

@Cosmin_V 

Here is a fairly simple iLogic rule that will loop through all components in your assembly, and if the component's name starts with that component's name (without the part after the colon ":"), it will check it's visibility.  If it is not visible, it will attempt to set its BOMStructure to Reference, or if it is visible, it will attempt to set it to Default.

 

 

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("An Assembly Document must be active for this rule to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
For Each oComp As ComponentOccurrence In oADef.Occurrences
	If oComp.Name.StartsWith("00255026") Then
		If Not oComp.Visible Then
			Try
				oComp.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
			Catch
				MsgBox("Couldn't set component's BOMStructure to Reference.",,"")
			End Try
		Else
			Try
				oComp.BOMStructure = BOMStructureEnum.kDefaultBOMStructure
			Catch
				MsgBox("Couldn't set component's BOMStructure to Default.",,"")
			End Try
		End If
	End If
Next

 

 

Keep in mind though, that if you plan on 'suppressing' these components, you may then have to start dealing with Level of Detail representations (LOD's) to store their suppression state, and it won't let you suppress components if you are currently in either the Master LOD or a locked LOD.

 

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

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes