CADViewer GetRealPoint
Moderators: SDS, support, admin
CADViewer GetRealPoint
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.
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.
Re: CADViewer GetRealPoint
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
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
Chat support on Skype: cadsofttools.support
Re: CADViewer GetRealPoint
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
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