About access DVline2D through the mouse click?

Valued Contributor
Valued Contributor

Hi all!Hi jason!    I want to  access a DVline2D through the mouse click in a dft, but the value of DVline2D is null.    My programSmiley Tonguerivate void objMouse_MouseClick(short sButton, short sShift, double dX, double dY, double dZ, object pWindowDispatch, int lKeyPointType, object pGraphicDispatch) SolidEdgeDraft.DVLine2d dvline2d= null;            dvline2d = pGraphicDispatch as SolidEdgeDraft.DVLine2d;// dvline2d is null.

Butby enteringadrawingviewofa dft, the mouse clickcan getthedvline2d.How do Ipick upadvline2dobject through the mouseclick?Please help!Thanks! 

 

Posted by: fat kids
Post date: 4/16/2011 6:55:04 AM

2 REPLIES

RE: About access DVline2D through the mouse click?

Valued Contributor
Valued Contributor

Hi,

You can't declare pGraphicsObject as a DVLine2d, just declare it as an object.

When you click an entity that is inside a drawingview you get a Reference object. If i recall correctly, Reference.Object will return your DVline2d object.

Reference object is used to "convert" drawing view coordinates and orientation to external coordinates.

Hope this helps,

Julian

 

Posted by: Julian Guillo
Post date: 4/17/2011 9:48:01 PM

RE: About access DVline2D through the mouse click?

Valued Contributor
Valued Contributor

Thanks, Julian!

 

Posted by: fat kids
Post date: 4/22/2011 4:38:01 AM