Thanks MechMachineMan, that got me started and I have put together some code that basically works. Still relearning the programming skills that have been long forgotten.
My code allows me to select an enity or node and rename it by resetting it to nothing which pulls in the original name. It then prompts if another node needs renaming. Ideally, I would prefer that instead of a single selection, that multiple nodes could be picked and added to an array/list, and then that array list is renamed.
I am struggling to see how to add picked items to an array though. I have also had no luck in returning the selected nodes part number, which i would prefer to use to rename the nodes. Just reseting the name gives mixed results on the test assemblies I am trying this on, returning the original node names form the copied assembly/parts
Heres my code as it stands
' set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
MessageBox.Show("Select Browser Nodes to be Renamed", "Select Nodes")
'setup some variables
Dim entity
Dim msgresponse = vbYes
While msgresponse = vbYes
entity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter,"Select Component:")
entity.Name = "" 'reset name to nothing, which pulls in the original name
msgresponse = MessageBox.Show("Would you like to add another node item to be renamed?", "Add another node?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
End While
Steve