Retrieve Content Center path data when Capture Current State doesn't work?

Retrieve Content Center path data when Capture Current State doesn't work?

KenPalAlt
Contributor Contributor
110 Views
1 Reply
Message 1 of 2

Retrieve Content Center path data when Capture Current State doesn't work?

KenPalAlt
Contributor
Contributor

I need to store the ccPath, familyName and designation strings of many Content Center objects, in order to insert them by code using Components.AddContentCenterPart().

 

Normally, I would just place them into an Assembly, create a rule and click "Capture Current State (Components.Add)" and it would retrieve the data.

 

However, my company recently upgraded to Inventor 2023 (we're always lagging behind a few releases), and since then nothing happens when I click "Capture Current State" on Content Center files (other files work fine).

I found a bug report for it, but it offers no solution.

 

Is there any other way I can retrieve this other than manually, which is very time consuming?

 

I don't have permissions to use the Content Center Editor, but if that's a workaround, I could probably get the permissions.

0 Likes
111 Views
1 Reply
Reply (1)
Message 2 of 2

C_Haines_ENG
Collaborator
Collaborator

You can access the Content Center properties of a file by going through the documents "PropertySets". See example code below. It will create a messagebox that shows all of the names of the Properties you can access and their value, simply click on a content center part in an assembly and see.

 

Sub Main
															
	Dim oSelect As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select Content Center Part")
	
	Dim oPropertySet As PropertySet = oSelect.Definition.Document.PropertySets("B9600981-DEE8-4547-8D7C-E525B3A1727A")
	
	'IF YOU WANTED TO GET THE SPECIFIC VALUE, ENTER THE FIELD NAME HERE
	'oPropertySet("PROPERTY NAME YOU WANT TO GET")
	
	Dim oMessage As String
	
	For i = 1 To oPropertySet.Count
		oMessage = oMessage & oPropertySet(i).Name & vbLf & vbTab & oPropertySet(i).Value & vbLf & vbLf
	Next
	
	MsgBox(oMessage)

End Sub
0 Likes