- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all!
I'm updating some code I wrote to a better one, but this update need some info of a part in a sub assembly.
Google "Inventor vba get iproperties" and there is enough code that debugs an iproperty of all parts.
The thing I need is just for 1 part... this should be easy to do but I just cant figure it out...
This is what I want to get done:
Pick a sub assembly from the main assembly.
inside this sub assembly there is a part.
this part has a fullfilename or partnumber
msgbox fullfilename (without the need of opening and closing the part to string the data)
Sub test()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
' Prompt user to pick an occurrence
Dim oOcc As ComponentOccurrence
Set oOcc = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "Select bolted connection")
Dim oSub As ComponentOccurrence
Set oSub = oOcc.SubOccurrences.Item(1)
oDoc.SelectSet.Select oSub
Dim opDoc As PartDocument
Set opDoc = oSub.something
MsgBox opDoc.FullFileName
End Sub
The selection is still a componentoccurrence and if I'm correct the document propertyset is needed... so is there a way to assign the occurrence as a partdocument or is it not the right way to do?
Kind regards,
Peter
Solved! Go to Solution.