CADViewer GetRealPoint

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Bath
Posts: 22
Joined: 17 Feb 2009, 19:08

CADViewer GetRealPoint

Post by Bath » 22 Mar 2016, 16:19

Hi,
I examine the example CADViewer, I work with a demo source of version CAD.Net 10.1.

I convert mouse coordinates to the real point using GetRealPoint function.
I have defined DRect and I want to know whether DPoint returned by GetRealPoint function is contained by defined rectangle using DRect.Contains (DPoint) in the event MouseDoubleClick of CADPictureBox. It works as expected, but ...

X coordinate is always correct regardless of the scale, but the Y coordinate is returned with a small deviation, appr.10 units below (correct is Y = Y-10). What is the cause?
Probably the curvature of space between me and the screen... ;)

I open the same dwg file using CADEditor example, check Y positions of entities and check viewing the real point in the status bar, and everything works properly.

Thanks for answers.

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Re: CADViewer GetRealPoint

Post by support » 23 Mar 2016, 20:32

Hello Bath,

The EditorDemo sample project may give better results because of the Snap option which is turned on by default. The snap increases the precision of calculating the coordinates of point that belongs to an entity. If the point you double click on doesn't belong to an entity and coordinates returned by the GetRealPoint function differ from ones shown in the status bar, make sure that the mouse cursor doesn't move along the Y axis when double-clicking CADPictureBox.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Bath
Posts: 22
Joined: 17 Feb 2009, 19:08

Re: CADViewer GetRealPoint

Post by Bath » 24 Mar 2016, 10:15

Hello Mikhail ,
thanks for answer.

Can I activate Snap option for viewer sample?

I tried to find some properties related to snap.
I have CadImage.EnableSnap=True and System.Windows.Forms.SystemInformation.IsSnapToDefaultEnabled=False .

Coordinates returned by the GetRealPoint function are same as ones shown in the status bar,
but when I double click a bit below (under) bottom of rectangle point is still contained by rectangle and a bit below (under) top of rectangle point is not contained.

Bath

Post Reply