70002360 I want to have Linear and stacked Dimension commands

Article 70002360
Type Wish
Product Engine
Date Added 5/24/2023 12:00:00 AM
Fixed 10.1004.0.3 (6/6/2023 12:00:00 AM)
Submitted by Wayne Romer

Summary

Linear Dimensions are continous dimensions that each click of the user will start a new dimension from the endpoint (defpoint) of the previous dimension. Stacked linear dimension are also continous dimensions but each click will create a second dimension above and starting from the initial start point of the first dimension. These types of dimensions should apply to the Horizontal , Vertical and rotated dimension types.

Solution

In version 1004 we added a new command in the Document.CommandAction like below

summary>This command can be used to create multiple Dimensions
param name="isStacked">A boolean value representing if the produced dimensions will be stacked or linear OR "USER" , null so the user is asked to pick.
param name="DefPoints">A gPoints collection of two points that represent the first two points of the first dimension OR "USER" , null so the user is asked to pick.
param name="Position">A gPoint representing the location of the first dimension OR "USER" , null so the user is asked to pick.
param name="DimensionPoints">A gPoints collection representing the rest points of the dimensions OR "USER" , null so the user is asked to pick.
param name="RotationAngle">A double value representing the rotation of the dimensions (0.0 or HALF_PI) if the points are passed as parameters OR a string "V","A","H" to determine Vertical , Aligned , Horizontal if the user is asked for the points. returns>True if the command was succesfull.
public bool CmdDimContinuous(object isStacked, object DefPoints, object Position, object DimensionPoints, object RotationAngle)

All parameters can either be passed or asked by the user. If all parameters are asked from the user then the command acts like this
1) The user is asked a question either the command will draw Stacked OR Linear dimensions (explained below)
2) Then the user is asked for the first two points of the first dimension. In this state of the command the user has also the ability to choose from the following options : [(A)ligned , (V)ertical , (H)orizontal , (A)uto(R)otated]
3) Then the user is asked for a point for the position of the dimension. This point is very crucial since all forthcoming dimensions will use this point as reference.
4) Last the user will be asked for the rest of the dimension points , every point will create a new dimension.

In c# the command can be called like below
doc.CommandAction.CmdDimContinuous(null, null,null , null,0.0); //In this case the user will be asked for everything.

If you want to bypass the first question the command can be called like below for Stacked
doc.CommandAction.CmdDimContinuous(true , null,null , null,0.0);
or for Linear
doc.CommandAction.CmdDimContinuous(false, null,null , null,0.0);

or you can pass the points for the dimension directly if you already know them like below for some vertical linear dimensions.
gPoints firstPoints = new gPoints();
firstPoints.Add(0, 0, 0);
firstPoints.Add(0, 5, 0);
gPoint position = new gPoint(-2.5, -2.5, 0.0);
gPoints restPoints = new gPoints();
restPoints.Add(new gPoint(0, 10, 0));
restPoints.Add(new gPoint(0, 20, 0));
restPoints.Add(new gPoint(0, 30, 0));
doc.CommandAction.CmdDimContinuous(false , firstPoints, position, restPoints , Globals.HALF_PI);

The command can be tested in SimpleCAD or in vdfCAD (applications provided with our setup) under
Draw->Dimensions->Continuous Dimension Stacked
Draw->Dimensions->Continuous Dimension Linear


Linear

Stacked


Send comments on this topic.