Entity creation as per mouse click coordinate

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
sanket
Posts: 4
Joined: 03 Dec 2018, 13:22

Entity creation as per mouse click coordinate

Post by sanket » 16 Sep 2020, 21:17

Hello,

I tried to use Tsg3DDrawingNavigator to take mouse inputs from the user and add a line between two points clicked by the user within the Tsg3DDrawingNavigator component. Following are the steps which occur when the user interacts with the app.

1) User clicks on the Tsg3DDrawingNavigator component and the mouse click co-ordinated are converted into drawing co-ordinates using GetDrawingCoords() and stored in Point attribute of TsgDXFLine object.

2) The Line Object is then added to the converter and then use the function LoadFromConverter

3) Now, after providing the first point, when the user moves his mouse I track it with the OnMouseMove event and then use the XY coordinates provided to the OnMouseMove event to get the corresponding drawing co-ordinates and assign it to the Point1 attribute of the TsgDXFLine object so as to give a realtime preview of the line as per current mouse position.

4) Now when the user does the second mouse click on the Tsg3DDrawingNavigator, it again converts the mouse click co-ordinates into drawing co-ordinates and adds the returned value to the FPoint1 attribute of the TsgDXFLine entity.

5) Loads the TsgDXFLine entity in the converter and then using LoadFromConverter it refreshes the Tsg3DDrawingNavigator.


After doing all the above steps I still don't see the TsgDXFLine entity inside the Tsg3DDrawingNavigator. Could it be that I need to provide some addition information to the Tsg3DDrawingNavigator to set it up correctly? I have attached my demo project as a part of this post. Could you please have a look and help me resolve the issue ?


Regards,
Sanket
Attachments
CreateLine.zip
(56.95 KiB) Downloaded 693 times

OlegVybornov
Posts: 1
Joined: 09 Dec 2020, 21:32

Re: Entity creation as per mouse click coordinate

Post by OlegVybornov » 09 Dec 2020, 22:06

does anybody made this example?

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

Re: Entity creation as per mouse click coordinate

Post by support » 09 Dec 2020, 23:15

Hello,

We are currently investigating the issue.

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

Post Reply