Design Review

Active Member
Posts: 7
Registered: ‎06-03-2005
Message 1 of 3 (524 Views)

How to programmatically select objects

524 Views, 2 Replies
08-13-2012 02:59 AM



Can't figure out how to programmatically select a group of objects in a ECompositeViewer so they will be highlighted somehow? Or maybe i can somehow colorize them just how TRANSPARENT command works?

Active Member
Posts: 7
Registered: ‎09-19-2012
Message 2 of 3 (422 Views)

Re: How to programmatically select objects

09-20-2012 05:22 AM in reply to: sinm

I would like to know how to do this too. Any suggestions autodesk admins?


I think it would also be very useful to get all the code examples that are embedded within the windows .chm help file up on a web page somewhere. Copying code out of the windows help viewer is a right pain and loses all formatting.



Active Member
Posts: 7
Registered: ‎09-19-2012
Message 3 of 3 (417 Views)

Re: How to programmatically select objects

09-20-2012 06:21 AM in reply to: troup

I got this working in javascript with help from the following article:


You can also control the selection set programmatically. First call IAdContent::CreateUserCollection to return an empty IAdUserCollection. You can then add to it the IAdObject interfaces of those objects you want selected. Once complete, you can “set” the IAdContent::smileysurprised:bjects(ObjectType::smileyfrustrated:elected) property to your collection to effect the desired selection."


I translated this to the following Javascript:


var MyCollection = ECompViewer.Section.Content.CreateUserCollection();


ECompViewer.Section.Content.Objects(1) = UserCollection;


//Replace objectYouWantToSelect with a reference to your object
//The API uses Magic numbers 1 = selected

You are not logged in.

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

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