Inventor Customization

Inventor Customization

Reply
Valued Contributor
andrewwhiteinc
Posts: 59
Registered: ‎02-02-2011
Message 1 of 2 (147 Views)
Accepted Solution

Add Currently Selected Parts to an ObjectCollection

147 Views, 1 Replies
01-21-2013 06:09 PM

Hey Guys, I thought this might have been straight forward but I'm having a bit of trouble. I want the user to have a set of occurrences selected and click a button to run code on them but I can't seem to find a method of getting the names or anything else on the actively selected parts. Any direction on this would be appreciated plz.

 

Cheers!

P. Andrew White,EIT
Engineer-in-Training, Industrial Automation
Valued Contributor
andrewwhiteinc
Posts: 59
Registered: ‎02-02-2011
Message 2 of 2 (143 Views)

Re: Add Currently Selected Parts to an ObjectCollection

01-21-2013 06:32 PM in reply to: andrewwhiteinc

As it was straight forward. For future reference of anyone searching here it is:

 

        Dim oDoc As AssemblyDocument
        Dim oCol As New Collection
        oDoc = oINV.ActiveDocument
        For i = 1 To oDoc.SelectSet.Count
            oCol.Add(oDoc.SelectSet.Item(i))
        Next
        For Each part In oCol
            oINV.Documents.Open(part.ReferencedDocumentDescriptor.ReferencedFileDescriptor.FullFileName, True)
        Next 

P. Andrew White,EIT
Engineer-in-Training, Industrial Automation
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.