Obtaining coordinates for point in drawing

Obtaining coordinates for point in drawing

Anonymous
Not applicable
283 Views
4 Replies
Message 1 of 5

Obtaining coordinates for point in drawing

Anonymous
Not applicable
Is there a way to convert between screen coordinates to drawing coordinates?

Thanks
0 Likes
284 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Doing this is not trivial if you want to account for
things like paper space and model space viewports.

The DrawingEditor class in AcadX.arx has PixelToWorld()
and WorldToPixel() methods that will do it.

http://www.caddzone.com/acadx/acadx15.htm

"stanfwen" wrote in message
news:f0ed0e4.-1@WebX.maYIadrTaRb...
> Is there a way to convert between screen coordinates to drawing
coordinates?
> Thanks
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Tony,

Sounds like what I need but I am not sure how to call this function.

Function ScreenToWorld([Point], [VPortID])

Is point a POINTAPI type?
Does it return drawing coordinates in a variant?

Thanks
0 Likes
Message 4 of 5

Anonymous
Not applicable
Point is an Array(0 To 1) of Integer, which
are the screen coordinates.

VPortID is the id of the viewport which the
transformation goes through (obviuosly, you
must identify a viewport), which corresponds
to the CVPORT system variable. If you omit
the Point argument, the current cursor location
is used. If you omit the VPortID argument, the
current viewport is used.


"stanfwen" wrote in message
news:f0ed0e4.1@WebX.maYIadrTaRb...
> Tony,
> Sounds like what I need but I am not sure how to call this function.
>
> Function ScreenToWorld([Point], [VPortID])
>
> Is point a POINTAPI type?
> Does it return drawing coordinates in a variant?
>
> Thanks
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Tony,

That did the trick. Thanks for the fast response.
0 Likes