How to zoom to a rectangular area in the Viewer mode

Discuss and ask questions about CADEditorX and XML API.

Moderators: SDS, support, admin

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

How to zoom to a rectangular area in the Viewer mode

Post by support » 07 Apr 2016, 18:40

Hello everyone,

In the Editor and Redline modes, it is possible to select a rectangular area to zoom to by holding the Alt key and the left mouse button and moving the mouse. This feature doesn't work in the Viewer mode, but you can use two following options instead (they work also in the Editor and Redline modes):

- RectZooming tool which allows to select the zooming area by left-clicking two points on a drawing.

There are three ways to activate the RectZooming tool:

1) Using a corresponding button on the ribbon: Viewer tab -> Position -> Rect Zooming.
2) Using a RectZooming command: type RectZooming in the Command line, then press Enter.
3) Through the XML API:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
  <command text="RectZooming"/>
</cadsofttools>
When the RectZooming is activated, you should do the following:

1) Left-click on the drawing to specify the first corner of the zooming rectangle.
2) Draw the rectangle by moving the mouse, then left-click again to specify the second corner of the rectangle.

- SetViewRect instruction allows to specify two points of the zooming rectangle programmatically. Let's say, the zooming rectangle is defined by two points in a 3D space: (73696.24, 26433.25, 0) and (89133.83, 14163, 0). In the XML code this rectangle should be defined as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
  <setviewrect Rect="73696.24,26433.25,0,89133.83,14163,0"/>
</cadsofttools>
Notice that a decimal point is used here to indicate the decimal place, while comma (,) delimits X, Y and Z coordinates of each point as well as first point and second point.


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

Post Reply