Inventor Customization

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

Add Currently Selected Parts to an ObjectCollection

142 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 (138 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube