DWF Viewer

Reply
New Member
ZeinabElewa
Posts: 1
Registered: ‎12-28-2009
Message 1 of 2 (427 Views)

[API ]How To Access Objects directly with their ID

427 Views, 1 Replies
12-28-2009 12:19 AM
I Want to know if there is away to select Objects in the viewer knowing only there ObjectID
i know there is a solution which is looping on the Objects collection then Looping on each object Properties to check if the property name is Object Id
Like this

****************************
var Objects=form1.ADViewer.ECompositeViewer.Section.Content.Objects(0);

var Collection=form1.ADViewer.ECompositeViewer.Section.Content.CreateUserCollection();
for(i=0;(i {
for(x=1;(x<=Objects.Count); x++)
{
var prop=Objects(x).Properties;
for(j=1;(j<=prop.Count);j++)
{
if(prop.Name=="ObjectID")
Collection.AddItem(Objects(x));
}
}
fm.ADViewer.ECompositeViewer.Section.Content.Objects(1)=Collection;
****************************

but that Solution is very Slow when the Draw has a lot of Objects
Is there another Way To access Objects Directly with it's ID

Also I don't want the object properties palette and the model palette to appear when i select an object

how it can be done using javascript ? and at which event ?

thanks in advance
Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 2 of 2 (427 Views)

Re: [API ]How To Access Objects directly with their ID

01-04-2010 04:53 PM in reply to: ZeinabElewa
Thank you for your questions.

For your first question, there is no other more effective way to access objects directly with its specified properties.

For your second question, you can suppress all palettes via this line:
axCExpressViewerControl1.AutoOpenPalettesDisabled = 1; //(int)AdCommon.SuppressPaletteLaunch.Suppress_All;

or just suppress the object properties palette and the model palette via these two lines:
axCExpressViewerControl1.AutoOpenPalettesDisabled = 8; //(int)AdCommon.SuppressPaletteLaunch.Suppress_Object_Properties;
axCExpressViewerControl1.AutoOpenPalettesDisabled = 256; //(int)AdCommon.SuppressPaletteLaunch.Suppress_Model;

Please let me know if I can be of any further assistance.

-Herbert


Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
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.