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

Object Properties categories

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
492 Views, 7 Replies

Object Properties categories

Is there a way to get the Object Properties categories (for example "DoorObjects" or "WallObjects") from the OnUpdateUiItem() event?

thanks in advance, Chuck
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

If I can't get it from that event, can I get it from the OnSelectObject() event call? If so, how do I do this (what is the signature of this event call?)?

thanks, Chuck
Message 3 of 8
Anonymous
in reply to: Anonymous

I got it:
...
if (type == "OBJECTPROPERTIES") {
objProps = data;
if ( objProps ) {
nObjs = objProps.Count;
for (i=1; i <= nObjs; i++ ) {
prop = objProps.Item(i);
window.alert(prop.Category); // RIGHT HERE!!!
}
}
}
...
Message 4 of 8
Anonymous
in reply to: Anonymous

Here is a modified version of highlight_getprops_send.html that also lists categories in the "Object Properties" window. It's kind of sloppy since it assumes that all the properties are already grouped together under the same category--it's an easy fix to group them first and then output them all at once...
Message 5 of 8
Anonymous
in reply to: Anonymous

With DWF Viewer 7, OnUpdateUiItem() no longer seems to fire with the first argument set to OBJECTPROPERTIES when a user selects an object--it does in DWF Viewer/Composer 6.

Without this event, how can we get the object properties of the selected object?

thanks in advance, Chuck
Message 6 of 8
Anonymous
in reply to: Anonymous

In the API docs, for the OnUpdateUiItem(type, state, data) event, it looks like "OBJECTPROPERTIES" is no longer a supported type (even though the JavaScript example has it as one of the switches). When you select an object, this event fires with type = "COMMAND" and data = "OBJECTPROPERTIES" (even though the COMMAND/OBJECTPROPERTIES is not documented). Still, it's not clear to me how to get to the object properties.

IMHO, the logical place for the object properties to show up would be when the OnSelectObject(objectNode, handled) event fires, but objectNode has no useful information--what type of an object is it in relation to the API docs? It doesn't have Properties hanging off of it.

thanks in advance, Chuck
Message 7 of 8
Anonymous
in reply to: Anonymous

There is no way to tie any selection event to the object's properties. This
has been noted as a short coming of the API's for the current viewer and on
the wishlist for future viewers.

You can get access to the object properties via the collections though. To
see how this is done for 2D (it works the same in 3D) take a look at:
http://dwf.blogs.com/beyond_the_paper/2006/02/dwf_programming.html

Find the sample 2DObjectSamples.zip and ObjectNameValueSearch.zip





wrote in message news:5261865@discussion.autodesk.com...
In the API docs, for the OnUpdateUiItem(type, state, data) event, it looks
like "OBJECTPROPERTIES" is no longer a supported type (even though the
JavaScript example has it as one of the switches). When you select an
object, this event fires with type = "COMMAND" and data = "OBJECTPROPERTIES"
(even though the COMMAND/OBJECTPROPERTIES is not documented). Still, it's
not clear to me how to get to the object properties.

IMHO, the logical place for the object properties to show up would be when
the OnSelectObject(objectNode, handled) event fires, but objectNode has no
useful information--what type of an object is it in relation to the API
docs? It doesn't have Properties hanging off of it.

thanks in advance, Chuck
Message 8 of 8
Anonymous
in reply to: Anonymous

Thanks for your quick reply, John.

However, I want to get the object properties for a user-selected object, not in the way that the examples to which you point do.

Even though the selection event doesn't provide this data, as I state above, with DWF 6, you could get the object properties for an object by listening to the OnUpdateUiItem(type, state, data) event. It fires with type="OBJECTPROPERTIES" (and data being the object properties collection) when the user selects an object, whereas DWF 7 doesn't fire this event any more. Why the change?

Is there no way to retrieve object properties related to an event related to selection in DWF 7? If not, my app is useless since DWF 7 breaks this functionality...

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

Post to forums  

Autodesk Design & Make Report