60002125 New Stretch command with polygon selection

Article 60002125
Type Wish
Product Engine
Version 6027
Date Added 1/15/2014 12:00:00 AM
Fixed (1/17/2014 12:00:00 AM)
Submitted by Levi Azevedo

Summary

I want to use a stretch command where the grip points are selected with the same window the entities are selected.

Solution

In the 6028 version a new CmdStretch() overload method was added. Using this method, the user can select entities and grip points to stretch with a single window or polygon selection.

How to use it

Parameters

object SelSet:
A vdSelection object containing all the entities to Stretched by the command. If null or "USER" is passed, the user is prompted to select entities on screen.
object PolygonPoints:
A gPoints object that defines a polygon. This polygon will be used to select which grip points will be stretched by the command. If null or "USER" is passed, the user is prompted to select entities AND grip points by the same window or polygon selection.
object FromPoint:
A gPoint object that in reference to the ToPoint parameter defines where the grip points will be moved to. If null or "USER" is passed, the user is prompted to pick a point.
object ToPoint:
A gPoint object that in reference to the FromPoint parameter defines where the grip points will be moved to. If null or "USER" is passed, the user is prompted to pick a point.


Use Example

...
ActiveDocument.CommandAction.CmdStretch(null, null, null, null); //The user will be instructed to perform certain actions in order to complete this command.
...
Using the above command, an Action will be initiated, prompting the user to select the entities to be stretched.



During this step of the command you can define which entities in the document you want to stretch. You can do that by clicking on the entities one by one, using window selection (or cross selection) or polygon selection. To use window selection just click on the empty space of the drawing area, a transparent window will show. Similarly to all the Select commands, if you move your cursor to the right the right the window will be blue, if you move to the left, it will be green. As it is known to most CAD applications, Green window is named "cross window selection" and selects all entites that partially or entirely, lie in the selection area.
In this example we will use the green selection window.



Click once more and the Selection action will be completed. The two polylines passing through the green window will be highlighted indicating that they got selected. Also you'll notice a few small cross symbols on the selected polylines.



The cross symbols indicate the grips points of the polylines that will be moved on the next step of our command.
You should also keep in mind that selection in Vdraw, by default, is additive for entities and for grips. This means that you can window select again and add entities or grips to your selection.
For example, if you drag a window on a different grip of the polyline...



The selected entities are the same, but the selected grips have changed, one more was added to the collection.
In addition to the above, you can also use the various Select options. The most notable of those is the Polygon Selection. Using this option you are able to define a polygon on the screen in order to select entities and grips. To use this feature type "wp" or "cp". The difference between the two is similar to the blue and green selection window respectively. This is a list of all the possible options
"ALL" so all objects of the active layout of the document will be selected.
"PREV" so the previously selected objects (in "VDRAW_PREVIOUS_SELSET") will be selected.
"LAST" so the last object of the document entities collection will be selected.
If it is "USER" then also the following accepted values can be parsed:
"fp": fence polygon. The user picks a polyline and all entities that cross this polyline are selected.
"wp": window polygon. The user picks a closed polygon and all entities completely inside this polygon are selected.
"cp": crossing polygon. The user picks a closed polygon and all entities that cross this polygon are selected.

If you type "cp" you'll be prompted to pick polygon points. As it is understandable, at least 3 points need to be picked. While doing so, a green polygon will be formed on screen.



When you have the desired entities and grip points selected, press Enter or the right button to proceed to the next step of the Stretch command.
Now you'll be prompted to select a point from where you'll start the grip point movement. Click once and you'll see the selected grip points dynamically move around as you move your cursor.



The new form of the stretched polylines is displayed with the dashed linetype. Click once more to define where the grip points will be moved.

Send comments on this topic.