Access iProperties/ parameters of iPart Members

Access iProperties/ parameters of iPart Members

Frank-Oosterwaal
Collaborator Collaborator
267 Views
2 Replies
Message 1 of 3

Access iProperties/ parameters of iPart Members

Frank-Oosterwaal
Collaborator
Collaborator

Hi all,

I tried to find the answer but can't seem to find how to access and change iPropeties & parameters of a iPart member (factory member no problem). We sometimes need to change material standards or whatever and these are stored in iProperties and parameters. When this happens I update all library parts and assys using iLogic. This is all fine, it just fails on iPart and iAssembly members.

This is part of the code I'm working on now:

Dim oPartDoc As Inventor.PartDocument = ThisDoc.Document

'Other code to retrieve values

Dim isIPartMember As Boolean = oPartDoc.ComponentDefinition.IsiPartMember
If isIPartMember Then
	MessageBox.Show("iPart", "Title")
'Cannot figure out how to access and change the members iProperties/parameters

Else
	MessageBox.Show("Normal part", "Title")


'-----Set material properties to custom iProperties-----
	'oPartDoc.PropertySets.Item("Inventor User Defined Properties").Item("Material_Name").Value = oMat_Name
	'oPartDoc.PropertySets.Item("Inventor User Defined Properties").Item("Material_std").Value = oMat_Std


	'-----Fill user properties to iProperties-----
	oPartDoc.PropertySets.Item("Inventor User Defined Properties").Item("Certification").Value = Parameter("Certification")
	oPartDoc.PropertySets.Item("Inventor Document Summary Information").Item("Category").Value = Parameter("Supply")
End If


It sees it's an iPart member but using the same method as for normal parts it runs into errors. I understand I can change the iPart factory and regenerate the members but I would like to avoid that.

Hope somebody can point me in the right direction. Thanks in advance!

Greets,

Frank

 

---------------------------------------------------------------------------------------------------------
0 Likes
268 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor

Hi @Frank-Oosterwaal 

You will need to open and change the ipart factory and not the member. The information is then pushed to the members on generate. Here is a helpful article.

 

And as long as you have writable access to the ipartfactory you can get to it from the ipart member. See help file here

Syntax

iPartMember.ParentFactory() As iPartFactory

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 3

Frank-Oosterwaal
Collaborator
Collaborator

Hi @A.Acheson ,

 

Thanks for the reply. Ah yes, makes sense. I'll approach it that way. So just skip the iPart members for data population and just perform a update. Can use the iPartMember.ParentFactory() As iPartFactory to make sure the factory is populated with the data first before performing the update on the iPart members.

 

Thanks again!

 

Greets,

Frank

---------------------------------------------------------------------------------------------------------
0 Likes