Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Creating a Ilogic Rule to export custom property from BOM into part Property

kristianhric
Explorer

Creating a Ilogic Rule to export custom property from BOM into part Property

kristianhric
Explorer
Explorer

Hello everyone,

I am fairly new to I Logic and am looking to export a custom I Property column from the BOM menu in an assembly (labeled Finish) into each part, and create a custom property there Labeled finish. I have found one similar that does quantity so i was wondering of i can do that with finishes this way i can update any finish in the BOM instead of opening each part individually.

Thank you

0 Likes
Reply
Accepted solutions (1)
863 Views
3 Replies
Replies (3)

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @kristianhric 

 

this can be done with an iLogic rule, but did you know that you can do this from the BOM editor?

 

If you add the custom iproperty to the BOM you can then "fill" the value or copy/paste the value into each cell in the column, and the custom iproperty will be automatically created in the component files, and set the cell value.

 

I'll post an ilogic example in a bit to do this too, but sometimes using the built in abilities is the better approach.... and of course it's just nice to know its there.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Curtis_Waguespack
Consultant
Consultant

Here is a quick example, (welcome to the forum, btw)

 

Try
	oFinish = iProperties.Value("Custom", "Finish")
Catch
	'property not found
	Return' exit rule
End Try

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAssyDoc.ComponentDefinition

If oAsmCompDef.Type = ObjectTypeEnum.kWeldmentComponentDefinitionObject Then
	Return 'exit rule
End If

Dim oOcc As ComponentOccurrence
Dim oDoc As Document
For Each oOcc In oAsmCompDef.Occurrences.AllLeafOccurrences
    oDoc = oOcc.Definition.Document
	oPropSet = oDoc.PropertySets.Item("User Defined Properties")
    Try
		oProp = oPropSet.Add("", "Finish")
	Catch
		oProp = oPropSet.Item("Finish")
	End Try
	
	oProp.value = oFinish	
Next
0 Likes

kristianhric
Explorer
Explorer

oh wow i cant believe i missed that. thank you.