Article | 60001561 |
Type | Wish |
Product | Engine |
Version | 6026 |
Date Added | 11/28/2011 12:00:00 AM |
Fixed | (7/15/2013 12:00:00 AM) |
Submitted by | Viktor Weber |
Summary
Is it possible to add chamfer command in polyline
Solution
In version 6027 we added Chamfer command at CommandAction. The method is cmdChamfer and is described below
summary> Chamfers the edges of two lines or a polyline using the passed parameters.
param name="selset">A vdSelection containing two vdLines OR one polyline , OR null,"USER" so the user selects the entities to be chamfered.
param name="Distance1">A double value that represents the first distance used when method is Distance, as a default value OR null,"USER" so the Document's static value is used.
param name="Distance2">A double value that represents the second distance used when method is Distance, as a default value OR null,"USER" so the Document's static value is used.
param name="DistanceForAngle">A double value that represents the first distance used when method is Angle, as a default value OR null,"USER" so the Document's static value is used.
param name="Angle">A double value that represents the angle in degrees used when method is Angle, as a default value OR null,"USER" so the Document's static value is used.
param name="Method">An integer value that represents the method used as default (0 for Distance , 1 for Angle) or null,"USER" so the Document's static value is used.
param name="Trim">A boolean value that represents if trim mode is on or off or null,"USER" so the Document's static value is used.
param name="runonce">A boolean value that represents if the command will end after one chamfer. If this value is true then multiple chamfer actions can be made by the user.
returns>True if the command was succesfull.
public bool CmdChamfer(object selset, object Distance1, object Distance2, object DistanceForAngle, object Angle, object Method, object Trim, bool runonce)
You can call this method like below :
vdSelection selset = new vdSelection("test");
selset.AddItem(vdFramedControl.BaseControl.ActiveDocument.ActiveLayOut.Entities[0], false, vdSelection.AddItemCheck.Nochecking);
selset.AddItem(vdFramedControl.BaseControl.ActiveDocument.ActiveLayOut.Entities[1], false, vdSelection.AddItemCheck.Nochecking);
vdFramedControl.BaseControl.ActiveDocument.CommandAction.cmdChamfer(selset, 1.0, 2.0, 0.0, 0.0, 0, true , true);
Or like this so the user selects what he wants to do and the values start up with the Document's default values.
vdFramedControl.BaseControl.ActiveDocument.CommandAction.CmdChamfer (null, null, null, null, null, null, null, false);
The command uses the following values
Distance1 , Distance2 , DistanceforAngle , Angle , Method , trim. These values are saved to a static class at the Document named Document.ChamferSettings. While the user calls the command the initial values take their value from this class and while the user makes his selection this is saved. This class is not serializable. The developer caqn initialize these values as he wants.
The command has 2 ways of action (Method)
Distance Method:
![]() |
![]() |
Angle Method:
![]() |
![]() |
When the command starts the user has the following options:
Select First Figure or (P)olyline,(D)istance,(A)ngle,(M)ethod,(T)rim:
The user can click either two lines or a polyline.
(P)olyline : Press P and then select a polyline , All edges of the polyline will be chamfered using the currend method and distances/angle.
(D)istance: Press D and the user is prompted to select 2 distances that equal to the distances used while method is Distance.
(A)istance: Press A and the user is prompted to select a distance and an angle that equal to the distance/angle used while method is Angle.
(M)ethod : Press M to select the current method , the user is prompted to select Distance/Angle methods.
(T)rim : Press T and the user is prompted to select (Yes or No) if the lines will be trimmed during the chamfer command.
While these options are active the user can either click two lines or a polyline. If a polyline is clocked the closest edge will be chamfered. If you want to chamfer all the edges of the polyline then the P must be selected and then click on a polyline.