PDA

View Full Version : How to get the AssociatedModel from 2D-Document ...


wilfried_loewe
10-08-2007, 11:42 AM
Hi to all,

I want to use a PostApplyListener postApply(WMApplyEvent event) in Class DMDrawing2D to get the associated Model Elid of the current 2D-Document. It is no Problem to get the boolean flag by:

DMDrawing2D doc = (DMDrawing2D) (event.getSource());
if (doc.hasAssociatedModel()) {
????????
}

Is there a way to get the Elid of Model, if hasAssociatedModel() is true ????

mgb
10-11-2007, 01:37 PM
doc.hasAssociatedModel() uses getLink2D3DQuery(). If you access the results of this query I would expect the Model ELID to be one of the values.

wilfried_loewe
10-12-2007, 04:08 AM
Hi mgb,

thank you for your tip. I also found getLink2D3DQuery(), but I was irritated about protected mode:

protected Link2D3DQuery createLink2D3DQuery();

Now I use:

DMDrawing2D doc = (DMDrawing2D) (event.getSource());
if (doc.hasAssociatedModel()) {
WMLtab linkLtab = (new Link2D3DQuery((Drawing) doc)).execute();
.
.
.
}

... it works perfect -- thank you ...