How to get snap state?

Discuss and ask questions about CADEditorX and XML API.

Moderators: SDS, support, admin

Post Reply
uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

How to get snap state?

Post by uni016 » 03 Dec 2015, 11:05

Hi.
I want make menu for my app. Because editorX menu is so many functions and I don't want ribbon style.
Anyway, When I add buttons for snaps, I can't display snap's state.(snap on/off, endpoint on/off, midpoint on/off, etc..)

1. How to get the each snap state? It's important to me.
2. The snap normal is not work on circle.
3. The snap intersection is not work on complex Polyline(between arc segment and line).

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

Re: How to get snap state?

Post by support » 03 Dec 2015, 18:34

Hello,

The snap states can be retrieved using the GetCommandStatus command, for example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
  <command text="GetCommandStatus"/>
  <command text="Intersection"/>
</cadsofttools> 
This code should return a state (On/Off) of the specified command in the output XML.

We've tested the Snap Normal to a circle, it doesn't work in version 11. This issue will be solved in the next builds. The Snap Intersection allows to snap to the intersection of line and arc segments within a polyline as shown below.

Image


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

uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

Re: How to get snap state?

Post by uni016 » 04 Dec 2015, 04:13

Hi.
Thank you. The first issue was solve.
And I sent the intersection snap problem screenshot to 'support@cadsofttools.com' (subject is 'Intersection snap screenshot')

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

Re: How to get snap state?

Post by support » 04 Dec 2015, 17:04

Hello,

Thank you for the screenshots. We've tested the Snap issue throughly and arrived at the conclusion that the Intersection snap doesn't work if the amount of arc segments is greater than 2 (notice that the polyline on my scrrenshot has only one arc segment). This issue is caused by the optimization of the Snap function which is intended to increase rendering speed when working with complex drawings on low performance PCs.

The solution for this issue is to decrease the amount of lines the arc segments are splitted to. This setting can be changed in CADEditorX options (File -> Options...) as shown on the screenshot below.

Image

We recommend to set the splitting quality for circles/arcs to 24. If the Intersection snap wouldn't work with more complex polylines, you should decrease the quality from 24 to 10 or 5, for example.


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

Post Reply