DWF Viewer (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[API ]How To Access Objects directly with their ID

1 REPLY 1
Reply
Message 1 of 2
ZeinabElewa
1215 Views, 1 Reply

[API ]How To Access Objects directly with their ID

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
1 REPLY 1
Message 2 of 2
herbert.he
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report