DesignCAD Version 14 Macro Developer's Reference

DesignCAD Version 17 Macro Developer's Reference

Usage Note

What's New

Chapter 1: Macro Language - Statements

Chapter 2: Macro Language - Functions

Chapter 3: Macro Language - DesignCAD Commands and Parameters

Usage Note

A note on usage in this section:

StatementRefers to a DesignCAD macro language statement. See Macro Language Statements for a description of the statements you can use in your macros.

FunctionRefers to a DesignCAD macro language function, such as SIN(x) or SYS(32). See Macro Language Functions for a description of the available functions.

Macro CommandRefers to a DesignCAD drawing command, such as Line or Hatch. The DesignCAD macro language commands are listed in Macro Language - DesignCAD Commands and Parameters

Macro ParameterRefers to an argument necessary for a DesignCAD drawing command. Parameters may be numerical values or strings, and variables can be substituted for constants. The DesignCAD macro parameters are listed for each macro command in Macro Language - DesignCAD Commands and Parameters


MainToolBox

>MainToolbox

{

}

Toggles the visibility of the Main Toolbox

Compatibility: All versions


RoundBox

>RoundBox

{

<NFace n

<Radius r

<Points: 1=starting corner, 2=opposite corner

}

Draws a 3D box with all corners filleted.

Compatibility: Version 13 and later

Example:

>Roundbox

{

<NFace 12

<Radius 1

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}


HatchPosition

>HatchPosition

{

<SelectOnly s [0=no (all hatch patterns will be repositioned, 1=yes (only the currently selected hatch pattern will be repositioned)]

<Points – Point 1 = original location in the hatch pattern
Point 2 = new position

}

This command allows you to realign a hatch pattern's base position in the drawing.

Compatibility: Version 15 and higher


HpglIn

>HpglIn

{

<Filename "Filename.ext"

}

This command imports an HPGL plot file.

Note: For files in or beneath the DesignCAD directory, you may use an asterisk at the beginning of the filename. For example if DesignCAD is installed in C:\MyProgs\DCAD14, and your hpgl file Myfile.hpg is in the same directory, you could use: <filename "*\Myfile.hpg"
for the filename, instead of:
<filename "C:\MyProgs\DCAD14\Myfile.hpg"

Compatibility: All versions


SectionCopy

>SectionCopy

{

<Points: 1 = first corner of region, 2 = opposite corner

}

Copies the specified region to the clipboard.

Compatibility: All versions


ViewToolBox

>ViewToolBox

{

}

TogglesViewing toolbox on or off.

Compatibility: All versions


ContourLine

>ContourLine

{

<Axis a:
[0 = Custom Plane, 1 = ZY(fixed X), 2=XZ (fixed Y),

3 = XY (fixed Z)]

<Type t:
[0 = save as vector, 1 = save as plane]
<SelectOnly s:
[0 = entire drawing, 1 = selection only]

<Points: 1, 2, 3, ...

}

Draws a contour line. If Axis = 0 (Custom Plane), points 1-3 define the plane for the contour line. If Axis = 0, 1, or 2, more points may be set to draw extra contour lines.

Compatibility: Version 13 and higher

Example:

>Cylinder

{

<Color 128, 128, 128
<NFace 20

<Orientation 0

<Pointxyz 0, 0, 0

<Pointrel 0, 5, 0

<Pointrel 15, 0, 0

}

>ContourLine

{

<Layer 3
<Color 128, 255, 255
<SelectOnly 0 ' contour entire drawing
<Axis 1 ' constant x (zy plane)
<Type 0 ' save as vector

<Pointxyz 1, 0, 0

<Pointxyz 2, 0, 0

<Pointxyz 3, 0, 0

}


2DBox

>2DBox

{

<Orientation o

[0 = normal, 1 = align to any angle]

<Type t

[0 = plane, 1 = vector]

<Points (orientation 0)

[1 = corner, 2 = opposite corner]

<Points (orientation 1)

[1 = corner, 2 = width and angle of base, 3 = height]

}

Compatibility: All versions

Example:

>2DBox

{

<color 0,0,255

<layer 7

<orientation 0

<type 1

<pointxyz 0,20,0

<pointxyz 40, 50, 0

}


AboutDesignCAD

>AboutDesignCAD

{

}

Displays the About DesignCAD dialog box

Compatibility: All versions


SelectAll

>SelectAll

{

}

Selects all editable objects in the drawing.

Note: The behavior of SelectAll changed in DesignCAD version 12. SelectAll no longer selects all entities in the drawing. Instead, it only selects all entities which are both visible and editable.

To emulate the old behavior (which selected even hidden and non-editable layers), use SelectEverything.

Compatibility: All versions; note behavior change for Versions 13 and higher.


GOSUB and RETURN Statements

PURPOSE:To call a subroutine.

SYNTAX:GOSUB label

RETURN

EXPLANATION:The GOSUB statement is used to transfer macro execution to another statement out of the normal sequence of execution - it calls a subroutine. The macro resumes execution on the line following the GOSUB statement when a RETURN statement is encountered. "Label" can be any valid DesignCAD macro label. A RETURN statement must be used to return from a subroutine called by a GOSUB statement. Also, don't forget to put an END statement at the end of your main routine and before your first subroutine.

See Also: GOTO

COMPATIBILITY:All versions

EXAMPLE:

x = 20

y = 20

theta = 30

GetXY gx1, gy1, gz1 ' get cursor location

Gosub rotate

>Line

{

<Pointxyz [gx1, gy1, gz1]

<Pointxyz [x1, y1, gz1]

}

.

.

.

' Important! Main loop must END before any

' subroutines begin

End

rotate:

x1 = gx1 + x * sin(theta) + y * cos(theta)

y1 = gy1 - x * cos(theta) + y * sin(theta)

Return


EraseLast

>EraseLast

{

}

This command erases the last item that was drawn.

Compatibility: All versions


ClearDrawingHandle

>ClearDrawingHandle

{

}

Removes the handles from a drawing.


Ent_MaxBound Parameter

ENT_MAXBOUND ParameterQuery and Change Parameters

ENT_MAXBOUND

Declaration: Alias ENT_MAXBOUND &H0110

Arguments: Three numbers (floating-point) representing the maximum XYX coordinate of the entity's bounding box

Accessibility: Query only

Purpose: This parameter allows you to find out the maximum X, Y, and Z values of the entity's bounding box.

Query Usage:

Query Ent_MaxBound, maxX, maxY, maxZ

where maxX, maxY, and maxZ are numeric variables.

Compatibility: Version 14 and higher


TangentTo

>TangentTo

{

<Points: 1 = beginning of line, 2 = circle

}

Draws a line from a specific starting location to a point tangent to a circle.

Compatibility: All versions

Example:

>Circle

{

<Pointxyz 15, 5, 0

<Pointxyz 15, 8, 0

}

>TangentTo

{

<Pointxyz 0, 0, 0

<Pointxyz 15, 2, 0

}


Chamfer

>Chamfer{

<Depth d, d2 [optional]

Chamfer depths. If only one value is specified, and no angle is specified, the chamfer depth is the same across both faces.

<Angle a [optional]

Chamfer angle, referenced to the first line clicked.

<Type t

[0 = normal chamfer, 1 = keep original lines]

<Points: 1 = first line, 2 = 2nd line to be chamfered

}

Chamfer two line segments, specifying either one chamfer depth, two depths, or one depth and an angle.

Compatibility: All versions

Example:

>Line

{

<Color 0, 0, 0

<Layer 1

<LineStyle 0, 2.0, 0.0

<PointXYZ 15.750, 11.5, 0.0

<PointXYZ 22.0, 28.0, 0.0

}

>Line

{

<Color 0,0,0

<Layer 1

<LineStyle 0, 2.0, 0.0

<PointXYZ 23.0,29.125,0.0

<PointXYZ 45.25,17.75,0.0

}

>Chamfer

{

<PointXYZ 20.25,22.75,0.0

<PointXYZ 28.75,25.25,0.0

<Depth 3.0, 3.0
' <Depth 3.0 'alternate entry with same result

<Type 0

}

>Undo

{

}

>Chamfer

{

<PointXYZ 20.0,23.25,0.0

<PointXYZ 32.25,23.75,0.0

<Depth 3.0

<Angle 60.0

<Type 0

}


SelectScale

>SelectScale

{

<Scale xscale, yscale, zscale

}

Changes the scale of the selected objects.

Compatibility: All versions

Example:

>Sphere

{

<Pointxyz 10, 10, 0

<Pointxyz 10, 0, 0

}

>PointSelect

{

<Pointxyz 10, 0, 0

}

>SelectScale

{

<Scale 2.0, 1.25, 3.0

}


SelectEverything

>SelectEverything

{

}

SelectEverything selects all entities in the drawing, even those on non-editable layers, and makes those layers editable. Only password-protected layers are skipped. In Version 12 and older versions of DesignCAD, this was the behavior of the SelectAll command.

Compatibility: Version 13 and higher


SurfaceIntersection

>SurfaceIntersection

{

<Points: 1, 2 = intersecting surfaces

}

Draws a line along the intersection of two surfaces.

Compatibility: All versions

Example:

>Circle

{

<Type 2

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 0 10

}

>Ellipse

{

<Type 2

<Pointxyz 1, 1, 1

<Pointxyz 1, 0, 10

<Pointxyz 1, 10, 10

}

>SurfaceIntersection

{

<Pointxyz 10, 0, 0

<Pointxyz 1, 10, 10

}


SetDimensionOptions

>SetDimensionOptions

{

<OptDimType i

[0=Linear, 1=Angle, 2=Arc, 3=Chamfer, 4=Diameter, 5=Radius, 6=Coordinate, 7=Baseline, 8=Extended, 9=Progressive, 10=Radius Progressive, 11=Distance Only, 12=Pullout, 13=Balloon]

Type of dimension being configured.

<OptFixedLength f [0=no, 1=yes]

Extension lines have fixed length?

<OptDimLength l

Length of fixed dimension lines

<OptVarLength v [0=no, 1=yes]

Extension lines have variable length?

<OptDimGap g

Gap between point measured and bottom of leader line

<OptDashAfterFeet a [0=no, 1=yes]

sets option for dash after feet

<OptDashBeforeFraction b [0=no, 1=yes]

sets option for dash before fraction

<OptDimTextFormat x

[0=decimal, 1=fractional, 2=feet+decimal inches, 3=feet+fractional inches]

<OptDimTextPrec p [-7 to 15]

precision of displayed measurement

<OptDimTextLoc e [varies by type]

location of the text relative to the arrows.

<OptDimTextOrientation o [varies by type]

text orientation

<OptDimTextSize s

size of dimension text

<OptSameAsText sameAs [0=no, 1=yes]

dimension text same size as regular text?

<OptDimTextPos plane

[0=aligned, 1=xy, 2=zy, 3=zx]

controls the plane of the displayed text

<OptDimLinePos lp

[0=arrows inside, 1=arrows outside

OptDimLineOffset off

space between consecutive baseline dimensions

<OptDimArrowType at

arrowhead type (see Arrow for values)

<OptDimArrowSize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<OptDimSaveDefault default [0=no, 1=yes]

save settings as program defaults?

<OptDimResetDefault} restore [0=no, 1=yes]

restore original settings?

Changes the default dimension settings.

Compatibility: All versions


LayerOptions

>LayerOptions

{

}

This command opens the Layer Options dialog box.

Compatibility: All versions


SETPOINT Statement

PURPOSE:To prompt the user to set a number of points.

SYNTAX:SETPOINT string, expression

EXPLANATION:This statement displays the message in "string," and allows the user to set a number of points. "Expression" is the maximum number of points to be set. The user can press ENTER or ESC before all the points are set. The system function Sys(1) is the current number of points set – it can be checked to determine if enough points were set.

Note: This statement was previously documented without commas separating the variables. It often works either way, but the commas are recommended for consistency with other statements, and in some cases may be required.

See Also: POINTVAL SetPoints Command

COMPATIBILITY:All versions

EXAMPLE:

retry:

Setpoint "Set 2 to 4 points.", 4

If Sys(1) < 2 Then Goto retry


UPDATE Statement

PURPOSE:To update the bounding box of an entity that has been changed using the CHANGE statement.

SYNTAX:UPDATE

EXPLANATION:This statement forces DesignCAD to recalculate the bounding box of an entity that has been modified using the CHANGE statement.

See Also: CHANGE

COMPATIBILITY:Version 14 and later

EXAMPLE:

Entity 1

Change ENT_POINT, 1, 0, 0, 0

Update

RegenerateAll

{

}


MultiLineStyleEditor

>MultiLineStyleEditor

{

}

Toggles MultilineStyleEditor off and on.

Compatibility: Version 16(?) and higher


SY_AttDefVisible Parameter

SY_ATTDEFVISIBLE ParameterQuery and Change Parameters

SY_ATTDEFVISIBLE

Declaration: Alias SY_ATTDEFVISIBLE &H0E0E

Arguments: Two integers. The first is the index of the desired Attribute Definition in the block, and the second (integer [0, 1]) indicates whether the Attribute Definition value text is hidden or visible.

Values: 0 = hidden, 1 = visible

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine whether the Value string of the specified Attribute Definition is visible or hidden.

Query Usage:

Query SY_AttDefVisible, advis

where advis is a numeric variable

Compatibility: Version 14 and higher


TangentFrom

>TangentFrom

{

<Points: 1 = starting point on circle, 2 = end of line

}

Note: Point 2 is not the physical endpoint of the line; actually, the line goes from point 1 to an imaginary, perpendicular line which passes through point 2.

Draws a line from a tangent on a circle to a specific end point.

Compatibility: All versions

Example:

>Circle

{

<Type 0

<Pointxyz 15, 10, 0

<Pointxyz 12, 7, 0

}

>TangentFrom

{

<Pointxyz 12, 7

<Pointxyz 5, 20, 0

}


TA_EndAngle Parameter

TA_ENDANGLE ParameterQuery and Change Parameters

TA_ENDANGLE

Declaration: Alias TA_ENDANGLE &H0704

Arguments: One floating-point number for the ending angle of the text arc.

Accessibility: Query only

Purpose: This parameter reveals the ending angle of a text arc.

Query Usage:

Query TA_Radius, tea

where tea is a numeric variable

Compatibility: Version 14 and higher


IgesOut

>IgesOut

{

<Filename "Filename.ext"

}

This command exports the drawing to an IGES file.

Note:As with HpglIn, you can use an asterisk in the filename parameter to refer to the DesignCAD directory.

Compatibility: All versions


A_Visible Parameter

A_VISIBLE ParameterQuery and Change Parameters

A_VISIBLE

Declaration: Alias A_VISIBLE &H0601

Arguments: one numeric value (integer [0,1]), indicating whether the attribute definition is visible or not. This setting will only take effect when the attribute definition is part of a block-- standalone attribute definitions are always visible..

Values: 0=invisible, 1 = visible

Accessibility: Query/Change

Purpose: This parameter allows you to query and change an attribute's visibility setting. Note that this parameter has the opposite sense of the "Invisible" checkbox in the Info Box. A value of 1 here (visible) would result in the Info Box "Invisible" box being unchecked.

Query Usage:

Query A_VISIBLE, avis

where avis is a numeric variable

Change Usage:

Change A_VISIBLE, avis

where avis is a numeric variable or expression

Compatibility: Version 14 and higher


Ent_ColorByLayer Parameter

ENT_COLORBYLAYER ParameterQuery and Change Parameters

ENT_COLORBYLAYER

Declaration: Alias ENT_COLORBYLAYER &H0117

Arguments: One number (integer) to indicate if the entity takes the color of its host layer

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's color association. A value of 1 indicates that the entity is colored depending on its layer; a value of 0 indicates that the entity's color is independent of its host layer.

Query Usage:

Query Ent_ColorByLayer, ecbylayer

where ecbylayer is a numeric variable

Change Usage:

Change Ent_ColorByLayer, ecbylayer

where ecbylayer is a numeric expression or variable

Compatibility: Version 14 and higher


System Functions

AREA(x)- Area of the entity x. If x is a grid entity, AREA(x) finds the surface area.

EOF(x)- Returns one if file x is at end-of-file, zero otherwise. Note that x is the number used to OPEN the file.

ERR(x)- Returns the error code of the error. This function returns zero until an ON ERROR has been activated. The error codes are listed in the Macro Error Codes topic. You can use any number or variable for x -- it doesn't matter, as long as there is some expression inside the parentheses.

EXIST(a$)- Returns 1 if file a$ exists, 0 if not, -1 if a$ is an invalid file name.

a$ = "c:\test\mytest.txt"

y = EXIST(a$)

if y = 1 then print "The file exists"

if y = 0 then print "The file does not exist"

if y = -1 then print a$, " is not a valid filename."

Note: Unlike most other functions that accept filenames, EXIST accepts wildcards (such as "*.bsc". It is therefore unable to recognize the "*\" shortcut used elsewhere to start a path in the DesignCAD root directory.

LAYER(x) - Layer status of layer x. Returns 0-15

[legal values: 0, 1, 2, 3, 6, 7, 14, 15]

Assume y=LAYER(x)

if ODD(y)=0,-> no entities in layer x. [y = 0, 2, 6, or 14]

if ODD(y)=1,-> entities are in layer x. [y = 1, 3, 7, or 15]

if ODD(y\2)=0, -> layer x is invisible. [y = 0 or 1]

if ODD(y\2)=1, -> layer x is visible. [y = 2, 3, 6, 7, 14, or 15]

if ODD(y\4)=0, -> layer x is not editable. [y = 0, 1, 2, or 3]

if ODD(y\4)=1, -> layer x is editable. [y = 6, 7, 14, or 15]

if ODD(y\8)=1, -> x is the current layer. [y = 14 or 15]

LENGTH(x)- Length of the entity x. It should be a line entity.


HatchOptions

>HatchOptions

{

}

This command opens the Hatch Options dialog box.

Compatibility: Version 13 and higher


DimExtend

>DimExtend

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<OverShoot os

distance between arrow tips and leader tops

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<LinePosition lp

[0 = arrows inside leaders, 1 = arrows outside leaders]

<Axis y

[1 = X, 2 = Y]

<Text fixed$

If present, sets the fixed dimension text. All dimensioned sections will use this same text.

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1, 2 = 1st distance, 3 = 2nd distance, 4 = 3rd distance, ..., n = arrow location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>DimExtend

{

<Arrowhead 7

<Arrowsize 1

<Size 1

<Type 0

<Fix 0

<Gap 1.5

<Overshoot 1.5

<Format 0

<Precision 3

<Location 0

<Tolerancetype 1

<Tolerance 0.002

<Pointxyz 10, 10, 0

<Pointxyz 27.23154, 10, 0

<Pointxyz 35.1234, 10, 0

<Pointxyz 49.15, 10, 0

<Pointxyz 50, 15, 0

}


CMDLINE Statement

PURPOSE:Set the commandline parameters for an upcoming CALL, CHAIN, or RUN statement.

SYNTAX:CMDLINE commandstring$

EXPLANATION:The CMDLINE statement sets up a commandline string which can then be queried by a macro that is subsequently run using the CALL, CHAIN, or RUN statements. The new macro may determine the value of the passed commandline by reading the contents of Sys$(0) as soon as it starts.

See Also: CALL, CHAIN, RUN

COMPATIBILITY:Version 14 and later

EXAMPLE:

Cmdline "1, 10, 100"

Call "*\ThreeNums.d3m"

' The contents of Sys$(0) will be "1, 10, 100" when ThreeNums starts.


D_ArrowScale Parameter

D_ARROWSCALE ParameterQuery and Change Parameters

D_ARROWSCALE

Declaration: Alias D_ARROWSCALE &H0A02

Arguments: One floating-point value representing the dimension's arrowhead scale relative to the dimension text size.

Accessibility: Query/Change

Purpose: This parameter is used to determine how large the arrowhead is relative to the dimension text size. This parameter mirrors the value shown in the "Arrow Size" field in the Info Box.

Query Usage:

Query D_ArrowScale, ascale

where ascale is a numeric variable.

Change Usage:

Change D_ArrowScale, ascale

where ascale can be a numeric variable or expression.

Compatibility: Version 14 and higher


Ruler

>Ruler

{

}

Toggles the ruler display on or off (but ruler only displays in 2D Drafting Mode).

Compatibility: All versions


D_TextSize Parameter

D_TEXTSIZE ParameterQuery and Change Parameters

D_TEXTSIZE

Declaration: Alias D_TEXTSIZE &H0A04

Arguments: One floating-point value representing the text size.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine or change the size of the dimension text.

Query Usage:

Query D_TextSize, tsize

where tsize is a numeric variable.

Change Usage:

Change D_ArrowSize, tsize

where tsize can be a numeric variable or expression.

Compatibility: Version 14 and higher


SnapGrid

>SnapGrid

{

}

Toggles the snap grid on or off.

Compatibility: All versions

Example:

If Not(Sys(17) Then

>SnapGrid

{

}

End If


ApplyLineWidth

>ApplyLineWidth

{

}

Applies the current line width to the selected items. The current Line Width can be extracted (or set) from Sys(4).

Compatibility: All versions


ViewRead

>ViewRead

{

<Filename "filename.dcv"

}

Loads a screen configuration file.

Compatibility: All versions


ViewRedo

>ViewRedo

{

}

Reverts the view settings that were active before the last ZoomPrevious.

Compatibility: All versions


Text

>Text

{

<Style t

0 = normal, 1 = bold, 2 = italic, 3 = bold italic

<Justification j

0 = left, 1 = center, 2 = right

<Size s

text size

<Angle a

the default text angle (if only one point is set)

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<Text text$

the text contents

<DrawAs2DText

If this parameter is present, draw 2D text. If this parameter is omitted, draw 3D text.

<Type t

0=normal text, 1=vectorized text (this does not specify use of a vector font!)

(This parameter is not saved when you record a macro)

<Points: 1 = placement, 2 = angle and length, 3 = height and direction

<Color r, g, b

<Layer laynum

<NULL

<Incomplete

}

Draws 2D or 3D text.

Note: DesignCAD now has a combined Text command, which can be used for drawing 2D text or 3D text. For backward compatibility with existing macros, the Text macro command will continue to draw 3D text if the DrawAs2DText parameter is omitted, and the Text2D macro command still works as always.

Compatibility: All versions.

Example:

t$ = "What is this Text command, anyway?"

Sys(33) = 0 'force TrueType text. 1=vector text

>Text

{

<Style 2

<Justification 1

<Size 3

<Font "Courier New"

<Text [t$]

<Angle 0

<DrawAs2DText

<Pointxyz 15, 0, 0

<Pointxyz 25, 0, 0

}


A_Constant Parameter

A_CONSTANT ParameterQuery and Change Parameters

A_CONSTANT

Declaration: Alias A_CONSTANT &H0604

Arguments: One number (integer, [0, 1]) representing whether or not the attribute definition's text contents are fixed.

Values: 0=changeable, 1 = constant

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the status of the text contents of an attribute definition (one that is not part of a block).

Query Usage:

Query A_Constant, aconst

where aconst is a numeric variable

Change Usage:

Change A_Constant, aconst

where aconst can be a numeric variable or expression

Compatibility: Version 14 and higher


MakePlane

>MakePlane

{

}

This command converts the selected entities into planes of the same shape.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointpolar 10, 120, 0

<Pointpolar 10, 240, 0

}

>Pointselect

{

<Pointxyz 0, 0, 0

}

>MakePlane

{

}


Ellipsoid

>Ellipsoid

{

<Latitude nlat

number of divisions from pole to pole

<Longitude nlon

number of divisions around the middle

<Orientation o

[0 = point 2 on vertex, 1 = point 2 on midpoint of a side]

<Points: 1 = center, 2 = radius1, 3 = radius2, 4 = radius3

}

This command draws an ellipsoid.

Compatibility: Version 15 and higher

Example:

n = 4

red = 128

blue = 255

green = 128

>Ellipse

{

<Color [red, blue, green]

<Layer [n]

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

<Pointxyz -10, 5, 0

}


ReversePoints

>ReversePoints

{

}

Reverses the point order in selected lines, planes, and curves. The apparent shape is not changed; only the order of points (last-to-first instead of first-to-last)

Compatibility: Version 13 and later


SmoothLine

>SmoothLine

{

}

Smoothes the selected lines by averaging points.

Compatibility: All versions


TA_Center Parameter

TA_CENTER ParameterQuery and Change Parameters

TA_CENTER

Declaration: Alias TA_CENTER &H0701

Arguments: Three floating-point numbers for the coordinate of the text arc's center

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the center location of a text arc. Changing the center will move the entire text arc - the span angle, start angle, end angle, and radii remain the same.

Query Usage:

Query TA_Center, cx, cy, cz

where cx, cy, and cz are numeric variables

Change Usage:

Change TA_Center, cx, cy, cz

where cx, cy, and cz are numeric variables or expressions

Compatibility: Version 14 and higher


HelpUsing

>HelpUsing

{

}

This command opens the "Using Help" topic.

Compatibility: All versions


Sweep

>Sweep

{

<Axis a

[0 = x, 1 = y, 2 = z, 3 = 2-point, 4 = line, 5 = plane]

<Angle b

sweep angle

<Ncopy nc

number of copies (NOT including the original)

<Offset o

Distance of final copy from first copy along the sweep axis

<point 1 = center of sweep

}

Creates a surface of rotation by sweeping a shape about an axis.

Compatibility: All versions

Example: Draw a helix.

>Circle

{

<Type 2

<Pointxyz 10, 0, 0

<Pointxyz 10, 2, 0

<Pointxyz 0, 0, 0

}

>PointSelect

{

<Pointxyz 10, 2, 0

}

>Sweep

{

<Axis 1

<Angle 1800

<Ncopy 60

<Offset 30

<Pointxyz 0, 0, 0

}


RemoveDrawingHandles

>RemoveDrawingHandles

{

}

Removes the handles from a drawing. (Identical to ClearDrawingHandle)

Compatibility: Version 15 and higher


RunX

>RunX

{

<FileName exename

}

Runs external program exename.

Compatibility: All versions


Planesnap

>PlaneSnap

{

<Point 1 = point near plane

}

This command moves the cursor to the nearest point on the nearest plane or surface.

Note: To set a point on a plane inside another macro command, use the parameter <Planesnap x, y, z. See Parameters to Set Points.

Compatibility: All versions


SYS$ Function

The SYS$ function represents several different DesignCAD system variables in string format. SYS$(6), for example, is the current path name. A list of the available SYS$ functions follows:

0 – Commandline parameters. (V. 14)
This function contains any extra information that was on the command line after the macro name, or was passed by the CMDLINE statement to a RUN or CALL statement. For example, if you run mymacro.d3m by typing "mymacro.d3m 1, 10, 100" at the commandline, when the macro checks Sys$(0) it will find the string "1, 10, 100"

1 - Entity text string. This is the text from a Text or Attribute entity that was "loaded" with the ENTITY statement (read_only)

2 - Current drawing name (with full path) (read_only).
Contains an empty string until the drawing has been saved at least once.

3 - Current drawing name (minus path) (read_only).
Contains an empty string until the drawing has been saved at least once.

5 - Current drive (read_only)

6 - Current path name

7 - Current time (read_only)

8 - Current date (read_only)

20 - Default drawing directory
Terminate the desired directory with a backslash '\'. Example:
Sys(20) = "C:\Program Files\IMSI\DesignCAD 3D Max 14\My Drawings\"

21 - Default symbol directory
Terminate the desired directory with a backslash '\'. Example:
Sys(21) = "C:\Program Files\IMSI\DesignCAD 3D Max 14\Symbols\2D Symbols\Windows\"

22 - Default bitmap directory
Terminate the desired directory with a backslash '\'.

23 - Default macro directory
Terminate the desired directory with a backslash '\'. Example:
Sys(23) = "C:\Program Files\Addons\DrollTroll's Macro Tools\"

25 - Default view directory
Terminate the desired directory with a backslash '\'.

34 - Default Material List directory
Terminate the desired directory with a backslash '\'.

36 - DesignCAD root directory (read_only)

37 - Default import directory

38 - Default export directory

39 - Default EXE directory

40 - Windows clipboard text

41 - Input window caption. Use an empty string "" for no title bar.

42 - Output window caption. Use an empty string "" for no title bar.

43 – Default Symbol Library Path (V. 15)

90 - Name of current view window

91 - Name of current material

92 - Entity color. This 9-digit string represents the RGB values for the color of the item referenced by the last ENTITY statement. It replaces Sys(92) in earlier versions of DesignCAD. The first three characters represent the red component, the second three represent the green component, and the last three the blue component of the color. (read_only). Note: This function is no longer necessary, as there are dedicated Sys() functions, Sys(290) – Sys(292), which directly represent the RGB values of the current Entity color.

93 - Name of current layer (30 characters, max.)

94 - Name of current TrueType font

95 - Name of current Vector Font

100 - Registered serial number (read_only)

101 - Registered user name (read_only)

102 - Registered company name (read_only)

103 - DesignCAD release date (read_only)

104 - DesignCAD release time (read_only)

105 - DesignCAD version number (read_only)

200 - Statusbar panels visibility (write_only) (V. 13)
This is a six-digit string consisting of ones and zeros. Each digit controls the visibility of one of the panes of the status bar, as follows:
DigitPanel
1Snap mode
2Points counter
3Zoom factor
4Drafting mode
5Preset Point mode
6Working Plane
The command prompt panel cannot be turned off. The string must be exactly six characters in length, or it will be ignored. Any character other than "0" (zero) will make the corresponding panel visible.
Examples:
Sys$(200) = "010001" ' shows only points counter and working plane
Sys$(200) = "111111" ' turns all panels back on

Notes: The string must be exactly six characters long, or it will have no effect on the current settings. Any character other than "0" will turn the corresponding panel ON.
Note for 15.0 and later: an extra field has been added, increasing the number of zeros or ones from six to seven. Digit 1 is now the Units of Measurement, and everything else is shifted one location to the right.
DigitPanel
1Units of Measurement
2Snap mode
3Points counter
4Zoom factor
5Drafting mode
6Preset Point mode
7Working Plane

296 - Entity Symbol Name. (Read-only) (V. 13)
This function contains the full path and filename of the symbol entity currently selected by the ENTITY statement, or the block name if the entity is a block.

297 - Entity Attribute Definition Tag. (V. 13)
This function contains the tag name of the Attribute Definition currently selected by the ENTITY statement.

298 - Entity Attribute Definition Prompt. (V. 13)
This function contains the user prompt for the Attribute Definition currently selected by the ENTITY statement.

299 - Entity Attribute Definition Default Text. (V. 13)
This function contains the default text of the Attribute Definition currently selected by the ENTITY statement.

300 - Entity Name. (V. 16)
This function contains the name of the ENTITY statement.

301 – Layer Group Name. (V. 17)
This function contains the name of the current layer group.

390 - Indexed Block Attribute Definition Tag. (V. 13)
This function contains the tag name of the indexed Attribute Definition that is contained in a Block entity currently selected by the ENTITY statement. The index of the attribute definition being described is set by Sys(391).

391 - Indexed Block Attribute Definition Default Text. (Read-only) (V. 13)
This function contains the default text string for the indexed Attribute Definition that is contained in a Block entity currently selected by the ENTITY statement. The index of the attribute definition being described is set by Sys(391).

392 - Indexed Block Attribute Definition Text. (V. 13)
This function contains the actual text contents of the indexed Attribute Definition that is contained in a Block entity currently selected by the ENTITY statement. The index of the attribute definition being described is set by Sys(391).

Sample code -- how to extract Attribute Definition data from blocks:

For entnum = 1 To Sys(9) ' check every entity in the file
Entity entnum

On Error Resume
If (Sys(90) = 26) And (Sys(296) = 3) Then
' This is a Symbol entity, of subtype Block
blkName$ = Sys$(296)
nAttributes = Sys(390)
for i = 1 to nAttributes
' get data for every attribute definition in this
' block instance
Sys(391) = i
isFixed = Sys(392)
isVisible = Sys(393)
tag$ = Sys$(390) ' attribute definition tag
defText$ = Sys$(391) ' default text string
attText$ = Sys$(392) ' actual text string
next i
End If
If Sys(90) = 71 Then
' This is an attribute definition (outside a block)
isFixed = Sys(298)
isVisible = Sys(299)
tag$ = Sys$(297) ' attribute definition tag
prompt$ = Sys$(298) ' user prompt
defText$ = Sys$(299) ' default text string
End If

If Sys(90) = 68 Then
' This is a construction line
CLineType = Sys(297)
If CLineType = 0 Then
CLMsg$ = "Invalid Data"
End If
If CLineType = 1 Then
CLMsg$ = "Construction Line"
End If
If CLineType = 2 Then
CLMsg$ = "Construction Ray"
End If
End If

Next entnum

803 - Current Paperspace Layout Name

To use the SYS$ function in a macro, use it like you would any other string function. For example, the following macro displays the current drive and path name:

message Sys$(6)


D_Precision Parameter

D_PRECISION ParameterQuery and Change Parameters

D_PRECISION

Declaration: Alias D_PRECISION &H0A07

Arguments: A number (integer [-7 to 15]) representing the number of digits to be displayed to the right of the decimal. Negative values round to increasing powers of 10 – for example -3 would round the value off to the nearest thousand. In the case of fractional formats, the number represents the smallest fractional power of two that will be measured – for example, 4 will round fractions to the nearest 16th, 5 to the nearest 32nd, etc.

Accessibility: Query/Change

Purpose: This parameter allows you to determine, or specify, how precisely a dimension displays the measured distance.

Query Usage:

Query D_Precision, dprec

where dprec is a numeric variable.

Change Usage:

Change D_Precision, dprec

where dprec can be a numeric variable or expression.

Compatibility: Version 14 and higher


Array

>Array

{

<NCopy n1, n2, n3

n1 = number of duplicates along first direction

n2 = number of duplicates along second direction

n3 = number of duplicates along 3rd direction

<Points

0 = location of first copy (set only if UseOriginalCopy=1)

1 = location of first duplicate along first direction

2 = location of first duplicate along 2nd direction

3 = location of first duplicate along 3rd direction

<AlongCurve al

[0=no, 1=yes]

<Perpendicular p

[0=no, 1=yes ; only relevant when AlongCurve is set to 1] This parameter is retained only for backward compatibility. New macros should use the Orientation parameter instead

*new parameters as of Version 14:

<UseOriginalCopy u

[0=no, 1=yes]
If set to 0, you must first set a point for the first copy in the array, followed by points for the direction and distance of subsequent copies.
If set to 1, the selected object becomes the first copy in the array. (This setting emulates the behavior of older versions)

<Type d

[0= "1,2,..." for distance between consecutive copies
1= "1,...2" for overall distance between first and last copy]
This parameter controls the distance type; copies may be set with a fixed distance between one another, or with a fixed distance from first to last copy.

<SpecifyOffsets s

[0=no, 1=yes]
Determines whether the distance between copies (or the overall distance if type = 1) is controlled by the points or by user-specified values.

<Offset r1, r2, r3

r1 = distance along first direction
r2 = distance along second direction

r3 = distance along third direction

<Orientation o

[0=original -- the orientation of the original copy is retained for all subsequent copies.
1=Forward -- each copy shifts its orientation so that an arrow from handles 1-2 points along the direction of the curve, and an arrow from points 1-3 points "upward" from the plane of the curve
2=Reverse -- each copy shifts its orientation so that an arrow from handles 1-2 points in the opposite direction of the curve
3=Left -- each copy shifts orientation so that an arrow from handles 1-2 points to the left of the direction of travel along the curve
4=Right -- each copy shifts orientation so that an arrow from handles 1-2 points the right of the direction of travel along the curve
5=Perpendicular -- mimics the behavior of the Perpendicular flag in older versions of DesignCAD]
If this parameter is present, it overrides the Perpendicular parameter (and only applies if AlongCurve is set to 1)

}

Creates an array of copies of the selected entities.

Compatibility: All versions, but several new parameter were added in Version 14.

Example:

>Sphere

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

}

>PointSelect

{

<Pointxyz 5, 0, 0

}

>SetHandle

{

<Pointxyz 0,0,0

}

>Array

{

<AlongCurve=0

<UseOriginalCopy=1

<NCopy 5, 4, 3
<Type 0

<SpecifyOffsets 0

<Pointxyz 15, 0, 0

<Pointxyz 0, 15, 0

<Pointxyz 5, 0, 15

}


Arrow

>Arrow

{

<Type t

arrowhead style [1 = normal, 2 = slash, 3 = filled circle, 4 = filled normal, 5 = filled long, 6 = none, 7 = hollow circle, 8 = hollow normal, 9 = hollow long, 10 = wide, 11 = filled wide, 12 = hollow wide]

<Size s

arrowhead length (relative to text size in V. 15 and earlier, actual size in V. 16 and up)

<Doublesided d (new in Version 13)

specifies normal arrow or double-headed arrow
[0=normal, 1=double-headed]

<Points: 1 = tail, 2-k = body, k+1 = head

}

Draws an arrow.

Compatibility: All versions

Example: Draw one arrow of each type.

For i = 1 To 12

>Arrow

{

<Type [i]

<Size 1.0

<Pointxyz 0.0, [(i-1)*10], 0.0

<Pointxyz 20.0, [(i-1)*10], 0.0

}

Next i


AddLayerToGroup

>AddLayerToGroup

{

<LayerGroupIndex gi

<Layer layernum1

<Layer layernum2

…

<Layer layernumlast

}

Adds one or more layers to the indexed layer group

Compatibility: Version 17


Parameters to set points:

When developing a macro, sometimes you want the user to set the points himself, but most of the time you want to set the points in the macro. The following macro parameters provide you with a number of ways to set points where you want them.

Remember: if your macro starts with the command >SetStartPoint{} then the coordinates are measured from the start point, NOT from the true origin of the drawing.

Note: Be cautious when using the point parameters. The result of using some of these parameters can vary greatly depending on whether the drawing is in 2D Selection Mode or 3D Selection Mode.

<CG x, y, z

Sets a point at the center of gravity of the object at x, y, z. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

}

' draw a line from the center of gravity
' of the box to a point 5 units right, 5
' units up, and 5 units forward from the
' center.

>Line

{

<CG 0.2, 0.3, 9.5

<Pointrel 5, 5, 5

}

<Gravity x, y, z

Sets a point at the existing point nearest x, y, z in the drawing. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Line

{

<Pointxyz 5, 5, 0

<Pointxyz 10, 5, 0

<Pointxyz 10, 10, 0

}

>Circle4

{

<Radius 1.0

<Gravity 4.5, 4.5, 0

<Pointrel 1, 0, 0

<Pointrel 0, 1, 0

}

>Circle4

{

<Gravity 9.9, 9.9, 0.5

<Pointrel 1, 0, 0

<Pointrel 0, 1, 0

}

<Int1 x, y, z

Use this parameter to set a point at the intersection nearest x, y, z. Be aware that the result can vary, depending on whether you are in 2D Selection Mode or 3D Selection Mode. Also, if you set x, y, z too far away from any intersections (or there are no intersections at all), the point will be set exactly on x, y, z.

Example:

>Line

{

<Pointxyz 10, 0, 0

<Pointxyz 10, 10, 0

}

>Line

{

<Pointxyz 5, 5, 0

<Pointxyz 15, 5, 0

}

>Line

{

<Int1 9.5, 9.5, 0

<PointRel 5, 5, 0

}

<Int2 x1, y1, z1, x2, y2, z2

Use this to set a point at the intersection of two specific lines. x1, y1, z1 selects one of the intersecting lines, and x2, y2, z2 selects the other line. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Line

{

<Pointxyz 10, 0, 0

<Pointxyz 10, 10, 0

}

>Line

{

<Pointxyz 5, 5, 0

<Pointxyz 15, 5, 0

}

>Line

{

<Int2 9.5, 9.5, 0, 4.5, 0.5, 0.5

<PointRel 5, 5, 0

}

<LinePlane XL, YL, ZL, xp, yp, zp

Sets a point at the intersection of the line specified by XL, YL, ZL and the plane specified by xp, yp, zp. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Plane

{

<Pointxyz 5, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 7.5, 10, 0

}

>Line

{

<Pointxyz 7, 3, -5

<Pointxyz 7, 3, 5

}

>Line

{

<LinePlane 7, 3, -5, 5, 0, 0

<PointRel 10, 0, 0

}

<LineSnap x, y, z

Sets a point on the line nearest to x, y, z. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 5, 0

}

>Line

{

<Pointxyz 0, 10, 0

<Pointxyz 15, -5, 0

}

>Line

{

<LineSnap 2, 9, 0

<LineSnap 4.5, 3.7, 0

}

<MidPoint x, y, z

Sets a point at the midpoint of the line segment or arc specified by x, y, z. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointrel 10, 10, 0

}

>Line

{

<MidPoint 2, 2, 0

<Pointrel 5, 0, 0

}

<PlaneSnap x, y, z

Sets a point on the plane nearest to x, y, z. Results may vary between 2D Selection Mode and 3D Selection Mode.

Example:

>Plane

{

<Pointxyz 0, 0, 5

<Pointxyz 10, 0, 5

<Pointxyz 10, 10, 5

<Pointxyz 0, 10, 5

}

>Line

{

<Pointxyz -1, 0, 0

<Planesnap -1, 0, 0

<Pointxyz 5, 5, 0

<Planesnap 5, 5, 0

<Pointxyz 11, 11, 0

<Planesnap 11, 11, 0

}

<PointPolar distance, angle, plane

Use this to set a point at a specific distance and angle. The angle can be measured in the XY, YZ, or XZ planes. Plane: 0 = xy, 1 = yz, 2 = xz. If no point was previously set, the distance is calculated from the origin (or starting point if >SetStartPoint{} was used initially).

Example:

>Line

{

<Pointxyz 10, 0, 0

<PointPolar 10, 90, 2

<PointPolar 10, 90, 0

<PointPolar 10, 180, 0

<PointPolar 10, 279, 0

<PointPolar 10, 270, 2

}

<PointRel dx, dy, dz

Use this to set a point at relative x, y, and z offsets from the last point set. If no point was previously set, the offsets are relative to the origin (or starting point if >SetStartPoint{} was used initially).

Example:

>Line

{

<Pointxyz 0, 0, 0

<PointRel 10, 0, 0

<PointRel 0, 10, 0

}

<PointXYZ x, y, z

Use this to set a point at absolute coordinates.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

<QuadrantSnap x, y, z

Use this to set a point at the nearest quadrant point of a circle or arc.

Example:

>Circle

{

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

>Line

{

<QuadrantSnap 11, 0, 0

<QuadrantSnap 0.5, 10.5, 0

<QuadrantSnap –10.0, -0.25

<QuadrantSnap 0, -10.2, 0

}

<UsePresetPoint

Use this parameter to automatically use all the points in the point buffer (they are not erased from the buffer by this usage). This avoids the necessity to use PointVal to place the points in an array and then cycle through the array to set the points in the drawing command. Especially useful in Preset Point Mode.

Example:

SetPoint "Set five points...", 5

>Line

{

<UsePresetPoint

<Pointxyz 10, 0, 0

}


ArrangeIcons

>ArrangeIcons

{

}

Arranges the minimized view windows.

Compatibility: All versions


EXIT FOR Statement

PURPOSE:To exit a FOR loop prematurely.

SYNTAX:EXIT FOR

EXPLANATION:The EXIT FOR statement can be used to exit a FOR loop from anywhere within the loop. This makes it easy to exit a FOR loop without using a label and a GOTO statement. When executed from a nested FOR loop, the EXIT FOR statement will branch out into the next-higher level of the FOR loop.

See Also: FOR and NEXT

COMPATIBILITY:All versions

EXAMPLE:

For j = 1 To 100

Anykey keycode 'check for the ESC key

If keycode = 27 Then Exit For

.

.

next


BM_Name Parameter

BM_NAME ParameterQuery and Change Parameters

BM_NAME

Declaration: Alias BM_NAME &H0D02

Arguments: A string containing the original filename of the inserted image (path not included).

Accessibility: Query Only

Purpose: This paramer retrieves the original filename used as a source for the bitmap entity.

Query Usage:

Query BM_Name, bmname$

where bmname$ is a string variable.

Compatibility: Version 14 and higher


T_Text Parameter

T_TEXT ParameterQuery and Change Parameters

T_TEXT

Declaration: Alias T_TEXT &H050A

Arguments: One string representing the text displayed by the text entity.

Accessibility: Query/Change

Purpose: This parameter allows you to access the text contents of the text entity.
Note: you cannot Change the displayed text of an Attribute Definition entity using the T_Text parameter. You must use the A_Tag or A_Value parameter to change its text properties.

Query Usage:

Query T_Text, ttext$

where ttext$ is a string variable

Change Usage:

Change T_Text, ttext$

where ttext$ can be a string variable or expression

Compatibility: Version 14 and higher


Midpoint

>MidPoint

{

<Point near line segment

}

Moves the cursor to the midpoint of the nearest line.

Note:To snap to a midpoint inside the parameters section of a macro command, use the <MidPoint x, y, z parameter. See Parameters to Set Points.

Compatibility: All versions


SetPrintOptions

Sets certain default print settings.

>SetPrintOptions

{

<PrintShadows s (new to Version 17.1)

[0=no, 1=yes]

<PrintToFile f

[0=no, 1=yes]

<ShowDim d

[0=no, 1=yes]

<ShowText t

[0=no, 1=yes]

<ShowArrow a

[0=no, 1=yes]

<ShowLine l

[0=no, 1=yes]

}

Compatibility: All versions. PrintShadows parameter only exists in Version 17.1 and higher.


DimRadProgress

>DimRadProgress

{

<Orientation o

text orientation [0 = normal, 1 = horizontal]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Text fixed$

If present, sets the fixed dimension text. All dimensioned sections will use this same text.

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1, 2,... = arcs to dimension, n = dimension location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>DimRadProgress

{

<Arrowhead 9

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

<Pointxyz 35, 10, 0

<Pointxyz 50, 10, 0

<Pointxyz 50, 12, 0

}


Cutoff

>Cutoff

{

<Points: 1 = first corner of region, 2 = opposite corner

}

Deprecated. Cuts all entities at their intersection with the rectangular cutting region. This command is identical to SectionCut below. SectionCut is the preferred form.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 25, 25, 25

}

>Cutoff

{

<Pointxyz 15, 15, -2

<Pointxyz 26, 26, 15

}

>PointSelect

{

<Pointxyz 25, 25, 0

}

>Move

{

<Pointxyz 30, 30, 0

}


SY_YScale Parameter

SY_YSCALE ParameterQuery and Change Parameters

SY_YSCALE

Declaration: Alias SY_YSCALE &H0E05

Arguments: A floating-point number representing the block's scale factor along its y axis.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine the y-scale factor of the block. Only blocks can be scaled independently along x, y, and z. Symbols are scaled globally along all three axes and only use the SY_XScale parameter.

Query Usage:

Query SY_YScale, scaley

where scaley is a numeric variable

Change Usage:

Change SY_YScale, scaley

where scaley is a numeric variable or expression.

Compatibility: Version 14 and higher


DrawingInfo

>DrawingInfo

{

}

Shows the Drawing Info window.

Compatibility: All versions


ViewerRight

>ViewerRight

{

}

Rotates the camera to the right.

Compatibility: All versions


CircleTanLine

>CircleTanLine

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Radius r

specified the circle's radius if LockRadius is 1

<LockRadius b

[0=diameter specified by second point; 1=radius set by radius parameter]

<Points: 1 = tangent line, 2 = direction (and possibly diameter)

}

Draws a circle that lies tangent to the line specified.

Note: The tangent line must be in the same plane as the circle.

Compatibility: Version 17 and higher

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

}

>CircleTanLine

{

<Type 0

<Radius 5

<LockRadius 1

<Pointxyz 10, 0, 0

<Pointxyz 10, 5, 0

}


SolidSegregate

>SolidSegregate

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1, 2 = solids to be segregated

}

Separates two overlapping solids into three sections -- the non-overlapped part of solid 1, the non-overlapped part of solid 2, and the overlapped region.

Compatibility: All versions

Example:

>Cone

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 20, 0

}

>Sphere

{

<Pointxyz 0, 20, 0

<pointxyz 0, 25, 0

}

>SolidSegregate

{

<Pointxyz 5, 0, 0

<Pointxyz 0, 25, 0

}


PUSHPOINT Statement

PURPOSE:Appends a new point to the point buffer.

SYNTAX:PUSHPOINT x, y, z

EXPLANATION:This statement appends a new point to the end of the point buffer. The coordinate of the point is specified by the expressions x, y, and z.

Points added to the buffer with PUSHPOINT cannot be deleted by the user via the Esc key. They can only be removed by setting Sys(1) to zero, or by using the POPPOINT statement.

See Also: POPPOINT

COMPATIBILITY:Version 4 and later

EXAMPLE:

' Draw a sequence of line segments end-to-end.
Dim X(2)

Dim Y(2)

Dim Z(2)

Sys(81) = 1 ' Force SETPOINT to append points to the point buffer
' If Sys(80) = 0, SETPOINT clears existing points

Sys(41) = 1 ' Set "line" rubberband style

PUSHPOINT 10, 10, 0 ' Preset the starting point;
' Pressing Esc won't clear this point

GetTwo:

SETPOINT "Set one more point for the line....", 1

' note the 1 above -- that means SetPoint is expecting no more than ' 1 new point from the user

If Sys(1) < 2 Then End

' The user can press Esc or Enter to skip setting a point.
' If no extra point was set, we end the macro.

' Now we've got exactly two points

For i = 1 To Sys(1)

Pointval X(i), Y(i), Z(i), i

Next i

n = Sys(1)

>Line

{

<UsePresetPoints

}

Sys(1) = 0
' Re-use the last point as the beginning of the next line.

PushPoint X(n), Y(n), Z(n)

Goto GetTwo


H_Scale Parameter

H_SCALE ParameterQuery and Change Parameters

H_SCALE

Declaration: Alias H_SCALE &H0803

Arguments: A floating-point number representing the hatch pattern scale.

Accessibility: Query/Change

Purpose: This parameter allows you to query and change a hatch entity's scale factor.

Query Usage:

Query H_Scale, hscale

where hscale is a numeric variable.

Change Usage:

Change H_Scale, hscale

where hscale can be a numeric variable or expression.

Compatibility: Version 14 and higher


DimCoordinate

>DimCoordinate

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Axis y

[1 = horizontal, 2 = vertical]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = reference point, 2 = location to measure, 3 = dimension direction

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>DimCoordinate

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 15, 0

<Pointxyz 10, 16, 0

<Precision 3

<Format 0

<Font "book antiqua"

}

>DimCoordinate

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 15, 0

<Pointxyz 11, 15, 0

}


SetView

>SetView

{

}

Interactively changes the viewing angles.

Compatibility: All versions


Macro Error Codes

When the macro interpreter encounters an error, the error code is displayed along with the macro line in which the error occurred. The macro error codes and their meanings are listed below:

1 - Out of memory. There are too many numeric variables.

2 - Invalid numeric expression.

3 - '[' does not have a matching ']'.

5 - There is an unmatched quote in a string constant.

6 - There is an ELSE without a corresponding IF statement.

7 - There is an ENDIF without a corresponding IF statement.

8 - An invalid variable name was encountered.

11 - A FOR statement is nested too deeply.

13 - A FOR statement has invalid syntax.

15 - An IF statement has invalid syntax.

16 - A Block IF statement does not have a corresponding END IF statement.

21 - Invalid syntax in OPEN statement.

22 - Invalid file name.

23 - CLOSE statement was encountered when the file was not open.

26 - The subscript is out of range in a numeric array.

28 - The external subroutine file could not be loaded.

29 - An external subroutine has not been loaded and a CALLEXT statement was encountered.

31 - A DO statement is nested too deeply.

32 - Invalid syntax in DO statement.

33 - No LOOP statement was found for the DO statement.

34 - The EXIT statement is not inside a loop.

35 - A FOR or DO statement does not have a corresponding LOOP or NEXT statement.

36 - Out of string space.

37 - Out of symbol space.

38 - Invalid syntax.

39 - A variable has been re-dimensioned.

40 - There is a FOR statement without a corresponding NEXT statement.

41 - A String is too long—more than 80 characters.

42 - An error occurred reading a disk file.

43 - A disk file read was attempted after end-of-file was reached.

44 - A disk file read was attempted when the file was not open for input.

45 - A disk file write was attempted when the file was not open for output.

46 - A disk file could not be opened.

47 - The expression in a POINTVAL statement is larger than the number of points currently set.

48 - Not enough memory is available to run a program.

49 - Not enough memory is available to read the program.

50 - The label in a GOTO or GOSUB statement was not found.

51 - A GOSUB statement is nested too deeply.

52 - A RETURN statement was encountered without a GOSUB.

53 - Too many symbols are in the program.

54 - There is a duplicate label in program.

55 - A label name is too long. It must be a maximum of 7 characters plus a colon.

56 - The program file could not be opened.

57 - The subscript was out of range in a Layer statement.

58 - A division by 0 was attempted.

59 - X ^ Y was encountered where X < 0. X must be positive.

60 - The entity number was out of range in an ENTITY statement.

61 - Syntax error in GET or PUT statement.

62 - File I/O error in GET or PUT statement.

63 - Invalid record length in OPEN statement.

64 - Invalid record number in GET or PUT statement.

65 - The file number in an OPEN statement was already open.

66 - Error in CALLEXT statement.

67 - Invalid precision in PRECISION statement.

68 - A window was already open when a WINDOW statement was executed.

69 - Too many strings are in the program.

92 - SYS(92) is no longer supported. Please use SYS(290) – SYS(292) to get the entity's red, green, and blue values.

100 - An error occurred in a DesignCAD command.

102 - An expression is invalid. This is caused by a syntax error.

103 - An expression or statement is too complex.

104 - An invalid argument was used with a numeric function.

105 - Too many files are open for a Chain or Run statement. A maximum of twenty files can be open.

106 - A get or a put statement was attempted when the file was not open or was not opened for random access (R).

107 - The layer number was out of range in a Layer statement.

108 - The entity is not a symbol.


VrmlOut

>VrmlOut

{

<Filename "file.wrl"

}

Exports the drawing in VRML format.

Compatibility: All versions


FitToAllWindow

>FitToAllWindow

{

}

This command performs Fit To Window in all views of the drawing.

Compatibility: All versions


LAYER Statement

PURPOSE:To turn drawing layers on or off, and to set the current layer.

SYNTAX:LAYER(expression1) = expression2

EXPLANATION:The LAYER statement can be used to set a layer to be visible/invisible or editable/uneditable. It can also be used to set the current layer. The following values can be used with the LAYER statement:

0 – Invisible and not editable

2 – Visible but not editable

6 – Visible and editable

14 – Set as current layer (the current layer is always visible and editable)

"Expression1" is (or evaluates to) the layer number, and "expression2" must evaluate to one of the above values. The LAYER function can be used to get the current status of a layer. See the macro language system function descriptions in the next chapter.

The REGEN statement or the DesignCAD >Regenerate command should be used to regenerate the drawing if the visibility of layers has been changed. Otherwise, entities from invisible layers may remain on the screen, while entities from visible layers may not appear on the screen.

If you have used PUTATTR to change the layer of an item, you must use the LAYER statement to reset the current layer in order for the layer info in the coordinate bar to display correctly. You can use:

Layer(Sys(3)) = 14

' This updates the layer information in the
' drawing.

Note: Don't confuse the Layer statement, which is used to set the status of a layer, with the Layer function, which returns the current status of a layer. The Layer function may return other values than those allowed by the Layer statement. Even immediately after setting the layer's status with the Layer statement, the Layer function may return a different value, depending on whether or not that layer contains any entities in it, or other factors.

See Also: System Functions

COMPATIBILITY:All versions

EXAMPLES:

Layer(1) = 14' set the current layer to layer 1

For j = 0 To 1000 ' make all visible and editable

Layer(j) = 6

Next j


DwgOut

>DwgOut

{

<Filename "drawingname.ext"

<Type t

[0-3=2004/2005/2006, 4=R11/R12, 5=R13, 6=R14, 7=2000, 8 and higher = R13] (Version 15 and higher)
[0 = 2.5, 1 = 2.6, 2=9.0, 3=10.0, 4=11.0, 5=13.0, 6=14.0, 7=2000, 8 and higher = R13] (Dcad14)
This parameter controls the version of DWG file that will be created.
Note: The results of the type parameter changed in version 15, and may change again without notice. You should periodically verify that your macros are exporting the correct dwg version.

<GridType g

[0=3D Mesh, 1=3D Polyface]
This parameter offers the option to export grid entities as a rectangular mesh or as individual polygons.

<HatchType ht

[0=hatch, 1=lines, 2=outline]
This parameter controls how hatch entities are exported.

<2PointLine lt

[0=false, 1=true]
This parameter controls whether polylines are broken into single-segment (2-point) lines.

}

This command exports the drawing to a DWG file.

Note: See DwgIn for notes on path names.

Compatibility: All versions

Example:

>DwgOut

{

<Filename "*\NewDwg.Dwg"
<Type 5
<GridType 0

<HatchType 0

}


TextBlock

>TextBlock

{

<Style t

0 = normal, 1 = bold, 2 = italic, 3 = bold italic

<Justification j

0 = left, 1 = center, 2 = right

<Angle a

the default text angle (if only one point is set)

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

text size

<Distance d

line spacing; distance between the bottom of one line and the top of the next, relative to the text size. So, for "double spaced" lines, use 1.0.

<TextBegin

informs DesignCAD that the text block is defined in the macro, not by user input. Omit this if the user is to fill in the text himself.

<Text text$

a complete line of text to include in the text block

<BlankLine

Use this parameter to specify a blank line of text in the block.

}

Draws a block of text.

Compatibility: All versions

Example:

>TextBlock

{

<Distance 0.5

<TextBegin

<Text "This is the first line."

<BlankLine

<Text "This should follow a blank line"

<Text "and this should not."

<BlankLine

<BlankLine

<Text "This is the last line."

<Justification 1

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 0, -10, 0

}


CurveToLine

>CurveToLine

{

}

Converts a curve to a line, keeping the same points as the nodes of the curve. (The resulting line may not resemble the curve at all.)

Compatibility: All versions

Example:

>Curve

{

<Color 0, 128, 255

<Layer 3

<Type 0

<Pointxyz 0,0,0

<Pointxyz 10,10,0

<Pointxyz 20, 0, 0

<Pointxyz 30, 10, 0

}

>PointSelect

{

<Pointxyz 0, 0, 0

}

>CurveToLine

{

}


SelectionFilter

>SelectionFilter

{

}

Opens the Selection Filter dialog box.

Compatibility: All versions


SolidExplode

>SolidExplode

{

}

Explodes the selected solid(s).

Compatibility: All versions


D_ArrowSize Parameter

D_ARROWSIZE ParameterQuery and Change Parameters

D_ARROWSIZE

Declaration: Alias D_ARROWSIZE &H0A03

Arguments: One floating-point value representing the actual arrowhead size.

Accessibility: Query/Change

Purpose: This parameter can be used to determine or change the size of the dimension arrowhead.

Query Usage:

Query D_ArrowSize, asize

where asize is a numeric variable.

Change Usage:

Change D_ArrowSize, asize

where asize can be a numeric variable or expression.

Compatibility: Version 14 and higher


SY_InsertionPoint Parameter

SY_INSERTIONPOINT ParameterQuery and Change Parameters

SY_INSERTIONPOINT

Declaration: Alias SY_INSERTIONPOINT &H0E01

Arguments: Three floating-point numbers for the x, y, and z component of the lower left corner of the bitmap.

Accessibility: Query/Change

Purpose: Ths parameter allows the programmer to locate or move the insertion point of the symbol or block entity.

Query Usage:

Query SY_InsertionPoint, sx, sy, sz

where sx, sy, and sz are numeric variables.

Change Usage:

Change SY_InsertionPoint, sx, sy, sz

where sx, sy, and sz are numeric variables or expressions.

Compatibility: Version 14 and higher


Ent_Type Parameter

ENT_TYPE ParameterQuery and Change Parameters

ENT_TYPE

Declaration: Alias ENT_TYPE &H0101

Arguments: One number (an integer), representing the entity type (i.e. line, curve, circle, text, dimension, etc.).

Values: See GetAttr or PutAttr for entity type values.

Accessibility: Query only

Purpose: This parameter allows you to determine the entity's type. It gives the same result as Sys(90).

Query Usage:
Query Ent_Type, etype
where etype is a numeric variable representing the entity's type.

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' This should be placed at the top of the macro,
' before any Query or Change statements.

Entity 1 ' Load the first entity's data.

Query Ent_Type, etype ' Find out the entity's type.

If etype = 16 Then

Message "This is a circle or arc"

Else

Message "This is not a circle or arc."

End If

End


Macros and Preset Point Mode

For a long time in DesignCAD for Windows, there was no way to access points set from Preset Point Mode in a macro. Starting with version 13, if you run a macro from Preset Point Mode, any currently available preset points are stored in the macro's point buffer, just as if you had run the SetPoint statement or Entity statement inside the macro. These points can be assigned to variables using PointVal, just like points that have been set using SetPoint.

Furthermore, you can add extra points directly into the point buffer via code -- you don't have to rely on the user to set them. The PresetPoint macro command allows you to add points to the point buffer using the standard macro parameters -- <PointXYZ, PointRel, etc.

Points may be removed from the point buffer using the ErasePresetPoint macro command. This erases the last point from the buffer.

You may force a drawing command to use the points from the point buffer with the macro parameter UsePresetPoints. This avoids the necessity of using PointVal to assign the buffer points to variables and then assign each point inside the drawing command with a For/Next loop.

Note that using the preset points in a drawing command does NOT clear the points from the point buffer. The point buffer must be cleared by setting Sys(1) to zero. If you are in Preset Point Mode, any points that have not been cleared before the macro ends will be available to the next drawing command as if you had set them manually.


Door

>Door

{

<Type t

[0=Custom Door, 1=Custom Sliding Door, 2=2 ft. 6 in. door, 3=3 ft. 6 in. door, 4=3ft. door, 5=5 ft. sliding door]

<Center ca

[0 = door hinges on 1st point, 2 = door centered on 1st point. Corresponds to the “Center Align checkbox in the Door command dialog box.]

<CenterPosition cp

[0 = door not centered in width of double-line walls, 1 = door centered in width of double-line walls. Corresponds to the “Middle Align” checkbox in the Door command dialog box.]

<SlidingDoor 0

[In Version 17, this parameter is meaningless – this parameter is recorded but has no affect on the door that is drawn. Only the Type parameter determines if the door is a sliding door or not.]

<Size s – specifies the width of the door

<Text – specifies the text that is drawn with the door. This corresponds to the "Remark" field in the Door command dialog box.

<Point1 = door hinge point or door center (depends on the Center parameter)

<Point2 = door orientation – this point indicates which way the door opens.

}

This command draws a door.

Compatibility: All versions

Example:

>Line

{

<Color 255,0,0

<Layer 1

<LineStyle 0, 2.0000, 0.0000

<Width 0.5

<Filled 0

<Cap 3

<AutoTrim 0

<Alignment 1

<PointXYZ 10, 10, 0

<PointXYZ 10, 39.5, 0

<PointXYZ 50, 39.5, 0

}

>Door

{

<PointXYZ 24.4, 39.0, 0

<PointXYZ 30.4, 39.6, 0

<Type 2

<Center 1

<CenterPosition 1

<SlidingDoor 0

<Size 2.5

<Text "2-6"

}

>Door

{

<PointXYZ 9.0, 23.7, 0

<PointXYZ 9.0, 30, 0

<Type 4

<Center 1

<CenterPosition 1

<SlidingDoor 0

<Size 3.0

<Text "3-0"

}


SETLAYERPROPS Statement

PURPOSE:To set a layer's default color and linestyle settings from preset values.

SYNTAX:SETLAYERPROPS layerindex

EXPLANATION:This statement is used to override the default settings for a layer. The layer's settings are loaded from Sys() functions 530-542:

530 - Layer uses specific color? (0 = no, 1 = yes)

531 - Layer red (default 0)

532 - Layer green (default 0)

533 - Layer blue (default 0)

534 - Layer uses specific linestyle? (0 = no, 1 = yes)

535 - Linetype (default 0)

536 - Linescale (default 2)

537 - Linewidth in drawing units (default 0)

538 - Layer uses fixed linewidth? (0 = no, 1 = yes)
if 0, uses the width specified by Sys(537);
if 1, uses the linewidth specified by Sys(539)

539 - Fixed linewidth in hundredths of mm (ex. 50 = .5 mm). If the width specified does not match one of the preset values, the actual width will change to the next lowest preset width value (0.00, 0.05mm, 0.09mm, 0.13mm, etc.), so for example 12 would revert to 9, for 0.09mm.

540 - Layer uses filled lines? (0=no, 1 = yes)

541 - Force layer color on all new entities? (0=no, 1 = yes)

542 - Force layer linestyle on all new entities? (0=no, 1 = yes)

LayerIndex is the layer number of the layer whose properties are being loaded.
To use this statement, set the desired layer properties by modifying the values in Sys(530-542), then run the SetLayerProps statement.
Note that changing a layer's settings won't automatically update all entities that are already on that layer. To do that, you must also run the UpdateLayer statement after running SetLayerProps.

See Also: GETLAYERPROPS, UPDATELAYER

COMPATIBILITY:Version 14 and later

EXAMPLE:

Sys(530)= 1

Sys(531) = 0

Sys(532) = 128

Sys(533) = 0

Sys(534) = 1

Sys(535) = 4

Sys(536) = 1.5

Sys(537) = 0

Sys(538) = 1

Sys(539) = 20

Sys(540) = 1

Sys(541) = 1

SetLayerProps 2

Window 12, 50
UpdateLayer 2


SelectMirror

>SelectMirror

{

}

Same as Mirror above

Compatibility: All versions


D_TextBold Parameter

D_TEXTBOLD ParameterQuery and Change Parameters

D_TEXTBOLD

Declaration: Alias D_TEXTBOLD &H0A0B

Arguments: A number (integer [0, 1]) indicating whether the dimension text is normal or bold.

Values: 0 = normal, 1 = bold

Accessibility: Query/Change

Purpose: This parameter allows you to determine or specifiy whether a dimension displays its text in bold style.

Query Usage:

Query D_TextBold, dbold

where dbold is a numeric variable

Change Usage:

Change D_ TextBold, dbold

where dbold is a numeric variable or expression

Compatibility: Version 14 and higher


DrawingHandle

>DrawingHandle

{

<Points: 1 = primary handle, 2 = second handle, 3 = third handle

}

This sets the drawing handles, which are used when loading symbols or merging drawings..

Compatibility: All versions

Example: Set one drawing handle at the center of the drawing.

'Find the center of the drawing

x = (Sys(120) + Sys(122))/2

y = (Sys(121) + Sys(123))/2

z = (Sys(124) + Sys(125))/2

'set a handle at the center

>DrawingHandle

{

<Pointxyz [x, y, z]

}


SetDCADTile

>SetDcadTile

{

}

Makes the current view window arrangement the default DesignCAD tile arrangement. (Note that there is a separate tile setting for 2D mode and 3D mode).

Compatibility: All versions


Duplicate

>Duplicate

{

<Reference r

[0=from handle, 1=from reference point

<Type t

[0 = changeable scale, 1 = fixed scale]

<Points:

1 = 1st handle's new location
(or reference point if reference=1),
2 = 2nd handle
(or new location if reference=1),
3 = 3rd handle
(only in 3D mode if 3 handles set and reference=0)

}

This command makes a new copy of the selected object(s).

Compatibility: All versions

Example: Draw a box, then make two copies: one at original scale, but rotated; the other one smaller than the original.

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 10

}

>Pointselect

{

<Pointxyz 0, 0, 0

}

>SetHandle

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, 10, 0

}

>Duplicate

{

<Type 0

<Reference 0
<Pointxyz 30, 0, 0

<Pointxyz 30, 30, 0

<Pointxyz 30, 30, 10

}

>Duplicate

{

<Type 1
<Reference 0
<Pointxyz 45, 0, 0

<Pointxyz 50, 0, 0

<Pointxyz 50, 10, 0

}
>Duplicate

{

<Type 0
<Reference 1
<Pointxyz 45, 0, 0

<Pointxyz 50, 5, 0

}


Chapter 2: Macro Language - Functions

Macro language functions can be used in numeric expressions. The functions all have a single numeric argument, which can be any numeric expression. For example, ABS(J * 2) would be equal to the absolute value of J * 2.

The following functions are supported:

Numerical Functions

System Functions

String Functions

Two other functions that are supported are:

SYS(x) - System Variable Function

This function returns the value of a DesignCAD System Variable. The variable returned is determined by the value of the argument. See the SYS function.

SYS$(x) - System String Variable Function

This function returns the value of a DesignCAD System StringVariable. The variable returned is determined by the value of the argument. See the SYS$ function.

Macro Error Codes

Macro Language Key Words

Macro Limitations


ZoomOut

>ZoomOut

{

<Point 1 = center of zoom

}

Shrink the current view.

Compatibility: All versions


Circle2

>Circle2

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Points: 1, 2 = diameter, 3 = plane ref. (optional)

}

Draws a circle given two points across the circle's diameter.

Compatibility: All versions

Example: Draw a circular plane tilted at 45° to the YZ plane.

>Circle2

{

<Color 255, 128, 0

<Layer 4

<Linestyle 2, 1.25, 0

<Type 2

<Pointxyz 10, 20, 0

<Pointxyz 10, 20, 20

<Pointxyz 30, 40, 20

}


Circle3

>Circle3

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Points: 1, 2, 3 all lying on the circle

}

Draws a circle that passes through three specific points.

Compatibility: All versions

Example:

>Circle3

{

<Pointxyz 10, 10, 0

<Pointxyz 0, 10, 10

<Incomplete

Message "Set the last point for the circle."

}


Circle4

>Circle4

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Radius r

radius of the circle

<Points: 1 = center of the circle, 2 = axis, 3 = tilt

}

Draws a circle centered at the first point, with the specified radius. Points two and three specify the axis and tilt of the circle.

Compatibility: All versions

Example:

>Circle4

{

<Type 0

<Radius 15

<Pointxyz 10, 10, 0

<Pointxyz 10, 20, 10

<Pointxyz 20, 20, 10

}


GridOptions

>GridOptions

{

}

Opens the Grid Options folder

Compatibility: All versions


Intersect-1

>Intersect-1

{

<Point 1 = point near intersection

}

This command moves the cursor to the intersection nearest the point specified.

Note:To set an intersection point for use by another macro command, use the <Int1 x, y, z parameter. See Parameters to Set Points.

Compatibility: All versions


Intersect-2

>Intersect-2

{

<Points: 1 = point on 1st line, 2 = point on 2nd line

}

This command moves the cursor to the intersection of the two lines specified.

Note:To set an intersection of 2 lines for use by another macro command, use the macro parameter
<Int2 x1, y1, z1, x2, y2, z2. See Parameters to Set Points.

Compatibility: All versions


EntitySelect

>EntitySelect

{

<Type t1

<Type t2

<Type ...

}

This command allows you to select all entities of one or more type in the entire drawing.

Note: See the PutAttribute statement in the previous chapter for a list of entity types.

Compatibility: All versions

Example: Select all line, circles, and ellipses.

>EntitySelect

{

<Type 1

<Type 2

<Type 16

}


MoveRight

>MoveRight

{

}

Rotates the camera to the right.

Compatibility: All versions


DimProgress

>DimProgress

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Axis y

[1 = horizontal, 2 = vertical]

<Text fixed$

If present, sets the fixed dimension text. All dimensioned sections will use this same text.

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = reference point, 2, 3,... = distances, n = location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>DimProgress

{

<Arrowhead 9

<Arrowsize 1

<Size 1

<Type 0

<Fix 0

<Gap 1.5

<Overshoot 1.5

<Format 0

<Precision 3

<Location 0

<Tolerancetype 1

<Tolerance 0.002

<Pointxyz 10, 10, 0

<Pointxyz 27.23154, 10, 0

<Pointxyz 35.1234, 10, 0

<Pointxyz 49.15, 10, 0

<Pointxyz 50, 15, 0

}


Window

>Window

{

<Type t

[0=Custom Width, 1= =2 ft. 6 in. window, 3=3 ft. window, 4=4 ft. window]

<Center ca

[0 = window not centered on point 1, 1 = window centered on point 1. Corresponds to the “Center Align” checkbox in the Door command dialog box.]

<Size s – specifies the width of the window. Only affects Type 0.

<Text – specifies the text that is drawn with the window. This corresponds to the "Remark" field in the Window command dialog box.

<Point1 = window center or leading edge of window(depends on the Center parameter)

<Point2 = window orientation – this point indicates the window direction.

}

This command draws a window.

Compatibility: All versions

Example:

>Line

{

<Color 255,0,0

<Layer 1

<LineStyle 0, 2.0000, 0.0000

<Width 0.5

<Filled 0

<Cap 3

<AutoTrim 0

<Alignment 1

<PointXYZ 10, 10, 0

<PointXYZ 10, 39.5, 0

<PointXYZ 50, 39.5, 0

}

>Window

{

<PointXYZ 24.4, 39.0, 0

<PointXYZ 30.4, 39.6, 0

<Type 2

<Center 1

<Size 2.5

<Text "2-6"

}

>Window

{

<PointXYZ 9.0, 23.7, 0

<PointXYZ 9.0, 30, 0

<Type 4

<Center 0

<Size 3.0

<Text "3-0"

}


XyzIn

>XyzIn

{

<Type t

[1 = connect with line, 2 = connect with curve, 3 = mark points with a small cross, 4 = mark points with a small circle]

<Size s

radius of circle or cross for type 3 or 4

<Filename "Filename.ext"

}

Imports an XYZ coordinate file into the current drawing.

Note: You can use an asterisk in front of the filename just as you can with DxfIn.

Compatibility: All versions

Example:

>XyzIn

{

<Color 64, 220, 128

<Layer 4

<Type 3

<Size 0.25

<Filename "*\test.xyz"

}


CL_Ray Parameter

CL_RAY ParameterQuery and Change Parameters

CL_RAY

Declaration: Alias CL_RAY &H0B01

Arguments: A number (integer [0, 1]) indicating whether the construction line extends in one direction or both from the starting point..

Values: 0 = bidirectional (line), 1 = unidirectional (ray)

Accessibility: Query/Change

Purpose: This parameter allows you to determine or specifiy whether a construction line extends in one direction or in both.

Query Usage:

Query CL_RAY, cdir

where cdir is a numeric variable

Change Usage:

Change CL_RAY, cdir

where cdir is a numeric variable or expression

Compatibility: Version 14 and higher


Split2

>Split2

{

<Cap bopen

[0 = don't cap double lines at the split, 1 – cap double lines]

<SelectOnly bselonly

[0 = allow non-selected lines to be split, 1 = only split selected lines]

<Points: 1 = beginning of split, 2 = end of split

}

Creates a gap in a line or double line, splitting the entity at the two points you set.

Compatibility: Version 15 and higher


ON ERROR Statement

PURPOSE:To set up an error handling routine.

SYNTAX:ON ERROR GOTO label

EXPLANATION:After the ON ERROR statement has been executed, any macro language error will cause the execution to be transferred to the specified label. Macro execution will continue from the label until a RESUME statement is encountered.

This statement is used to trap errors in a macro. The Err () function can be used to determine the error code. See the RESUME statement.

See Also: RESUME

COMPATIBILITY:All versions

EXAMPLE:

On Error Goto keepgoing

Get 4, 30, nothing$ ' generates an error (no file open)

Print "Still going strong!"' second line printed

On Error Goto badfile

Open "i", 1, "------" ' error due to invalid filename

Print "No Error" ' this won't be printed

finish:

Print "Macro Done" ' fourth line printed

End

badfile:

Print "Error: ", Err(1) ' third line printed

Resume finish' macro jumps to the finish label

keepgoing:

Print "Error: ", Err(1) ' first line printed

Resume ' macro continues at the next line


ShadeView

ShadeView

{

<ShowLine sl

[0 = no show, 1 = show lines]

<ShowArrow sa

[0 = no show, 1 = show arrows]

<ShowDim sd

[0 = no show, 1 = show dimensions]

<ShowText st

[0 = no show, 1 = show text]

}

Shade a the view using DesignCAD's native shading algorithm.

Compatibility: All versions


Move

>Move

{

<Reference r

[0=from handle, 1=from reference point
<Type t

[0 = changeable scale, 1 = fixed scale]

<Points:
1 = 1st handle's new location
(or reference point if reference=1),
2 = 2nd handle
(or new location if reference=1),
3 = 3rd handle
(only in 3D mode if 3 handles set and reference=0)

}

This command moves the selected objects to a new location.

Compatibility: All versions

Example:

>2DBox

{

<Type 1

<Orientation 0

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

}

>PointSelect

{

<Pointxyz 0, 0, 0

}

>SetHandle

{

<Pointxyz 0, 0, 0

<Pointpolar 20, 0, 0

}

Print "Press a key"

Anykey

>Move

{

<Type 1
<Reference 0

<Pointxyz 10, 0, 0

'rotated, but not scaled

<Pointpolar 30, 30, 0

}

Print "press a key"

Anykey

>Move

{

<Type 0
<Reference 0

<Pointxyz 10, 0, 0

'rotated and scaled

<Pointpolar 30, 30, 0

}
Print "press a key"
Anykey
>Move
{
<Type 0
<Reference 1
<Pointxyz 0, 0, 0
<Pointrel 10, 0, 0 'moves 10 units right


QShadeSec

>QShadeSec

{

<ShowLine sl

[0 = no show, 1 = show]

<ShowArrow sa

[0 = no show, 1 = show]

<ShowDim sd

[0 = no show, 1 = show]

<ShowText st

[0 = no show, 1 = show]

<Points: 1 = corner of region, 2 = opposite corner of region

}

Quick shade command for section.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 10, 5, 10

<Pointrel 10, 10, -10

}

>QShadeSec

{

<ShowLine 1

<ShowArrow 1

<ShowDim 1

<ShowText 0

<Pointxyz -10, -10, -10

<Pointxyz 10, 20, 10

}


RegenerateAll

>RegenerateAll

{

}

Redraw every entity in the drawing for every view.

Compatibility: All versions


2DMode

>2DMode

{

}

This command toggles 2D Drafting Mode on or off. To determine the current setting, check the value of Sys(344).

Compatibility: All versions

Example: Test if 2D Drafting Mode is currently active; if not, turn it on.

If (NOT Sys(344)) Then

>2DMode

{

}

Else

Message "2D Drafting Mode already active!"

End If


ZoomWindow

>ZoomWindow

{

<Points: 1, 2 = opposite corners of zoom region

}

Enlarge a specific area of the view.

Compatibility: All versions

Example:

>ZoomWindow

{

<Pointxyz 12, 12, 0

<pointxyz 35, 25, 0

}


ID_ZOOM_SELECTION

>ID_ZOOM_SELECTION

{

}

This command zooms the view so that the selected objects fill the view area. Since a user-friendly name for the command such as "ZoomToSelection" was omitted from Macrocmd.ini, this uglier name is used instead. It still works fine.

Compatibility: All versions


Ent_LayerName Parameter

ENT_LAYERNAME ParameterQuery and Change Parameters

ENT_LAYERNAME

Declaration: Alias ENT_LAYERNAME &H0103

Arguments: One string representing the entity's layer name.

Accessibility: Query/Change

Purpose: This parameter allows you to determine the name of the entity's host layer.

Query Usage:

Query Ent_LayerName, elayname$

where elayname$ is a string variable

Change Usage:

Change Ent_LayerName, elayname$

where elayname$ can be a string variable or expression. If the specified layer name does not exist, the entity's layer will not be changed.

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' This should be placed at the top of the macro,
' before any Query or Change statements.

Entity 1 ' load the first entity's data

Query Ent_LayerName, elayname$ ' find out the entity's layer name

If elayname$ = "Floor" Then

Message "This entity is already on the floor"

Else

Change Ent_LayerName, "Floor"

Update ' ALWAYS Update the entity when done with Change

End If

End


SurfaceArea

>SurfaceArea

{

<Point on object you wish to measure

}

Calculates the surface area of an object. The result is stored in Sys(655).

Note:The SurfaceArea command only displays the information in a dialog box. To store the area result in a variable, use the Area() function.

Compatibility: All versions

Example: Draw a right triangular plane with a length of 10 and a height of 20; the surface area should be (10 x 20) / 2 = 100

>Plane

{

<Pointxyz 0, 0, 0

<Pointxyz 0, 20, 0

<Pointxyz 10, 0, 0

}

>SurfaceArea

{

<Pointxyz 0, 20, 0

}


SelectDelete

>SelectDelete

{

}

Erases the selected objects. Same as Erase above.

Compatibility: All versions


ApplyLineFill

>ApplyLineFill

{

}

Applies the current line fill setting to the selected objects (doesn't affect Double Line entities). The current linefill setting can be extracted from Sys(24).

Compatibility: All versions


CA_Radius Parameter

CA_RADIUS ParameterQuery and Change Parameters

CA_RADIUS

Declaration: Alias CA_RADIUS &H0302

Arguments: One floating-point number for the circle/arc's radius

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the circle/arc's radius. Changing the radius does not affect the center location, the starting or ending angles, or the span angle.

Query Usage:

Query CA_RADIUS, cr
where cr is a numeric variable

Query Usage:

Change CA_Radius, cr
where cr is a numeric variable or expression

Compatibility: Version 14 and higher


TileH

>TileH

{

}

Tiles the view windows horizontally.

Compatibility: All versions


TileV

>TileV

{

}

Tiles the view windows vertically.

Compatibility: All versions


D_TextItalic Parameter

D_TEXTITALIC ParameterQuery and Change Parameters

D_TEXTITALIC

Declaration: Alias D_TEXTITALIC &H0A0C

Arguments: A number (integer [0, 1]) indicating whether the dimension text is italicized.

Values: 0 = normal, 1 = italic

Accessibility: Query/Change

Purpose: This parameter allows you to determine or specifiy whether a dimension displays its text in italic style.

Query Usage:

Query D_TextItalic, dital

where dital is a numeric variable

Change Usage:

Change D_ TextItalic, dital

where dital is a numeric variable or expression

Compatibility: Version 14 and higher


PerpendicularTo

>PerpendicularTo

{

<SelectOnly i

[0 = to any line, 1 = to a selected line only]

<Points: 1 = start point, 2 = reference line

}

This command draws a perpendicular line from a starting point to a specified line.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 15, 10, 0

<Pointxyz 25, 15, 0

}

>PerpendicularTo

{

<Pointxyz 0, 12, 0

<Pointxyz 15, 10, 0

}


SY_Attribute Parameter

SY_ATTRIBUTE ParameterQuery and Change Parameters

SY_ATTRIBUTE

Declaration: Alias SY_ATTRIBUTE &H0E0D

Arguments: An integer for the index of the desired Attribute entity in this block or symbol, and a string to hold the text of the indexed Attribute.

Accessibility: Query only

Purpose: This parameter allows the programmer to extract the text contents from a specific Attribute in a block.

Query Usage:

Query SY_Attribute, atindex, attext$

where atindex is a numeric variable and attext$ is a string variable

Compatibility: Version 14 and higher


DeletePoints

>DeletePoints

{

}

Deletes the selected points when points are selected in PointSelectMode.

Compatibility: Version 17.1 and higher

Example:

>2DBox

{

<Orientation 0

<Type 1

<PointXYZ 10, 10, 0

<PointXYZ 25, 20, 0

}

' switch to Point Select Mode if necessary

If Not Sys(345) Then

>PointSelectMode

{

}

End If

' select the box

>PointSelect

{

<Pointxyz 10, 10, 0

}

' select the points on the right side of the box

>DragSelect

{

<Type 0

<PointXYZ 24, 9, 0

<PointXYZ 26, 21, 0

}

' delete the selected points

>DeletePoints

{

}


LineStyleToolBox

>LineStyleToolbox

{

}

Toggles the visibility of the Linestyle Toolbox

Compatibility: All versions


DragMove

>DragMove

{

<Point: 1 = new location

}

This command moves the selected objects to a new location.

Note: This command differs from >Move{} in that it uses only the primary selection handle. Therefore with >DragMove{} it is not possible to move the object and change its scale and/or orientation at the same time.

Compatibility: All versions

Example:

>2DBox

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

<Orientation 0

<Type 1

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>DragMove

{

<Pointxyz 30, 15, 0

}


DoubleLineToPlane

>DoubleLineToPlane

{

}

This command converts selected Double Lines to planes.

Compatibility: Version `3 and higher

Example:

Sys(346) = 0

>Line

{

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

<Pointxyz 20, 20, 0

<Pointxyz 10, 10, 0

<Pointxyz 10, 10, 0

}

>PointSelect

{

<Pointxyz 10, 10, 0

}

>DoubleLineToPlane

{

}


VectorConvert

>VectorConvert

{

}

Converts the currently selected entities to line entities.

Compatibility: All versions


CreateLayerGroup

>CreateLayerGroup

{

<Name groupname

<Layer laynum1

<Layer laynum2

…

<Layer laynumlast

}

Creates a layer group using the given name and specified layer numbers.

Compatibility: Version 17 and higher


SmoothOn

>SmoothOn

{

}

Toggles facet smoothing on for smooth shading.

Compatibility: All versions


NewWindow

>NewWindow

{

}

Opens a new view window.

Compatibility: All versions


DimRadius

>DimRadius

{

<Color rval, gval, bval

red, green, and blue (RGB) color components [0-255]

<Layer n

layer number [0-255]

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Orientation o

text orientation [0 = parallel to arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Axis y

[0 = text and arrow inside, 1 = internal arrow; external text, connected by line to arrow, 2 = text and arrow outside, 3 = text and arrow outside; line to center from arrowhead]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = arc/circle, 2 = dimension location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>Circle

{

<Pointxyz 10, 30, 0

<Pointxyz 10, 40, 0

}

>DimRadius

{

<Axis 0

<Pointxyz 10, 40, 0

<Pointxyz 15, 40, 0

}


Parallel

>Parallel

{

<SelectOnly i

[0 = parallel any entity, 1 = parallel only selected entities]

<Points: 1 = original line, 2 = location of parallel line

}

Draws a new line parallel to an existing line.

Compatibility: All versions

Example:

>Circle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

>Parallel

{

<Color 255, 0, 128

<Pointxyz 10, 0, 0

<Pointxyz 11, 0, 0

}


CLOSE Statement

PURPOSE:To close a disk file.

SYNTAX:CLOSE {filenumber}

EXPLANATION:This statement is used to close a file that has been opened using the OPEN statement. If a disk file has been opened for input or output, it should be closed after being used.

Filenumber is the number of the file to be closed. If it is omitted, all open files will be closed.

Any input/output files left open when the macro ends are automatically closed. However, the CLOSE statement must be used to close an open file before that file number can be opened again in the same macro.

See Also: OPEN

COMPATIBILITY:All versions

EXAMPLE:

Close 1


Ent_LineWeight Parameter

ENT_LINEWEIGHT ParameterQuery and Change Parameters

ENT_LINEWEIGHT

Declaration: Alias ENT_LINEWEIGHT &H010A

Arguments: One number (floating-point) representing the fixed line width in hundredths of a millimeter

Accessibility: Query/Change

Purpose: This parameter allows you to read or set the entity's fixed line width (a fixed line width remains constant regardless of zoom factor or print scale). The Query result is the line weight in millimeters multiplied by 100, the same as Sys(539). Similarly, to change a line weight, multiply the desired width in millimeters by 100.

Query Usage:

Query Ent_LineWeight, elweight

where elweight is a numeric variable

Change Usage

Change Ent_LineWeight, elweight

where elweight is a numeric variable or expression

Compatibility: Version 14 and higher


H_Angle Parameter

H_ANGLE ParameterQuery and Change Parameters

H_ANGLE

Declaration: Alias H_ANGLE &H0804

Arguments: A floating-point number representing the angle of the hatch pattern.

Accessibility: Query/Change

Purpose: This parameter allows you to determine and/or set a hatch entity's hatch pattern angle.

Query Usage:

Query H_Angle, hang

where hang is a numeric variable.

Change Usage:

Change H_Angle, hang

where hang is a numeric variable or expression.

Compatibility: Version 14 and higher


DxfIn

>DxfIn

{

<Filename "drawingname.ext"

<ExplodeBlocks ex

[0 = no, 1 = yes]
This parameter controls whether blocks in the imported drawing are retained as blocks or are exploded into individual entities.

<SkipHatch sh

[0=no, 1=yes]
This parameter offers the option to bypass hatch entities in the imported drawing.

<UseVectorFont uv

[0=no, 1=yes]
If set to 1, all text will be imported to use the current vector font. If set to 0, all text is imported using the current TrueType font.

}

This command imports a DXF file.

Note: For a convenient shortcut to specify the path to DesignCAD itself, use an asterisk "*". For example, if DesignCAD is installed in C:\Program Files\DesignCAD 97, and your dxf file MYDXF.DXF is in the DXF subdirectory underneath DesignCAD, you can specify the filename as "*DXF\MYDXF.DXF" or "*\DXF\MYDXF.DXF".

Compatibility: All versions

Example:

' load a dxf file that is in DesignCAD's directory

>DxfIn

{

<Filename "*\MyDxf.dxf"

}

' load a dxf file from the DXF subdirectory right beneath DesignCAD

>DxfIn

{

<Filename "*\DXF\MyOther.DXF"

<ExplodeBlocks 0

<SkipHatch 1
<UseVectorFont 0

}


MoveToBack

>MoveToBack

{

}

Moves the selected items to the back of the display list (so they appear to be "behind" all other objects in the drawing).

Compatibility: All versions


TrimDouble

>TrimDouble

{

<SelectOnly s *new in Version 15
[0=no, 1=yes (only selected entities will be trimmed)]
<Points: 1 = corner of area to trim, 2 = other corner of area

}

Trims the intersection of two pairs of parallel lines. This command only works in 2D Drafting Mode, and all four lines must lie in the same plane.

Compatibility: All versions. The SelectOnly parameter is only in Version 15 and higher.

Example:

If Not(Sys(344)) Then

>2DMode

{

}

End If

>Line

{

<PointXYZ 0, 0, 0

<PointXYZ 0, 28, 0

}

>Parallel

{

<PointXYZ 0, 28, 0

<PointXYZ 2, 28, 0

}

>Line

{

<LineStyle 0, 2, 0

<PointXYZ -11, 18, 0

<PointXYZ 12, 18, 0

}

>Line

{

<PointXYZ 12, 16, 0

<PointXYZ -11, 16, 0

}

>TrimDouble

{

<SelectOnly 0

<PointXYZ -2 , 15, 0

<PointXYZ 4 , 19, 0

}


DeleteCurrentLayout

>DeleteCurrentLayout

{

}

Deletes the current Paperspace Layout Template, unless it is the last one remaining.

Compatibility: All versions


Trim1

>Trim1

{

<Type

[0 = keep selected part, 1 = trim shorter end]

<TrimPickedSegmentsOnly [0=no, 1=yes] (V17.1)

<Points: 1 = line to be trimmed, 2 = trim reference line

}

Trims one line to its intersection with another line.

Compatibility: All versions. <TrimPickedSegmentsOnly is only available in 17.1 and higher.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 35, 0

<Pointxyz 0, 50, 0

}

>Line

{

<Pointxyz -3, -4, 0

<Pointxyz 0, 18, 0

<Pointxyz 30, 45, 0

}

>Trim1

{

<TrimPickedSegmentsOnly 1

<Pointxyz 2, 20, 0

<Pointxyz 4, 15, 0

<Type 0

}

>Trim1

{

<TrimPickedSegmentsOnly 1

<Linesnap 8, 29, 0

<Linesnap 2, 20, 0

<Type 1

}


Trim2

>Trim2

{

<Type t

[0 = keep selected part, 1 = trim shorter end]

<TrimPickedSegmentsOnly [0=no, 1=yes] (V17.1)

<Points: 1, 2 = lines to be trimmed

}

Trims two lines to their point of intersection.

Compatibility: All versions. <TrimPickedSegmentsOnly is only available in 17.1 and higher.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 35, 0

<Pointxyz 0, 50, 0

}

>Line

{

<Pointxyz -3, -4, 0

<Pointxyz 0, 18, 0

<Pointxyz 30, 45, 0

}

>Trim2

{

<TrimPickedSegmentsOnly 1

<Pointxyz 2, 20, 0

<Pointxyz 4, 15, 0

<Type 0

}


Trim3

>Trim3

{

<TrimPickedSegmentsOnly [0=no, 1=yes] (V17.2)

<Points: 1 = line to be trimmed, 2, 3 = lines to trim between

}

Trim one line between two other lines.

Compatibility: All versions. <TrimPickedSegmentsOnly is only available in 17.2 and higher.

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

}

>Line

{

<Pointxyz 5, -2, 0

<Pointxyz 5, 2, 0

}

>Line

{

<Pointxyz 13, -2, 0

<Pointxyz 13, 2, 0

}

>Trim3

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 2, 0

<Pointxyz 13, -2, 0

}


Pullout

>Pullout

{

<Orientation o

[0 = parallel, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Location l

[0 = in-line, 1 = above, 2 = below]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Text "textcontent"

<Size s

text size; if zero, uses default text size

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, this is relative to the default text size; in V16 and later, it is the actual arrowhead length in units.

<Points 1 = head, 2 ... = body, last = text location

}

Draws an arrow with descriptive text.

Compatibility: All versions

Example:

>Pullout

{

<Orientation 2

<Size 2

<Arrowsize 1

<Arrowhead 3

<Pointxyz 5, 0, 0

<Pointxyz 10, 0, 0

<Text "This is a pullout"

}


AutoDimension

>AutoDimension

{

<Lines l -- dimension lines?

[0 = no, 1 = yes]

<Arcs a -- dimension arcs and circles?

[0 = no, 1 = yes]

<DoubleLines d -- include double line entities?

[0 = no, 1 = yes] (covers all double entity types)

<Ellipses e -- dimension ellipses?

[0 = no, 1 = yes]

<SelectOnly s -- dimension selected entities only?

[0 = no, 1 = yes]

<WaitForOK w -- show the command dialog?

[0 = no, 1 = yes]

}

Automatically dimensions selected entity types.

Compatibility: Version 13 and higher

Example: AutoDimension all selected line entities and double-line entities, and don't show the dialog box.

>AutoDimension

{

<Lines 1

<Arcs 0

<Ellipses 0

<DoubleLines 1

<SelectOnly 1

<WaitForOK 0

}


ScrollBar

>ScrollBar

{

}

Toggles the scroll bar on or off.

Compatibility: All versions


ShowGrid

>ShowGrid

{

}

Toggles the Display Grid on or off.

Compatibility: All versions

Example: Make sure the display grid is off.

If (Sys(15)) Then

>ShowGrid

{

}

End If


A_Value Parameter

A_VALUE ParameterQuery and Change Parameters

A_VALUE

Declaration: Alias A_VALUE &H0605

Arguments: One string representing the text contents of the attribute definition -- this is the text displayed when the attribute definition is part of an inserted block.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the text contents of a stand-alone attribute definition (one that is not part of a block).

Query Usage:

Query A_Value, aval$

where aval$ is a string variable

Change Usage:

Change A_Value, aval$

where aval$ can be a string variable or expression

Compatibility: Version 14 and higher


PointSelect

>PointSelect

{

<Type t

[0 = normal, 1 = Shift, 2 = Ctrl, 3 = Ctrl+Shift]

<Point 1 = object to be selected

}

Selects an object by setting a point on it.

Compatibility: All versions


Numerical Functions

ABS(x)- Absolute value of x. – always returns a positive number.

ACOS(x)- Arc cosine of x (result is in degrees). [-1 <= x <= 1]

ANGLE(dx, dy)- Get the angle of a line dx long and dy high.

ASIN(x)- Arc sine of x (result is in degrees). [-1 <= x <= 1]

ATAN(x)- Arc tangent of x (result is in degrees).

COS(x)- Cosine of x (where x is in degrees, not radians).

EXP(x)- Exponential - e^x.

HCOS(x)- Hyperbolic cosine of x.

HSIN(x)- Hyperbolic sine of x.

HTAN(x)- Hyperbolic tangent of x.

INT(x)- Truncates x to integer closest to zero.

LN(x) - Natural logarithm of x.

LOG(x)- Logarithm (base 10) of x.

ODD(x)- Returns one if x is odd, zero if x is even.

ROUND(x)- Round x to the nearest integer.

SGN(x)- Sign of x (-1 if x < 0; 0 if x = 0; 1 if x > 0).

SIN(x)- Sine of x (where x is in degrees, not radians).

SQR(x)- Square of x (x^2).

SQRT(x)- Square root of x (x must be positive).

TAN(x)- Tangent of x (where x is in degrees, not radians).

TRUNC(x)- Truncate x to integer closest to zero (same as INT).


Rotate

>Rotate

{

<Axis i

[0 = x, 1 = y, 2 = z, 3 = 2-point, 4 = line, 5 = plane]

<Angle a

rotation angle

<ThroughHandle th

[0=no, 1 = yes]
This parameter controls whether the axis of rotation runs through the primary selection handle or through the point(s) specified.

<Points for axis of rotation, line, or plane and center of rotation

}

Rotates the selected objects.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 10

}

>PointSelect

{

<Pointxyz 0, 0, 0

}

>SetHandle

{

<Pointxyz 10, 10, 5

}

>Rotate

{

<ThroughHandle 1

<Axis 1

<Pointxyz 10, 10, 5

<Angle 45

}

>Rotate

{

<ThroughHandle 0

<Axis 2

<Pointxyz 10, 10, 10

<Angle 30

}


DoEntitySelection

>DoEntitySelection

{

<UsePresetPoints 'uses points already in the point buffer

<Points ' specifies points instead of, or in addition to, those already in the buffer.

}

This command is used to select entities while in PresetPoint Mode

Compatibility: Version 16 and later

Example:

' requires PresetPointMode

If Not Sys(1116) Then

>PresetPointMode

{

}

End If

>PresetPoint

{

<PointXYZ 10, 10, 0

<PointXYZ 15, 15, 0

}

>2DBox

{

<Orientation 0

<Type 1

<Layer 1

<Color 255, 0, 0

<UsePresetPoints

}

Sys(1) = 0 'clear the point buffer

>PresetPoint

{

<PointXYZ 20, 10, 0

<PointXYZ 25, 15, 0

}

>2DBox

{

<Color 0, 0, 255

<UsePresetPoints

}

Sys(1) = 0 'clear the point buffer

>PresetPoint

{

<PointXYZ 10.5, 10.5, 0

'<PointXYZ 20.5, 10.5, 0

}

>DoEntitySelection

{

<UsePresetPoints

<PointXYZ 20.5, 10.5, 0

}

'clear preset points'

Sys(1) = 0

End


OrthoLine

>OrthoLine

{

<Incomplete - (Optional)

<Points along orthogonal line

}

Draws an orthogonal line (all segments are parallel to X, Y or Z).

Compatibility: All versions


ShadeSection

ShadeSection

{

<ShowLine sl

0 = no show, 1 = show lines]

<ShowArrow sa

[0 = no show, 1 = show arrows]

<ShowDim sd

[0 = no show, 1 = show dimensions]

<ShowText st

[0 = no show, 1 = show text]

<Points: 1 = 1st corner of area, 2 = 2nd corner of area

}

Shade a section of the view using DesignCAD's native shading algorithm.

Compatibility: All versions


D_TextLocation Parameter

D_TEXTLOCATION ParameterQuery and Change Parameters

D_TEXTLOCATION

Declaration: Alias D_TEXTLOCATION &H0A14

Arguments: One number (integer [0 - 8]) representing the location of the displayed text relative to the arrows.

Values: 0 = centered, 1 = above, 2 = below, 3 = right, 4 = upper right, 5 = lower right, 6 = left, 7 = upper left, 8 = lower left.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the position of the dimension text.

Query Usage:

Query D_TextPosition, tpos

where tpos is a numeric variable.

Change Usage:

Change D_ TextPosition, tpos

where tpos is a numeric variable or expression.

Compatibility: Version 14 and higher


QuarterCircle

>QuarterCircle

{

<Type t

[0=arc, 1=vector arc]

<Points: 1=starting point, 2=endpoint, 3=plane reference

}

Draws a quarter circle counterclockwise from start to end.

Compatibility: All versions

Example:

>QuarterCircle

{

<Color 255, 0, 0

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

}


FilletEdge

>FilletEdge

{

<Radius r1, r2

<NFace n

<Point 1 = edge to fillet

}

This command fillets one edge of a 3D solid.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}

>FilletEdge

{

<Nface 12

<Pointxyz 0, 6, 0

<Radius 4, 4

}

>FilletEdge

{

<Nface 8

<Radius 3, 3

<Pointxyz 10, 6, 0

}


SetDrawingHandle

>SetDrawingHandle

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1 = 1st handle, 2 = 2nd handle, 3 = 3rd handle

}

same as DrawingHandle above

Defines the handles by which a drawing, once saved, can be retrieved using Symbol Load or Merge.

Compatibility: All versions

Example:

>2DBox

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

}

>SetDrawingHandle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 10, 0

}


AW_Size Parameter

AW_SIZE ParameterQuery and Change Parameters

AW_SIZE

Declaration: Alias AW_SIZE &H0903

Arguments: One floating-point value representing the actual arrowhead size.

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the size of the arrowhead.

Query Usage:

Query AW_Size, asize

where asize is a numeric variable.

Change Usage:

Change AW_Size, asize

where asize can be a numeric variable or expression.

Compatibility: Version 14 and higher


PrintNow

>PrintNow

{

}

Sends the document directly to the default printer, using the most recent print settings.

Compatibility: All versions


LoadCustomKeys

>LoadCustomKeys

{

<Filename "filename.dkf"

}

Note: As with the DxfIn command, you may use an asterisk in front of the filename for a shortcut to the DesignCAD directory, such as "*\mykeys.dkf".

Loads custom keyboard (*.dka, *.dkf) files

Compatibility: All versions

Example:

>LoadCustomKeys

{

<Filename "*\MyCustomKeys.dma"

}


SaveCustomKeys

>SaveCustomKeys

{

<Filename "filename.dkf"

{

Saves the current keyboard shortcuts as a custom keyboard file (*.dkf)

Compatibility: Version 15 and later


BM_Type Parameter

BM_TYPE ParameterQuery and Change Parameters

BM_TYPE

Declaration: Alias BM_TYPE &H0D03

Arguments: A number (integer [0, 1]) representing the bitmap type.

Values: 0 = external reference, 1 = embedded image

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine if the image is embedded into the drawing file or if it is an external reference. External references must be sent along with the drawing file if the drawing is to be shared with other users.

Query Usage:

Query BM_Type, bmtype

where bmtype is a numeric variable

Compatibility: Version 14 and higher


Merge

>Merge

{

<Scale s

[0 = changeable scale, 1 = original scale]

<Type t

[0 = not selected after merge, 1 = selected after merge]

<Filename "path\filename.ext"

<Points: 1 = 1st handle, 2 = 2nd handle, 3 = 3rd handle

}

Merges another drawing file into the current drawing, with the option to scale the merged file. This command has the same effect as loading a symbol with the "Explode Symbol" option checked. To load an unexploded symbol with a macro, use the SymbolLoad command.

Note: Use an asterisk (*) as a shortcut for the path in the Filename parameter. The asterisk will always point to the drive and directory where DesignCAD is installed. For example, "*\somefile.dc" refers to a drawing that is in the same directory as DesignCAD. "*\Sample\othrfile.dc" refers to a file in the DesignCAD\Sample directory.

Compatibility: All versions

Example:

>Merge

{

<PointXYZ 0.0000, 0.0000, 0.0000

<PointXYZ 12, 0, 0

<PointXYZ 12, 20, 0

<Filename "*\somefile.dc"

<Type 0

<Scale 0

}


CursorOptions

>CursorOptions

{

}

Opens the Cursor Options window.

Compatibility: All versions


CA_SpanAngle Parameter

CA_SPANANGLE ParameterQuery and Change Parameters

CA_SPANANGLE

Declaration: Alias CA_SPANANGLE &H0303

Arguments: One floating-point number for the circle/arc's span angle

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the circle/arc's span angle. Changing the span angle does not affect the the starting angle, but does affect the ending angle. Setting the span angle to 0 is treated as setting the span angle to 360. If the absolute value of the span angle exceeds 360, the angle's size is reduced by 360 degree increments until it is less than 360. Negative span angles are allowed.

Query Usage:

Query CA_SpanAngle, cspan
where cspan is a numeric variable

Query Usage:

Change CA_ SpanAngle, cspan
where cspan is a numeric variable or expression

Compatibility: Version 14 and higher


D_FontType Parameter

D_FONTTYPE ParameterQuery and Change Parameters

D_FONTTYPE

Declaration: Alias D_FONTTYPE &H0A05 'R - i (0:true type, 1:vector)

Arguments: One number (integer [0, 1]) representing the type of font used for this dimension entity.

Values: 0 = TrueType, 1 = Vector

Accessibility: Query Only

Purpose: This parameter allows you to query the type of font used to display the dimension.

Query Usage:

Query D_FontType, ftype

where ftype is a numeric variable.

Compatibility: Version 14 and higher


IF Statement (single line)

PURPOSE:To execute a single macro statement under certain conditions.

SYNTAX:IF logexpression THEN statement

EXPLANATION:"Logexpression" is a logical expression that can be answered True or False. "Statement" is any valid macro language statement. If logexpression is true, then statement is executed; otherwise, it is not.

The logical expression consists of one or more relational expressions separated by AND or OR. A logical expression can also be preceded by NOT.

A relational expression consists of two numeric or string expressions separated by one of the following relational operators: <, <=, =, >=, >, <>.

COMPATIBILITY:All versions

EXAMPLES:

If Eof(1) <> 0 Then End

retry:

Input "Enter a number less than 20: ", x

If x >= 20 Then Goto retry

If a$ = "y" Then Goto affirm

If y < 5 Or z > 2 Then x = x + 1


LineToCurve

>LineToCurve

{

}

This command converts a line entity to a curve entity using the same points as the original line. The resulting curve may not resemble the original line.

Compatibility: All versions


SetStartPoint

>SetStartPoint

{

<Point 1 = starting location for macro

}

Set (or prompt the user for) a starting point for the macro.

Note: If no starting point is set, all values are measured from the true origin. If this point is set, it becomes the drawing's temporary origin for the duration of the macro. This means that all x, y, and z values are measured from the starting point, not from the true origin. When the macro ends the original origin is restored.

If you do not explicitly set the point in your macro, (i.e. if you call SetStartPoint with no parameters inside the braces) the user will be prompted to set a starting point.

Compatibility: All versions


SelectDuplicateToLayer

>SelectDuplicateToLayer

{

<Layer newlayer

}

Copies selected entities to the specified layer. Same as DuplicateToLayer above.

Compatibility: All versions


BatchConvert

>BatchConvert

{

}

Opens the Batch Conversion dialog box.

Compatibility: All versions


GET Statement

PURPOSE:To read a record from a random access file.

SYNTAX:GET file, recordnumber, stringvar

EXPLANATION:This statement is used to read a record from a random access file. The record length is specified in the OPEN statement.

When the GET statement is executed, the designated record (recordnumber) of the file will be read into the string variable (stringvar). The MKS$ and the CVS functions can be used to convert numeric values to and from eight-byte strings for file input and output.

See Also: PUT, INPUT #, OPEN, CLOSE

COMPATIBILITY:All versions

EXAMPLE:

Open "r," 1, "test.dat," 80

For j = 1 To 10

Input "Enter record number: ", recno

Get 1, recno, a$ ' get record recno

Print right$(a$, 20) ' print the last 20 bytes

Next j


SY_Name Parameter

SY_NAME ParameterQuery and Change Parameters

SY_NAME

Declaration: Alias SY_NAME &H0E02

Arguments: A string containing the original filename of the symbol (path not included).

Accessibility: Query Only

Purpose: This paramer retrieves the original filename used as a source for the symbol or block entity.

Query Usage:

Query SY_Name, sname$

where sname$ is a string variable.

Compatibility: Version 14 and higher


ApplyTextSize

>ApplyTextSize

{

}

Applies the current text size to the selected items. The current text size can be obtained from Sys(12).

Compatibility: All versions


MoveCursor

>MoveCursor

{

<Point - new location for cursor

}

Moves the cursor without setting a point. If no point is specified, the command waits for the user to set a point.

Compatibility: All versions

Example:

>MoveCursor

{

<Pointxyz 10, 10, 0

}


GroupExplode

>GroupExplode

{

}

Explodes the selected group(s) into individual objects

Compatibility: All versions


SETSELECTEDPOINTS Statement

PURPOSE:To set highlighted points in PointSelect Mode into a point buffer for retrieval by POINTVAL.

SYNTAX:SETSELECTEDPOINTS

EXPLANATION:This statement stores the locations of all highlighted points in PointSelect Mode (points may be highlighted by selecting an object in PointSelect Mode, then dragging a selection box around one or more of the points in the selected object. The selected points turn solid blue.) The system function Sys(1) is the current number of points set – it can be checked to determine if any points were highlighted.

See Also: POINTVAL

COMPATIBILITY:Version 13 and later

EXAMPLE:

retry:

Message "Select an object on the screen"

Setpoint "Set a point on an object... ", 1

Pointval x y z 1

>PointSelect

{

<Pointxyz [x, y, z]

}

If Sys(80) < 1 Then Goto retry

If Not Sys(345) Then

>PointSelectMode

{

}

End If

Message "Now select some points on the object"

retry2:

Sys(41) = 2 'rubberband box for user points

Setpoint "Set two points for a selection box", 2

If Sys(1) < 2 Then Goto retry2

>DragSelect

{
Pointval x y z 1 ' get the first point the user set

<Pointxyz [x, y, z]

Pointval x y z 2 ' get the second point the user set

<Pointxyz [x, y, z]

}

SETSELECTEDPOINTS

If Sys(1) < 1 Then

Message "No points selected. Try again."

Goto retry2

End If

Message "Moving the selected points..."

Pointval x y z 1 'get the first selected point

>GroupPointsMove

{

<Pointxyz [x, y, z]

<PointRel 5, 5, 0

}


PointXYZ

>PointXYZ

{

<Point 1 - location to set point

}

This command moves the cursor to the specified point.

Note:To set a point for use by another macro command, use the <Pointxyz x, y, z parameter. See Parameters to Set Points.

Compatibility: All versions


AW_Scale Parameter

AW_SCALE ParameterQuery and Change Parameters

AW_SCALE

Declaration: Alias AW_SCALE &H0902

Arguments: One floating-point value representing the arrowhead scale relative to current text size.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine or change how large the arrowhead is relative to the current text size. This parameter mirrors the value shown in the "Size" field in the Info Box.

Query Usage:

Query AW_Scale, ascale

where ascale is a numeric variable.

Change Usage:

Change AW_Scale, ascale

where ascale can be a numeric variable or expression.

Compatibility: Version 14 and higher

Example:

Include "Dcadalias.d3i"

If Sys(80) < 1 Then End

GetSelect 1, j

Entity j

Query ENT_Type etype

If etype <> 24 Then

Message "Select an arrow first!"

End

End If

Query AW_Type, atype

Query AW_Scale, ascale

Query AW_Size, asize

Query AW_Double, adouble

fmt$ = "Type: %d Scale: %0.3f Size: %0.3f Double: %d"

Format msg$, fmt$, atype, ascale, asize, adouble

Message msg$

Change AW_Scale, ascale*0.75

Update

Regen

End


EllipticalArc

>EllipticalArc

{

<Type t

[0 = normal, 1 = vector]

<Points: 1 = center, 2 = start point (major axis), 3 = endpoint

}

This command draws an elliptical arc which starts at the one of the axes of the ellipse.

Compatibility: All versions

Example:

>EllipticalArc

{

<Type 0

<Pointxyz 0,0,0

<Pointxyz 20, 10, 0

<Pointxyz -10, 5, 0

}


Attribute

>Attribute

{

<Style t

[0 = normal, 1 = bold, 2 = italic, 3 = bold italic]

<Justification

[0 = left, 1 = center, 2 = right]

<Size s

text size

<Font font$

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Text text$

the text contents of the attribute

<Visible i -- attribute visibility (*new in Version 14)

[0= false (text is hidden), 1=true (text is visible)]

<Angle a -- attribute text angle (*new in Version 15)

<Point for location

}

Draws a simple fixed-text attribute.

Compatibility: All versions. Visible parameter only exists in V14 and higher. Angle parameter only exists in V15 and higher.

Example:

>Attribute

{

<Color 0, 0, 255

<Layer 1

<Style 3

<Justification 1

<Size 2

<Font "Times New Roman"

<Text "I am an attribute"

<Visible 1
<Angle 0

<Pointxyz 10, 10, 0

}


VPlane

>VPlane

{

}

same as PerpendicularPlane above

Compatibility: All versions


PerpendicularFrom

>PerpendicularFrom

{

<Length l

length of perpendicular line

<SelectOnly i

[0 = to any line, 1 = to a selected line only]

<Points: 1 = starting line, 2 = direction of perpendicular

}

This command draws a perpendicular line of specified length from a specified point on an existing line in the specified direction.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 10, 5, 0

<Pointxyz 25, 45, 0

}

>PerpendicularFrom

{

<Midpoint 10, 5, 0

<Pointxyz 0, 15, 0

<Length 15

}


Open

>Open

{

<Filename "filename.ext"

}

Opens a drawing file. If you don't specify a filename, or if DesignCAD can't find the file specified, the Open dialog box appears with a list of available files.

Note: You can use an asterisk (*)in place of the full path to the DesignCAD directory. For example, if DesignCAD is installed in C:\Program Files\DesignCAD 97 and you want to open the drawing Myfile.dc in that directory, you can use <Filename "*\Myfile.dc" as the parameter for the Open command, instead of the more cumbersome <Filename "C:\Program Files\DesignCAD 97\Myfile.dc."

Compatibility: All versions

Example:

>Open

{

<Filename "*\Samples\KB20.dc"

}


T_InsertionPoint Parameter

T_INSERTIONPOINT ParameterQuery and Change Parameters

T_INSERTIONPOINT

Declaration: Alias T_INSERTIONPOINT &H0501

Arguments: Three floating-point numbers representing the insertion point of the text.

Accessibility: Query/Change

Purpose: This parameter allows you to determine where the text is located in the drawing. For 3D Text, 2D Text, Attributes, or an Attribute Definitions, the insertion point will be the justification basepoint -- i.e. lower left corner for left-justified, lower midpoint for center-justified, and lower right corner for right-justified. For Text Arcs, the insertion point is the center point of the arc.

Query Usage:

Query T_INSERTIONPOINT, xi, yi, zi

where xi, yi, and zi are numeric variables.

Change Usage:

Change T_INSERTIONPOINT, xi, yi, zi

where xi, yi, and zi are numeric variables or expressions.

Compatibility: Version 14 and higher


ConvertText

>ConvertText

{

}

Converts the selected text from 2D Text to 3D Text or vice versa.

Compatibility: All versions


EA_StartAngle Parameter

EA_ENDPOINT ParameterQuery and Change Parameters

EA_ENDPOINT

Declaration: Alias EA_ENDPOINT &H0408

Arguments: Three floating-point numbers representing the coordinate of the end of the elliptical arc.

Accessibility: Query only

Purpose: This parameter allows you to determine the ending point of the elliptical arc. Unlike the startpoint, the endpoint is not guaranteed to lie exactly on the elliptical arc's perimeter; however, the angle of the line from the center to the endpoint is the same as the arc's end angle. This point cannot be changed directly.

Query Usage:

Query EA_EndPoint, xe, ye, ze

where xe, ye, and ze are all numeric variables.

Compatibility: Version 14 and higher


ANYKEY Statement

PURPOSE:To wait for a single key press.

SYNTAX:ANYKEY {variable}

EXPLANATION:The ANYKEY statement waits for and reads keystrokes from the keyboard. This statement can be used with or without a variable. If a variable is used, then the value of the key pressed is assigned to that variable. String variables or numeric variables can be used. If a numeric variable is used, the ASCII code of the keystroke is assigned to the variable. Pressing a mouse button will act as a keystroke, but will assign no value to the variable in the ANYKEY statement.

This statement is useful if you want to pause for a key press after printing to the bottom of the screen or to a text window.

COMPATIBILITY:All versions

EXAMPLES:

Anykey

Anykey A$' Read a keystroke into A$

Anykey KEY' Read a keystroke into KEY


Hide

>Hide

{

<ShowLine sl

[0 = no show, 1 = show]

<ShowArrow sa

[0 = no show, 1 = show]

<ShowDimension sd

[0 = no show, 1 = show]

<ShowText st

[0 = no show, 1 = show]

}

Hides lines in the entire view.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 12, 24, 12

}

>Line

{

<Pointxyz -10, -10, -10

<Pointxyz 0, 0, 0

}

>Hide

{

<ShowText 0

<ShowLine 1

<ShowArrow 0

<ShowDim 0

}


SnapPreviewMode

>SnapPreviewMode

{

}

Toggles the snap preview cursor on or off.

Compatibility: All versions

Example:

>SnapPreviewMode

{

}


LayerSave

>LayerSave

{

<LayerSelected n1

<LayerSelected n2

<LayerSelected n3

<LayerSelected n...

<Filename "filename.ext"

}

This command saves the contents of one or more layers to a separate drawing file.

Note: As with DxfIn, you can use an asterisk in front of the filename as a shortcut for the path to the DesignCAD directory.

Compatibility: All versions

Example: Save layers 1, 10, and 24.

For i = 1 To 30

>Box

{

<Layer [i]

<Color [8*i, 255 - 8*i, (128 + 8*1)\ 256]

<Pointxyz [5 * i, 0, 0]

<Pointxyz [5 * i + 4, 4, 4]

}

Next i

>LayerSave

{

<LayerSelected 1

<LayerSelected 10

<LayerSelected 24

<Filename "*\Lsave.dc"

}


LABELS

PURPOSE:To provide a reference to locations in the macro for GOTO, GOSUB, ON ERROR, or RESUME statements.

SYNTAX:label:

EXPLANATION:"Label" can be up to twenty characters long, may consist of letters and numbers, and must begin with a letter. A macro language statement can optionally follow a label on a line.

See Also: GOSUB, GOTO, ON ERROR, RESUME

COMPATIBILITY:All versions

EXAMPLE:

retry: ' this is a label

Input "Enter a number less than 20: ", x

If x >= 20 Then Goto retry


AngleDistance

>AngleDistance

{

<Points: 1 = reference point, 2 = offset point

}

Measures the angle and distance from the first to the second point.

Distance value returned in Sys(650)
X-Angle value returned in Sys(651)
Y-Angle value returned in Sys(652)
Z-Angle value returned in Sys(653)
XY-Angle value returned in Sys(654)

Compatibility: All versions

Example: Find the angle and distance between the lower left corner and the upper right corner of a 30x40 2D box.

>2DBox

{

<pointxyz 10, 10, 0

<Pointrel 30, 40, 0

<Type 1

<Orientation 0

}

>AngleDistance

{

<Pointxyz 10, 10, 0

<Pointxyz 40, 50, 0

}

Message "The distance is ", Sys(650)

Message "The angle is ", Sys(654)


UnitsOfMeasurement

>UnitsOfMeasurement

{

<CurrentDrawing u [0 = unitless, 1 = inches, 2 – feet, 3 = miles, 4 = mm, 5 = cm, 6 = m, 7 = km (See also Sys(1100))] – sets the base units for the current drawing (no scaling is performed).

<NewDrawing v [0 = unitless, 1 = inches, etc. (See also Sys(1100))] – sets the default base units for any new drawings that are created.

<UnitlessDrawing w [0 = unitless, 1 = inches, etc. (See also Sys(1100))] – sets the base units to assume if merging or embedding a unitless symbol

<Incomplete [for display the dialog box, must be the last statement]

}

Sets the drawing units options.

Compatibility: Version 15 and higher

Example: set up the measurement units for the current drawing

>UnitsOfMeasurement

{

<CurrentDrawing 1 'change current drawing unit to be inches

<NewDrawing 1 ' set defaulut unit for new drawings to inches
<UnitlessDrawing 2 ' assume merged unitless files are in feet

}


ToolBar

>Toolbar

{

}

Toggles the toolbar on or off.

Compatibility: All versions


HideSec

>HideSec

{

<ShowLine sl

[0 = no show, 1 = show]

<ShowArrow sa

[0 = no show, 1 = show]

<ShowDim sd

[0 = no show, 1 = show]

<ShowText st

[0 = no show, 1 = show]

<Points: 1 = 1st corner, 2 = opposite corner of area to hide lines

}

Hides lines in a section of the current view, bounded by two points set by either the macro or the user.

Compatibility: All versions

Example:

Sys(36) = 1

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 24, 12, 15

}

>Dimension

{

<Pointxyz 0, 0, 0

<Pointxyz 24, 0, 0

<Pointxyz 24, -5, 0

}

>HideSec

{

<ShowDim 1

<Pointxyz -15, -15, 0

<Pointxyz 15, 36, 10

}


TA_EndPoint Parameter

TA_ENDPOINT ParameterQuery and Change Parameters

TA_ENDPOINT

Declaration: Alias TA_ENDPOINT &H0707

Arguments: Three floating-point numbers representing the coordinate of the end of the text arc.

Accessibility: Query only

Purpose: This parameter allows you to determine the exact starting point of the text arc. This point cannot be changed directly.

Query Usage:

Query TA_EndPoint, xe, ye, ze

where xe, ye, and ze are all numeric variables.

Compatibility: Version 14 and higher


MaterialList

>MaterialList

{

}

Generates a counted list of the attributes in the drawing.

Compatibility: All versions


FitToWindow

>FitToWindow

{

}

This command zooms the drawing in or out so that it will completely fill the view window.

Compatibility: All versions


SetPoints

Gets a sequence of points from the user and stores them in the point buffer. It is possible to call this command with the first one or more points pre-set by the macro. SetPoints is quite similar to the SETPOINT statement, except that this command allows you to preset the initial points, and SETPOINT does not.

>SetPoints

{

<Maxpoints n -- maximum number of points accepted

<CmdPrompt prmpt$ -- status-bar message

<Incomplete i -- optional wait for more points

[0=don't wait, 1=wait]

Note: If this parameter is set to zero (or omitted) the SetPoints command will not wait for the user to set ANY points.

<Points p1, ... optional

}

Compatibility: All versions

Example:

Sys(41) = 23 ' angled 2D Box rubberband

>SetPoints

{

<MaxPoints 3 ' accepts 3 points in all

<CmdPrompt "Set a point for the box height"

<Pointxyz 20, 10, 0

<Pointxyz 32, 17.5, 0

<Incomplete 1

}

' quit if less than 3 points

If Sys(1) < 3 Then End

Dim x(3)

Dim y(3)

Dim z(3)

npts = Sys(1)

For i = 1 To npts

Pointval x(i) y(i) z(i) i

Next i

>2DBox

{

<Color 0,0,255

<Layer 7

<Orientation 1 ' angled box

<Type 1 ' vector result

For i = 1 To npts
<Pointxyz [x(i), y(i), z(i)]

Next i

}


Ent_LineTypeScale Parameter

ENT_LINETYPESCALE ParameterQuery and Change Parameters

ENT_LINETYPESCALE

Declaration: Alias ENT_LINESCALE &H0107

Arguments: One number (floating-point) representing the linetype scale.

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the entity's linetype scale. Unlike Sys(97), the Query result is in "real-world" units (i.e. the same value you would see in the Info Box).

Query Usage:

Query Ent_LineScale, eltypescale

where eltypescale is a numeric variable

Change Usage

Change Ent_LineScale, eltypescale

where eltypescale is a numeric variable or expression

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' this should be placed at the very top of the macro

Entity 1 ' load the first entity's data

Query Ent_LineTypeScale, eltscale ' find out the entity's linetype scale

Query Ent_Layer, elayer

If elayer = 7 and eltscale <> 1.5 Then

Change Ent_LinetypeScale, 1.5

End If

Update 'ALWAYS Update the entity when done with Change

End


T_2DText Parameter

T_2DTEXT ParameterQuery and Change Parameters

T_2DTEXT

Declaration: Alias T_2DTEXT &H0509

Arguments: One number (integer [0, 1]) representing the entity's status as 2D text.

Values: 0 = 3D text, 1 = 2D text

Accessibility: Query only

Purpose: This parameter allows you to query if the text entity is displayed in 2D or 3D format.

Query Usage:

Query T_2DText, t2dmode

where t2dmode is a numeric variable

Compatibility: Version 14 and higher


DimBase

>DimBase

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<LinePosition lp

[0 = arrows inside leaders, 1 = arrows outside leaders]

<Axis y

[1 = horizontal, 2 = vertical]

<Text fixed$

If present, sets the fixed dimension text. All dimensioned sections will use this same text.

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = basepoint, 2 = 1st distance, 3 = 2nd distance, etc.

}

Draws a baseline dimension

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>2DMode

{

}

>SetStartPoint

{

}

>DimBase

{

<Color 0,0,0

<Layer 1

<PointXYZ 0.0000,0.0000,0.0000

<PointXYZ 37.1250,-0.7500,0.0000

<PointXYZ 65.1250,-1.6250,0.0000

<PointXYZ 89.5000,-2.3750,0.0000

<PointXYZ 89.5000,5.3750,0.0000

<Axis 1

<Orientation 0

<Precision 3

<Format 0

<Location 0

<ToleranceType 1

<ToleranceSize 0.2500

<ToleranceLow -0.01

<ToleranceHigh +0.01

<Tolerance 0.01

<Suffix "0"

<Prefix "0"

<Font "Arial"

<Size 0.0000

<Type 0

<Gap 1.0000

<OverShoot 0.5000

<Arrowhead 5

<Gap 1.0000

<Offset 2.0000

<LinePosition 0

}


Ent_LineStyleByLayer Parameter

ENT_LINESTYLEBYLAYER ParameterQuery and Change Parameters

ENT_LINESTYLEBYLAYER

Declaration: Alias ENT_LINESTYLEBYLAYER &H0118

Arguments: One number (integer) to indicate if the entity takes the linestyle of its host layer

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's linestyle association. A value of 1 indicates that the entity's linestyle is set by its layer; a value of 0 indicates that the entity's linestyle is independent of its host layer.

Query Usage:

Query Ent_LineStyleByLayer, elsbylayer

where elsbylayer is a numeric variable

Change Usage:

Change Ent_LineStyleByLayer, elsbylayer

where elsbylayer is a numeric expression or variable

Compatibility: Version 14 and higher


A Note On Filenames

Many of the statements and commands in the BasicCAD language use a filename as one of their arguments. BasicCAD has introduced a shortcut mechanism to refer to the DesignCAD root installation directory, making it much easier for developers to load files from a generic DesignCAD installation, rather than hard-coding

"C:\Program Files\IMSI\DesignCAD 3D Max 17\Developer's Directory\..."

If you start your filenames with "*\", the path is assumed to start in the directory where DesignCAD itself is located. So, for example, we can have our macro use

Run "*\Macros By Jack\Macro997.d3m"

instead of

Run "C:\Program Files\IMSI\DesignCAD 3D Max 17\Macros By Jack\Macro997.d3m"

The immediate advantage is, all a developer has to do is install his macros in a standard directory beneath DesignCAD's own root directory. If the user installed DesignCAD into E:\IMSI Software\Dcad17, the first run statement above will still work (assuming the macros are in the appropriate "Macros By Jack" directory). The second form clearly would not work in all cases. Of course, there are ways around this, by using Sys$(36) and checking a lot of other stuff before the macro starts it's proper tasks, but we recommend using "*\" as a general-purpose shortcut.

The same shortcut style can be used for macro commands that take a <filename parameter, such as:

>ImportXYZ
{

<Filename "*\XYZFiles\Test1.XYZ"

}

Note for the future: It is now far less common for Windows users to have read and write access to the Program Files directory; future versions of DesignCAD will have to accommodate the likelihood that symbols, user drawings, and macros may have some other default location.


CutCorner

>CutCorner

{

<Depth d

<Point 1 = corner to cut

}

Chamfers a corner of a 3D solid.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}

>CutCorner

{

<Depth 4

<Pointxyz 10, 10, 0

}

>CutCorner

{

<Pointxyz 0, 10, 0

}


SetViewerPoints

>SetViewerPoints

{

<Points: 1 = target point , 2 = camera location

}

Changes the point being observed and the location of the observer.

Compatibility: All versions

Example:

>SetViewerPoints

{

<Pointxyz 0, 0, 0 ' look at this point

<Pointxyz 200, 300, -1000 ' from here

}


Ent_SolidIndex Parameter

ENT_SOLIDINDEX ParameterQuery and Change Parameters

ENT_SOLIDINDEX

Declaration: Alias ENT_SOLIDINDEX &H0116

Arguments: One number (integer) for the entity's solid index

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's solid association.

Query Usage:

Query Ent_SolidIndex, esolid

where esolid is a numeric variable

Change Usage:

Change Ent_SolidIndex, esolid

where esolid is a numeric expression or variable

Compatibility: Version 14 and higher


Pyramid

>Pyramid

{

<Orientation o

0=vertex, 1=midpoint

<NFace n

}

Draws a pyramid of the specified number of sides.

Compatibility: All versions

Example: Draw two pyramids, the first one fitting inside a circle of radius 10, the next one just enclosing a circle of the same radius.

>Circle

{

<Color 0, 255, 0

<Pointxyz 0,0,0

<Pointxyz 10, 0, 0

<Pointxyz 10, 0, 10

}

sides = 4

>Pyramid

{

<Color 255, 0, 0

' orientation 0 makes the base fit inside a
' given radius

<Orientation 0

<Nface [sides]

<Pointxyz 0, 0, 0

<Pointpolar 10, 0, 2

<Pointrel 0, 10, 0

}

>Pyramid

{

<Color 0, 0, 255

' orientation 1 makes the base enclose a
' given radius

<Orientation 1

<Pointxyz 0, 0, 0

<Pointpolar 10, [180/sides], 2

<Pointrel 0, 10, 0

}


D_FixedText Parameter

D_FIXEDTEXT ParameterQuery and Change Parameters

D_FIXEDTEXT

Declaration: Alias D_FIXEDTEXT &H0A09

Arguments: A number (integer [0, 1]) indicating whether the dimension displays a fixed string or the actual measurement.

Values: 0 = actual measurement, 1 = fixed text

Accessibility: Query Only

Purpose: This parameter allows you to determine if a dimension is using a fixed string of text instead of the actual measured value.

Query Usage:

Query D_FixedText, dfixed

where dfixed is a numeric variable

Compatibility: Version 14 and higher


Print

>Print

{

}

Opens the Print command dialog box.

Compatibility: All versions


SmoothSetting

>SmoothSetting

{

}

This command opens the dialog box for setting the line smoothing preferences. The smooth settings can also be specified directly by setting Sys functions 1020, 1021, 1022, and 1023

Compatibility: Version 13 and higher


MoveUp

>MoveUp

{

}

Rotates camera toward the top of the object.

Compatibility: All versions


CA_EndPoint Parameter

CA_ENDPOINT ParameterQuery and Change Parameters

CA_ENDPOINT

Declaration: Alias CA_ENDPOINT &H0308

Arguments: Three floating-point numbers for the coordinate of the endpoint of the arc or circle.

Accessibility: Query only

Purpose: This parameter allows you to determine the ending point of the circle or arc. Unlike the startpoint, the endpoint's distance from the centerpoint is not guaranteed to be the same as the circle's radius; however, the angle of the line from the center to the endpoint is the same as the circle's end angle.

Query Usage:

Query CA_EndPoint, ex, ey, ez

where ex, ey, and ez are numeric variables.

Compatibility: Version 14 and higher


SY_AttDefCount Parameter

SY_ATTDEFCOUNT ParameterQuery and Change Parameters

SY_ATTDEFCOUNT

Declaration: Alias SY_ATTDEFCOUNT &H0E07

Arguments: An integer representing the number of Attribute Definition entities that are contained inside the current block entity.

Accessibility: Query only

Purpose: This parameter allows the programmer to determine how many Attribute Definition entities are inside the block. Using the parameters listed below, it is possible to iterate through all attribute definitions in a block and retrieve all the attribute definition data.

Query Usage:

Query SY_AttDefCount, adcount

where adcount is a numeric variable

Compatibility: Version 14 and higher


Ent_Point Parameter

ENT_POINT ParameterQuery and Change Parameters

ENT_POINT

Declaration: Alias ENT_POINT &H010E

Arguments: One number (integer) representing which point to examine, and three numbers (floating-point) representing the point's x, y, and z coordinate values.

Accessibility: Query/Change

Purpose: This parameter allows you to examine and change the location of a single point in the entity. The results of a Query are the same as the results of a matching Pointval statement. After one or more points have edited using the Change statement, the entity should be updated using the Update statement. This will be especially important if you plan to examine the Ent_MinBound and Ent_MaxBound parameters (below) after changing the points.

Query Usage:

Query Ent_Point, i, ptX, ptY, ptZ

where i is a numeric variable or expression, and ptX, ptY, and ptZ are numeric variables.

Change Usage:

Change Ent_Point, i, ptX, ptY, ptZ

where i, ptX, ptY, and ptZ are all numeric variables or expressions.

Compatibility: Version 14 and higher


LoadCustomMenu

>LoadCustomMenu

{

<Filename "filename.dmf"

}

Note: As with the DxfIn command, you may use an asterisk in front of the filename for a shortcut to the DesignCAD directory, such as "*\mymenu.dmf".

Loads custom menu (*.dma, *.dmf) files

Compatibility: All versions

Example:

>LoadCustomMenu

{

<Filename "*\MyCustomMenu.dma"

}


Ent_NHandles Parameter

ENT_NHANDLES ParameterQuery and Change Parameters

ENT_NHANDLES

Declaration: Alias ENT_NHANDLES &H0113

Arguments: One number (integer) indicating how many "sticky" handles are associated with the entity.

Accessibility: Query/Change

Purpose: This parameter allows you to determine how many handles are set for the entity.

Query Usage:

Query Ent_Nhandles, ehandles

where ehandles is a numeric variable

Change Usage:

Change Ent_Nhandles, ehandles

where ehandles is a numeric expression or variable

Compatibility: Version 14 and higher


SaveCustomMenu

>SaveCustomMenu

{

<Filename "filename.dmf"

{

Saves the current menu as a custom menu file (*.dmf, *.dma)

Compatibility: All versions


2DDraftingMode

>2DDraftingMode

{

}

Deprecated. You should use 2DMode instead. 2DDraftingMode is retained only for backwards compatibility

Compatibility: All versions


TA_SpanAngle Parameter

TA_SPANANGLE ParameterQuery and Change Parameters

TA_SPANANGLE

Declaration: Alias TA_SPANANGLE &H0705

Arguments: One floating-point number for the span angle of the text arc.

Accessibility: Query only

Purpose: This parameter reveals the span angle of a text arc. If you wish to change the span angle of the text arc, you must increase or decrease the TA_ENDANGLE parameter.

Query Usage:

Query TA_Radius, tspan

where tspan is a numeric variable

Compatibility: Version 14 and higher


Crosshair

>Crosshair

{

}

Toggles the crosshairs on or off.

Compatibility: All versions


ENTITY Statement

PURPOSE:To access an entity in the drawing by entity number.

SYNTAX:ENTITY expression

EXPLANATION:The ENTITY statement is used to read an entity's information into the SYS function variables 90-99, 290-299, and 390-399. It also places all the points of the entity into the points buffer, so they can be accessed using the POINTVAL statement. The entity is accessed by its index number – the arbitrary order in which the entity was placed in the drawing. This makes it possible to process all entities in the drawing.

After running the ENTITY statement, the entity can also be accessed through the QUERY and CHANGE statements

COMPATIBILITY:All versions

EXAMPLE:

' Count the number of line entities in layer 20.

' Sys(9) is the number of entities in the drawing

n = 0

For j = 1 To Sys(9)

Entity j

' Sys(93) = entity layer.

' Sys(90) = entity type.

If Sys(93) = 20 And Sys(90) = 1 Then

n = n + 1

End If

Next j

Message "Number of lines: ", n


Ent_Color Parameter

ENT_COLOR ParameterQuery and Change Parameters

ENT_COLOR

Declaration: Alias ENT_COLOR &H0104

Arguments: Three numbers (integers) for the red, green, and blue color components.

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the entity's color. The Query results are identical, in order, to Sys(290), Sys(291), and Sys(292).

Query Usage:

Query Ent_Color, redval, greenval, blueval

where redval, greenval,and blueval are numeric variables

Change Usage:

Change Ent_Color, redval, greenval, blueval

where redval, greenval,and blueval are numeric variables or expressions

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' this should be placed at the very top of the macro

Entity 1 ' load the first entity's data

Query Ent_Color, redval, greenval, blueval ' find out the entity's color

Message "Current color: ", redval, greenval, blueval

If redval < 128 Then redval = 192

If greenval > 192 Then greenval = 128

If blueval >= 128 Then blueval = 0

Change Ent_Color, redval, greenval, blueval

Update ' ALWAYS Update the entity when done with Change

End


InfoBox

>InfoBox

{

}

This command opens the Info Box.

Compatibility: All versions


ExtendByDistance

>ExtendByDistance

{

<Distance d

<Type t

[0 = along line, 1 = along X, 2 = along Y,
3 = along Z]

<Points: 1 = end of line to be extended.

}

This command extends a line by the specified distance.

Note: Point 1 must be near the endpoint which is to be extended.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0,0,0

<Pointxyz 10,10,10

}

>Extendbydistance

{

<Distance 20

<Type 0

<Pointxyz 10,10,10

}


ShowConstructionLines

>ShowConstructionLines

{

}

Toggles the display of construction lines.

Compatibility: Version 13 and higher


SetHandle

>SetHandle

{

<Type t *new in Version 15

[0 = any location, 1 = center, 2 = lower left front, 3 = lower right front, etc]
New macros should explicitly set this parameter to avoid problems resulting from the user choosing another handle location manually

<Points: 1 = 1st handle, 2 = 2nd handle, 3 = 3rd handle

}

Set the selection handles for the currently selected objects.

Compatibility: All versions. The Type parameter only exists in version 15 and higher.

Example:

>Ellipse

{

<Type 2

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 0, 10, 0

}

>PointSelect

{

<Pointxyz 0, 10, 0

}

>SetHandle

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 0, 10, 0

<Type 0

}

>Duplicate

{

<Pointxyz 0, 0, 10

<Pointxyz 0, 10, 10

<Pointxyz -5, 0, 10

}


SetColor

>SetColor

{

<Color rval, gval, bval

}

Changes the current drawing color.

Compatibility: All versions


Save

>Save

{

}

Saves the drawing under its current name; if it has not been saved yet, the SaveAs dialog box opens.

Compatibility: All versions


StatusBar

>StatusBar

{

}

Toggles the status bar on or off.

Compatibility: All versions


BM_Height Parameter

BM_HEIGHT ParameterQuery and Change Parameters

BM_HEIGHT

Declaration: Alias BM_HEIGHT &H0D05

Arguments: A number representing the height, in pixels, of the original bitmap.

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine the image height.

Query Usage:

Query BM_Height, bmheight

where bmheight is a numeric variable

Compatibility: Version 14 and higher


SysEx Function

The SysEx functions are numeric variables that are stored in text files and are therefore remembered between DesignCAD sessions. There are 10,000 values available: SysEx(1) – SysEx(10000). The variables are stored in files of 100 each, as follows:

SysVal_001.ini stores SysEx(1) – SysEx(100).
SysVal_002.ini stores SysEx(101) – SysEx(200)
etc. through
SysVal_100.ini stores SysEx(9901 – SysEx(10000)

All SysVal ini files can be cleared by running the ClearStorage statement with no arguments.

An individual SysVal ini file can be cleared by running ClearStorage n, where n is the number in the ini file's name. For example,
ClearStorage 100
clears SysVal_100.ini, thereby clearing all values from SysEx(9901) – SysEx(10000).

Example:

For k = 1 To 5
SysEx(k) = (k-1)^2
Next k

For k = 1 to 5
Message "n: ", k-1, " n squared: ", SysEx(k)
Next k


SaveAsSymbol

>SaveAsSymbol

{

<SelectOnly ss

[0=save everything, 1=only save selected items]

<ToLayerZero z

[0 = no (entities retain their original layer), 1 = yes (all entities moved to layer 0 in the saved file)]

<Type t

[0=default handles, 1=use existing handles or macro points set]

<Filename "filename.ext"

}

Saves the current drawing, or selected entities, under a new filename for use as a symbol.

Note: As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Compatibility: Version 15 and higher

Example: save the current selection using macro points as the drawing handles

>2DBox

{

<Orientation 0

<Type 1

<Pointxyz 0, 0, 0

<Pointxyz 10, 7.5, 0

<Layer 7

}

>PointSelect

{

<Pointxyz 0, 0, 0

>SaveAsSymbol

{

<Filename "*\symbols\MyNewSymbol.dcd"

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Type 1 'use the points just set for the handles

<SelectOnly 1 ' save only the selected entities

<ToLayerZero 1 'store the saved entities in layer 0

}


DecVDis

>DecVDis

{

}

Reduces viewing distance by 10% of current value.


TextArc

>TextArc

{

<Style t

0 = normal, 1 = bold, 2 = italic, 3 = bold italic

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Text text$

the text contents

<Scale q

the relative height of the text

<Type t

0 = normal text, 1 = vector text

<Points: 1 = start of arc, 2 = point on arc, 3 = end of arc

}

Draws a text arc.

Compatibility: All versions

Example:

>TextArc

{

<Style 1

<Font "Arial"

<Text "So this is a text arc!"

<Scale 1.5

<Pointxyz 0, 0, 0

<Pointxyz 20, 15, 0

<Pointxyz 40, 0, 0

}


Ent_Selected Parameter

ENT_SELECTED ParameterQuery and Change Parameters

ENT_SELECTED

Alias ENT_SELECTED &H010C

Arguments: One number (integer [0,1]) indicating if the entity is selected or not.

Values: 0 = not selected, 1 = selected

Accessibility: Query/Change

Purpose: This parameter allows you to determine and change whether the entity is selected or not. The Query result is the same as Sys(96).

Query Usage:

Query Ent_Selected, eselected

where eselected is a numeric variable

Change Usage:

Change Ent_Selected, eselected

where eselected is a numeric variable or expression

Compatibility: Version 14 and higher


Ent_MinBound Parameter

ENT_MINBOUND ParameterQuery and Change Parameters

ENT_MINBOUND

Declaration: Alias ENT_MINBOUND &H010F

Arguments: Three numbers (floating-point) representing the minimum XYX coordinate of the entity's bounding box

Accessibility: Query only

Purpose: This parameter allows you to find out the minimum X, Y, and Z values of the entity's bounding box.

Query Usage:

Query Ent_MinBound, minX, minY, minZ

where minX, minY, and minZ are numeric variables.

Compatibility: Version 14 and higher


HiddenEdgeBySection

>HiddenEdgeBySection

{

<Points 1, 2 = region overlapping lines to be hidden

}

This command hides all line segments enclosed by or touching the bounding box.

Compatibility: All versions

Example:

>Plane

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, 20, 0

<Pointxyz 0, 20, 0

}

>Line

{

<Pointxyz 10, -5, 0

<Pointxyz 10, 25, 0

}

>Circle

{

<Type 2

<Pointxyz 10, 10, 0

<Pointxyz 10, 15, 0

}

>Circle

{

<Type 2

<Pointxyz 10, 10, 0

<Pointxyz 10, 15, 0

}

>CutPlane

{

<Pointxyz 10, -5, 0

<Pointxyz 0, 0, 0

}

>PlaneSubtract

{

<Pointxyz 10, 15, 0

<Pointxyz 0, 0, 0

}

>PlaneSubtract

{

<Pointxyz 10, 15, 0

<Pointxyz 10, 0, 0

}

>HiddenEdgeBySection

{

<Pointxyz 10, 2.5, 0

<Pointxyz 12, 17.5, 0

}


INPUT Statement

PURPOSE:To read a value from the keyboard and assign it to a variable.

SYNTAX:INPUT "promptstring", variable list

INPUT [prompt$], variable list

INPUT variable list

EXPLANATION:The INPUT statement is used to ask the user for input and assign the entered value to a variable. "PromptString" is an optional message to be displayed for the user. It can be a quoted string, like "Enter x and y", or it can be a string variable enclosed in square brackets, like [prompt$].
Note: The ability to use a string variable for the prompt was introduced in DesignCAD 13, and is not backward compatible with older versions.

"Variable list" is one or more variables, separated by commas, to which the input values are to be assigned. If the user is required to enter multiple values, he can separate the entries with spaces or commas.

If a single string variable is used in the variable list, the entire string input from the keyboard is assigned to the variable.

If numeric variables are used, the numbers input from the keyboard are assigned to the corresponding variables.

If more than one variable is used with the INPUT statement, any strings input by the user should be enclosed in quotes ("") - otherwise, any spaces or commas in the string will be misinterpreted as separators between input variables.

Values read with the INPUT statement can be any valid DesignCAD macro language expressions – they do not have to be simple numbers. For example, the user can enter SQRT(2) or 45/2 when a number is requested. However, if the expression contains any spaces, the user should enclose the entire statement in parentheses, such as(SQRT(2) - 1 + COS(45)).

By default, the INPUT window is centered on the screen. However, the window's upper left corner can be moved by setting system variable functions Sys(130) and Sys(131). The INPUT window's caption can be changed by setting system string variable function Sys$(41). Setting Sys$(41) to an empty string "" creates an INPUT window with no title bar at all.

See Also: INPUT #

COMPATIBILITY:All versions

EXAMPLES:

Input "Enter the initial value: ", init

prompt$ = "Enter x and y, separated by commas: "

Input [prompt$], x, y

Message "You entered ", x, " for x and ", y, _
" for y"

Input "Enter the input file name: ", file$

Open "i", 1, file$

Input "Enter the coordinates: ", x, y, z


Light

>Light

{

}

This command opens the Light Options dialog. The command only works in 3D mode.

Compatibility: All versions


DL_Hatch Parameter

DL_HATCH ParameterQuery and Change Parameters

DL_HATCH

Declaration: Alias DL_HATCH &H0206

Arguments: One number (integer) that repesents the index of the fill pattern used by the entity.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the hatch pattern index used to fill the double line entity.

Query Usage:

Query DL_HATCH, edlhatchindex

where edlhatchindex is a numeric variable

Change Usage:

Change DL_HATCH, edlhatchindex

where edlhatchindex is a numeric variable or expression

Compatibility: Version 14 and higher


Quit

>Quit

{

}

Exits DesignCAD.

Compatibility: All versions


DrawSymbolAsBox

>DrawSymbolAsBox

{

}

Toggles whether DesignCAD draws symbols as boxes (for faster redraws) or actually draws each entity comprising the symbols.

Compatibility: All versions


Zoom

>Zoom

{

<Zoomfactor zf

zoom factor

<Point 1 = center of zoom

}

Zoom in or out of the drawing.

Compatibility: All versions

Example:

>Zoom

{

<Zoomfactor 2.5

<Pointxyz 5, 20, 12

}


ApplyArrowSize

>ApplyArrowSize

{

}

Applies the current arrowhead size to the selected arrow entities. The current arrowhead size can be determined by checking Sys(445) (as of Version 16)

Compatibility: All versions. Note that starting with Version 16, arrowhead size is no longer a proportion of text size, but is independent of text size.


WINDOW Statement

PURPOSE:To open a text window to display the output from PRINT statements.

SYNTAX:WINDOW nrows, ncols

EXPLANATION:This statement opens a text window or dialog box on the screen. Nrows and ncols are the number of rows and columns for the text window – they determine the window size.

By default, the window is centered on the screen. However, the location of the window's upper left corner can be controlled by using system variable functions Sys(132) and Sys(133). The window's caption can be changed by modifying system string function Sys$(42). A captionless window (no title bar) may be created by assigning an empty string "" to Sys$(42). Once these sys functions are set, they remain in effect for all subsequent windows until they are reset or until the macro ends.

As long as the text window is open, all PRINT statements are displayed in the window. The text window remains open until a WCLOSE statement is executed or until the macro terminates.

The CLS, LOCATE, and TAB statements can be used to clear the screen and position the cursor in the text window. The COLOR statement can be used to set the text color inside the window.

Only one text window can be opened at a time.

See Also: WCLOSE, CLS, TAB, LOCATE, PRINT

COMPATIBILITY:All versions

EXAMPLE:

Window 5, 20 ' open a window 5 x 20 chars.

Locate 3, 10

Print "This is a test"


Acquire

>Acquire

{

}

Acquires an image from a scanner.

Compatibility: All versions


IncVDis

>IncVDis

{

}

Increase viewing distance 10%.

Compatibility: All versions


EllipticalArc2

>EllipticalArc2

{

<Type t

[0 = normal, 1 = vector]

<Points: 1 = center, 2 = major axis, 3 = minor axis, 4 = start point, 5 = end point

}

This command draws an elliptical arc with arbitrary starting and ending angles.

Compatibility: All versions

Example:

>EllipticalArc2

{

<Type 0

<Pointxyz 0,0,0

<Pointxyz 20, 10, 0

<Pointxyz -5, 5, 0

<Pointxyz 11, -5, 0

<Pointxyz 6, 10, 0

}


INCLUDE Statement

PURPOSE:To incorporate variables and/or subroutines from other files into the current macro.

SYNTAX:INCLUDE filename

EXPLANATION:The INCLUDE statement can be used to load variables, subroutines, or aliases stored in external files into the current macro.

You can add an INCLUDE statement anywhere, but it's location does matter; please consider the points below:

DesignCAD macros are read in a top-down fashion, and all names are global after they have been first assigned or used. The effect of an INCLUDE statement is the same as if you had manually copied the text of the included file into your current macro at the point where the INCLUDE statement is located.

INCLUDE files that contain aliases or global variable definitions should be included before they are used by your code; we recommend placing them at the beginning of your macro. For example, if you have a file that defines physical and numeric constants such as Pi, the Golden Mean, and the speed of light, you should include that file at the beginning of your macro.

INCLUDE files containing subroutines should be placed after the END statement for your main routine. Again, recall that macros are read top-down. Your main program code should be at the beginning of the macro. Subroutines, whether added manually or using Include, should go after your main program's END statement.

You may INCLUDE files that have any valid Windows filename; however, we recommend using a .d3i extension.

See Also: GOSUB, ALIAS

COMPATIBILITY:Version 13 and later

EXAMPLES:

' This example assumes the existence of two files:
' Constants.d3i and Subs.d3i.
' Constants.d3i defines a variable phi,

' and Subs.d3i defines a subroutine phi_sub.

Include "*\constants.d3i"

'

' The variable phi is now initialized.

For i = 2 To 16 Step 2

Print "Phi / ", i, " ", phi/i

Gosub phi_func

Next i

End

'

Include "*\subs.d3i"

' The subroutine phi_sub is now available,

' just as if it had been added directly to the
' bottom of this macro


TA_StartAngle Parameter

TA_STARTANGLE ParameterQuery and Change Parameters

TA_STARTANGLE

Declaration: Alias TA_STARTANGLE &H0703

Arguments: One floating-point number for the starting angle of the text arc.

Accessibility: Query only

Purpose: This parameter reveals the beginning angle of a text arc.

Query Usage:

Query TA_Radius, tsa

where tsa is a numeric variable

Compatibility: Version 14 and higher


Join

>Join

{

<SelectOnly s

[0 = only selected objects, 1 = all objects in range box]

<Endpoint i

[0 = all enclosed points, 1 = endpoints only]

<2DRange r

[0 = 3D range box, 1 = 2D range box]

<Points: 1 = corner of region, 2 = opposite corner of region

}

This command joins the enclosed endpoints at a single point.

Compatibility: All versions

Example:

>Line

{

<PointXYZ 0.0000, 0.0000, 0.0000

<PointXYZ 9.0711, -10.4578, 0.0000

}

>Line

{

<PointXYZ 24.7008, 0.0754, 0.0000

<PointXYZ 12.9414, -14.1277, 0.0000

}

>Line

{

<PointXYZ -0.7520, -27.4020, 0.0000

<PointXYZ 9.7243, -13.8872, 0.0000

}

>Join

{

<PointXYZ 1.8319, -7.1940, 0.0000

<PointXYZ 19.0819, -17.4678, 0.0000

<EndPoint 1

<2DRange 1

<SelectOnly 0

}


H_PatternName Parameter

H_PATTERNNAME ParameterQuery and Change Parameters

H_PATTERNNAME

Declaration: Alias H_PATTERNNAME &H0802

Arguments: A string representing the name of the hatch pattern used.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change a hatch entity's hatch pattern by name.

Query Usage:

Query H_PatternName, hpat$

where hpat$ is a string variable.

Change Usage:

Change H_PatternName, hpat$

where hpat$ is a string variable or expression.

Compatibility: Version 14 and higher


SY_Type Parameter

SY_TYPE ParameterQuery and Change Parameters

SY_TYPE

Declaration: Alias SY_TYPE &H0E03

Arguments: A number (integer [0, 1]) representing the bitmap type.

Values: 0 = external reference, 1 = embedded symbol, 2 = block

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine if the enitty is an embedded symbol, a reference to an external symbol, or a block. External references must be sent along with the drawing file if the drawing is to be shared with other users.

Query Usage:

Query BM_Type, stype

where stype is a numeric variable

Compatibility: Version 14 and higher


Extrude

>Extrude

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<AlongCurve a

extrudes an object along a curve or line [0=false, 1=true]

<Perpendicular p

only applies when AlongCurve is true – if Perpendicular is also true, each copy of the extrusion template remains perpendicular to the curve or line. [0=false, 1=true]

<Scale 0, sfixed

The ending scale factor for fixed scale extrusion. There is no need to specify this scale for a varying scale extrusion; it is always 1.0.

<Scale 1, sf1

Scale factors 1 through n are only used for varying scale extrusion. Scale factor 1 applies at the SECOND point, factor 2 at the THIRD, etc.

<Scale 2, sf2

<Scale 3, sf3

<Scale n, sfn

<Type t

[0 = fixed, 1 = varying]

<Points: 1 = reference, 2 = first distance, 3 = 2nd distance, ...

}

This creates a surface by extruding a profile along a path.

Compatibility: All versions

Example: Extrude one object with varying scale, and another with fixed scale.

>Circle

{

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 0, 10, 0

<Pointxyz 10, 10, 0

}

>PointSelect

{

<Pointxyz 0, 0, 0

}

>Duplicate

{

<Pointxyz 30, 0, 0

}

>Extrude

{

<Type 1

<Pointxyz 0, 0, 0

<Pointxyz 0, 0, 10

<Pointxyz 0, 0, 11

<Pointxyz 0, 0, 20

<Pointxyz 0, 0, 20

<Pointxyz 0, 0, 0

<Pointxyz 0, 0, 0

<Scale 1, 1.0

<Scale 2, 2.0

<Scale 3, 1.0

<Scale 4, 0.75

<Scale 5, 0.75

<Scale 6, 1.0

}

>PointSelect

{

<Gravity 30, 0, 0

}

>Extrude

{

<Type 0

<Pointxyz 30, 0, 0

<Pointxyz 30, 0, 20

<Scale 0, .75

}


CircleTan2Lines

>CircleTan2Lines

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Radius r

radius of the circle

<SelectOnly s

[0 - can use any circles, 1 - only draws tangent to the selected circles]

<Points: 1 = tangent line, 2 = other tangent line

}

Draws a circle of given radius that lies tangent to the two lines specified.

Note: The tangent lines must be in the same plane.

Compatibility: All versions

Example:

>SetStartPoint

{

}

>Line

{

<Color 255, 0, 0

<Pointxyz 0,0,0

<PointPolar 20, 0, 0

<PointPolar 20, 90, 2

}

>CircleTan2Lines

{

<Color 0, 255, 0

<Type 0

<Radius 10

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 20

}


Mirror

>Mirror

{

<Axis a

[0 = x, 1 = y, 2 = z, 3 = custom]

<Type t

[0 = don't make copy , 1 = make copy]

<Point 1 = location of mirrored copy

}

This command creates a mirror copy of the selected objects.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 0, 0, 10

}

>Hemisphere

{

<Orientation 1

<Pointxyz 0, 0, 0

<Pointxyz 0, 3, 3

<Pointxyz 0, 3, -3

}

>Pointselect

{

<Pointxyz 0, 3, -3

}

>SetHandle

{

<Pointxyz 0, 0, 0

}

>Mirror

{

<Axis 2

<Pointxyz 0, 0, 10

}


PM_Size Parameter

PM_SIZE ParameterQuery and Change Parameters

PM_SIZE

Declaration: Alias PM_SIZE &H0C02

Arguments: One floating-point number representing the diameter of the pointmark

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine or set a pointmark's size.

Query Usage:

Query PM_Size, pmsize

where pmsize is a numeric variable

Change Usage:

Change PM_Size, pmsize

where pmsize is a numeric variable or expression

Compatibility: Version 14 and higher


Ent_LineTypeName Parameter

ENT_LINETYPENAME ParameterQuery and Change Parameters

ENT_LINETYPENAME

Declaration: Alias ENT_LINETYPENAME &H0106

Arguments: One string representing the name of the entity's line type.

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the entity's linetype by name.

Query Usage

Query Ent_LineTypeName, eltypename$

where eltypename$ is a string variable

Change Usage

Change Ent_LineTypeName, eltypename$

where eltypename$ is a string variable or expression

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' this should be placed at the very top of the macro

Entity 1 ' load the first entity's data

Query Ent_LineTypeName, eltypename$ ' find out the entity's linetype name

Query Ent_Layer, elayer

If elayer = 7 and eltypename$ <> "Solid" Then

Change Ent_LinetypeName, "Solid"

Else

If elayer = 8 And eltypename$ <> "Dashed" Then

Change Ent_LinetypeName, "Dashed"

End If

End If

Update 'ALWAYS Update the entity when done with Change

End


PointMark

>PointMark

{

<Type t

[1 = cross, 2 = cross+square, 3 = cross+circle, 4 = cross+circle+square, 5 = filled dot]

<Size s

<points: points to be marked

}

This command draws one or more point marks

Compatibility: All versions

Example:

Sys(36) = 1 ' set silent mode for speed

>PointMark

{

<Type 1

<Size 1

For i = 0 To 25

<Pointxyz [i, sqrt(i), 0]

Next I

}

Sys(36) = 0 ' clear silent mode when done


SY_XScale Parameter

SY_XSCALE ParameterQuery and Change Parameters

SY_XSCALE

Declaration: Alias SY_XSCALE &H0E04

Arguments: A floating-point number representing the symbol's scale factor (or the block's scale factor along its x axis).

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine the scale factor of the symbol (or x-scale factor of the block). Only blocks can be scaled independently along x, y, and z. Symbols are scaled globally along all three axes.

Query Usage:

Query SY_XScale, scalex

where scalex is a numeric variable

Change Usage:

Change SY_XScale, scalex

where scalex is a numeric variable or expression.

Compatibility: Version 14 and higher


DxfOut

>DxfOut{

<Filename "drawingname.ext"

<Type t

[0 = no, 1 = yes]
This parameter controls whether blocks in the imported drawing are retained as blocks or are exploded into individual entities.

<GridType g

[0=3D Mesh, 1=3D Polyface]
This parameter offers the option to export grid entities as a rectangular mesh or as individual polygons.

<HatchType ht

[0=hatch, 1=lines, 2=outline]
This parameter controls how hatch entities are exported.

}

This command exports the drawing to a DXF file.

Note: See DxfIn for notes on path names.

Compatibility: All versions

Example:

>DxfOut

{

<Filename "*\NewDxf.Dxf"

<Type 5
<GridType 1

<HatchType 2

}


SY_AttributeCount Parameter

SY_ATTRIBUTECOUNT ParameterQuery and Change Parameters

SY_ATTRIBUTECOUNT

Declaration: Alias SY_ATTRIBUTECOUNT &H0E0C

Arguments: An integer representing the number of Attribute entities that are contained inside the current block entity.

Accessibility: Query only

Purpose: This parameter allows the programmer to determine how many Attribute entities are inside the block. Using the parameter listed below, it is possible to iterate through all attribute entities in a block and retrieve all the attribute data.

Query Usage:

Query SY_AttributeCount, atcount

where atcount is a numeric variable

Compatibility: Version 14 and higher


FilletCorner

{

<Radius r

<NFace n

<Point 1 = corner to fillet

}

This command fillets a corner of a 3D solid.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}

>FilletCorner

{

<Radius 4

<Nface 12

<Pointxyz 10, 10, 0

}

>FilletCorner

{

<Pointxyz 0, 10, 0

}


Options

>Options

{

}

Opens the Options folder.

Compatibility: All versions


ResizingNodes

>ResizingNodes

{

}

Toggles Resizing nodes for selections on and off

Compatibility: Version 14 and higher


ShowAttributes

>ShowAttributes

{

}

Show or hide the visibility of Attribute entities (toggles off and on).

Compatibility: All versions


ShowSymbolHandles

>ShowSymbolHandles

{

}

Toggles the visibility of the symbol handles (if any) for all symbols and blocks in the drawing. (

Compatibility: Version 15 and higher


Ortho

>Ortho

{

}

Aligns selected objects with the X, Y, and Z axes if the objects are almost parallel to the axes.

Compatibility: All versions


Volume

>Volume

{

<Point 1 = object to measure

}

Calculates the volume and surface area of an object.

Surface Area result returned in Sys(655)

Volume result returned in Sys(656)

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointrel 10, 10, 10

}

>Volume

{

<Pointxyz 0, 0, 0

}


Macro Language Key Words

The following reserved keywords cannot be used as macro variable names or as labels:

ABSACOSALIAS

ANDANGLEANYKEY

AREAASCASIN

ATANCALLCHAIN

CHANGECHR$CLEAR

CLEARSTORAGECLEARSTORAGE$ CLOSE

CLSCMDLINECOLOR

COSCVSDIM

DOELSEEND

ENDIFENTITYEOF

ERREXISTEXIT

EXPFORFORMAT

GETGETATTRGETLAYERPROPS

GETSELECTGETXYGOSUB

GOTOHCOSHSIN

HTANIFINCLUDE

INPUTINSTRINT

LABELLAYERLEFT$

LENLENGTHLN

LOCATELOGLOOP

MESSAGEMID$MKS$

MODNEXTNOT

ODDONOPEN

ORPARSEPOINTVAL

POPPOINTPRECISIONPRINT

PUSHPOINTPUT PUTATTR

QUERYRESUMERETURN

RIGHT$ROUNDSCREENX

SCREENYSETLAYERPROPSSETPOINT

SETSELECTEDPOINTSSGN

SINSQRSQRT

STEPSTOPSTR

STRING$SYSSYS$

SYSEXSYSEX$TAB

TANTHENTO

TRUNCUPDATEUPDATELAYER

WCLOSEWINDOW


CALL Statement

PURPOSE:To temporarily transfer control to another DesignCAD macro.

SYNTAX:CALL macroname

EXPLANATION:This statement is used to run another DesignCAD macro, then resume the current macro on the next line after the CALL statement.

The CALL statement causes the new macro (macroname) be loaded into a separate memory space. The new macro has its own memory for variables, so it has no interaction with the variables that have been defined in the original macro. When the new macro ends, execution returns to the original macro on the next line following the CALL statement.

Differences between CALL and CHAIN:

A macro that was started by the CHAIN statement always begins at the first line in the new macro. This makes it impossible to return directly to the next line by CHAINing back to the original macro.

A macro started by the CHAIN statement has access to the same variables as the macro that was CHAINed from. A macro begun by the CALL statement has a separate memory stack for variables.

Variable data can only be transferred between the CALLed macro and the CALLing macro through the use of the SysEx() functions and the SysStr() functions.

Note:You should always specify the macro name complete with its extension.

See Also: RUN, CHAIN

COMPATIBILITY:Version 14 and later

EXAMPLES:

Call MACNAME$

Call "TEST1.D3M"


A_Prompt Parameter

A_PROMPT ParameterQuery and Change Parameters

A_PROMPT

Declaration: Alias A_PROMPT &H0603

Arguments: A string representing the user prompt when a new block containing this attribute definition is inserted into the drawing.

Accessibility: Query/Change

Purpose: This parameter allows you to query and change the prompt string for an attribute definition that is not part of a block.

Note: If you try to change the prompt string on a constant attribute definition, the change will have no effect on the attribute definition. In such a case, you must first remove the Constant parameter, update the entity, and then change the prompt string as desired.

Query Usage:

Query A_Prompt, aprompt$

where aprompt$ is a string variable

Change Usage:

Change A_Prompt, aprompt$

where aprompt$ is a string variable or expression

Compatibility: Version 14 and higher


SelectPrevious

>SelectPrevious

{

}

Re-selects the previously selected object(s)

Compatibility: All versions


POPPOINT Statement

PURPOSE:Remove a point from the point buffer.

SYNTAX:POPPOINT expression

EXPLANATION:This statement removes the nth indexed point from the point buffer.

See Also: PUSHPOINT

COMPATIBILITY:Version 14 and later

EXAMPLE:

SetPoint "Input up to 10 points: ", 10

If Sys(1) > 3 Then

For i = Sys(1) To 4 Step -1

PopPoint i 'remove all but first three points from buffer

Next i

' compare points 2 and 3. Delete point 3 if to the left of or below 2.

PointVal x2, y2, z2, 2

PointVal x3, y3, z3, 3

If (x3 < x2) Or (y3 < y2) Then

PopPoint 3

PushPoint x2+1, y2+1, z3

End If

>Line

{

<UsePresetPoints

}

End If


SysEx$ Function

The SysEx$ functions are string variables that are stored in text files and are therefore remembered between DesignCAD sessions. There are 10,000 strings available: SysEx$(1) – SysEx$(10000). The variables are stored in files of 100 each, as follows:

SysStr_001.ini stores SysEx$(1) – SysEx$(100).
SysStr_002.ini stores SysEx$(101) – SysEx$(200)
etc. through
SysStr_100.ini stores SysEx$(9901 – SysEx$(10000)

All SysStr ini files can be cleared by running the ClearStorage$ statement with no arguments.

An individual SysStr ini file can be cleared by running ClearStorage$ n, where n is the number in the ini file's name. For example,
ClearStorage$ 100
clears SysStr_100.ini, thereby clearing all values from SysEx$(9901) – SysEx$(10000).


T_FontType Parameter

T_FONTTYPE ParameterQuery and Change Parameters

T_FONTTYPE

Declaration: Alias T_FONTTYPE &H0507

Arguments: One number (integer [0, 1]) representing the type of font used for this text entity.

Values: 0 = TrueType, 1 = Vector

Accessibility: Query Only

Purpose: This parameter allows you to determine the type of font used to display the text.

Query Usage:

Query T_FontType, tftype

where tftype is a numeric variable

Compatibility: Version 14 and higher


Sketch

>Sketch

{

}

Draws a line using the sketch tool.

Compatibility: All versions


CustomColor

>CustomColor

{

<Color r, g, b

}

Opens the Custom Color window.

Compatibility: All versions


FOR and NEXT Statements

PURPOSE:To execute a section of the macro a certain number of times.

SYNTAX:FOR variable = expression1 TO expression2 {STEP expression3}

.

.

.

NEXT variable

EXPLANATION:"Variable" is used as the counter. "Expression1" is the initial value of the counter variable. "Expression2" is the test or final value of the counter. The optional STEP "expression3" can be used to specify the amount that the counter is incremented (or decremented) each pass. The default increment is 1.

The macro statements after the FOR statement and before the NEXT statement are called the loop. Each time the loop is executed, the counter is incremented (or decremented, if expression3 is a negative value). If it is greater than the test value, the loop is exited and the macro branches to the line following the NEXT statement. (If "expression3" is negative, then the loop is exited when the counter is less than the test value.)

FOR loops can be nested, that is, one FOR loop can be placed inside another. The FOR loops can be nested up to 20 levels deep.

See Also: EXIT FOR

COMPATIBILITY:All versions

EXAMPLES:

For j = 1 To 4'output: 1.00

Print j'2.00

Next j'3.00

'4.00

For j = 4 To 1 Step -1'output: 4.00

Print j'3.00

Next j'2.00

'1.00

For j = 1 To 2'output: 1.000 1.000

For k = 1 To 3'1.000 2.000

Print j, k'1.000 3.000

Next k'loop 1

Print "loop ", i'2.000 1.000

Next j'2.000 2.000

'2.000 3.000

'loop 2

For j = 2 To 1

Print "this will not be printed"

Next j


PUT Statement

PURPOSE:To output a record to a random access file.

SYNTAX:PUT file, recordnumber, stringexpression

EXPLANATION:This statement is used to output a record to a random access file. The record length is specified in the OPEN statement.

When the PUT statement is executed, the string (stringexpression) will be written to the file at the designated record (recordnumber).

If the string to be output is less than the record length, it will be padded with undefined characters. If the string is longer than the record length, it will be truncated.

The MKS$ and the CVS functions can be used to convert numeric values to and from eight-byte strings for file input and output.

See Also: OPEN, GET, MKS$, CVS, PRINT #

COMPATIBILITY:All versions

EXAMPLE:

Open "r", 1, "test.dat", 80

' read a name and address into the first and second 40 bytes of an 80 byte record
' then output it to record number three

Input "Enter the name: ", name$

Input "Enter the address: ", address$

i = 40 - Len(name$)

a$ = name$ + String$(i, " "), address$

Put 1, 3, a$ ' output to record three


Segment

>Segment

{

<Segment ns

no. of segments; ignored if SpecifyDistance is not 0

<SpecifyDistance sd

[0-no (default), 1=yes

<RemoveLeftovers r

[0=no, 1=yes]

<SetPointAndDirection sp

[0=no, 1=yes]

<Points

Point 1 – specifies the line to be segmented, and if SetPointAndDirection is 1, also specifies an exact segment break

Point 2 – optional; if SetPointAndDirection is 1, this point indicates which end of the line should be segmented starting from point 1. If this point is omitted, the entire line is segmented.

}

Breaks a line into equal segments.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 10, 0, 0

<Pointxyz 30, 60, 0

}

>Segment

{

<Segment 20

<Linesnap 15, 10, 0

}


DragMoveSelectedPoints

>DragMoveSelectedPoints

{

<Point: 1 = starting location; 2 = ending location

}

This command moves the selected points of the selected entity. The points are offset by the distance and direction between the two points set.

Note: This command only works while in PointSelect Mode with at least one object selected and at least one point highlighted for editing.

Compatibility: Version 13 and higher

Example:

retry:

Message "Select an object on the screen"

SetPoint "Set a point on an object", 1

PointVal x y z 1

>PointSelect

{

<Type 0

<Pointxyz [x, y, z]

}

If Sys(80) < 1 Then Goto retry

If Not Sys(345) Then

>PointSelectMode

{

}

End If

Message "Select some points on the object."

retry2:

Sys(41) = 2 'show a rubberband box

SetPoint "Set 2 points for a box...", 2

If Sys(1) < 2 Then Goto retry 2

>DragSelect

{

PointVal x, y, z, 1 'use 1st point

<Pointxyz [x, y, z]

PointVal x, y, z, 2 'use 2nd point

<Pointxyz [x, y, z]

}

SetSelectedPoints

If Sys(1) < 1 Then

Message "None selected. Try again..."

Goto retry2

End If

Message "Moving the selected points..."

PointVal x y z 1

>DragMoveSelectedPoints

{

<Pointxyz [x, y, z]

<PointRel 5, 5, 0

}


SavePSTemplate

>SavePSTemplate

{

<Filename "filename.tps"

{

Saves the current paper space template to a template file (*.tps). This command only works while in Paper Space mode.

Compatibility: All versions


SurfaceConnect

>SurfaceConnect

{

<NBreak b

number of breaks between connected lines

<NSurf s

number of breaks along each selected line

<Type t

[0 = line, 1 = curve, 2 = smooth]

<UseOriginalPoints uo – new to 17.1

[0 = no, 1 = yes] – overrides the NSurf setting if yes

<OriginalPointOrder po – new to 17.1

[0 = no, 1 = yes] – if set to 1, connects points sequentially from the first point in each line (Gives the same result regardless of where each line was selected.)

<Points: 1-n = lines to connect

}

Connects two or more lines or curves with a surface grid.

Compatibility: All versions. UseOriginalPoints and OriginalPointOrder parameters only exist in Version 17.1 and higher.

Example:

>Curve

{

<PointXYZ 0.0000, 0.0000, 0.0000

<PointXYZ 14.0000, 4.0000, 0.0000

<PointXYZ 28.0000, -2.0000, 0.0000

<Type 0

}

>Curve

{

<PointXYZ 0.0000, 0.0000, 40.0000

<PointXYZ 14.0000, 7.0000, 40.0000

<PointXYZ 28.0000, 0.0000, 40.0000

<Type 0

}

>SurfaceConnect

{

<PointXYZ 14.0000, 4.0000, 0.0000

<PointXYZ 14.0000, 10.0000, 20.0000

<PointXYZ 14.0000, 7.0000, 40.0000

<Type 2

<NSurf 20

<NBreak 10

}


PurgeBlocks

>PurgeBlocks

{

}

Deletes unused blocks from the drawing.

Compatibility: Version 13 and higher


What's New

Several new commands and features were added to the macro language in versions 14 through 17. Here are the highlights:

New command line invocation of macros and programs (new in Version 14)

New Hexadecimal notation (new in Version 14)

New and Changed Macro Language Statements:

BREAK-> New in 15
CALL New in 14
CHANGE New in 14
CLEARSTORAGE New in 14
CLEARSTORAGE$ New in 14
CMDLINE New in 14
FORMAT New in 14
GETLAYERPROPS New in 14
INPUT
MESSAGE
PARSE New in 14
POPPOINT New in 14
PUSHPOINT New in 14
QUERY New in 14
SETLAYERPROPS New in 14
SETPOINT
UPDATE New in 14
UPDATELAYER New in 14

New QUERY/CHANGE Parameter

New Sys Functions

New Sys$ Functions

SysEx() Functions New in 14

SysEx$() Functions New in 14

New Macro Parameters

New and Changed Macro Commands:

Macro Commands Added or Changed in Version 14:

Array Changed

AttribNormalDisplay New

ChangePSTemplateProperties New

CloseAll New

DeSelect New

Door New

DoubleLineBar New

FileBackup New

FillWideLine New

GetEntity New

LockX New

LockY New

LockZ New

Midpoint2 New

PlotSort New

PolygonSelection New

PresetPointMode New

PrintCurrentView New

ResizingNodes New

RestoreDCADTile New

RestoreDefaultMenu New

Rotate Changed

RunX New

SaveAs Changed

SaveCopy New

SaveCustomKeys New

Segment Changed

SelectDuplicateToLayer New

SetShadeStyle New

Split New

Split2 New

TruncatedCone New

Window New

Macro Commands Added or Changed in Version 15:

Arc4 Changed

Attribute Changed

Dimension Changed

Ellipsoid New

Extrude Changed

ExtrudeAlongCurve New

HatchPosition New

HideRestoreToolbars New

RemoveDrawingHandles New

RoundCylinder New

SaveAsSymbol New

SelectSlant New

SendAllFiles New

SendCurrentFile New

SetHandle Changed

ShowDrawingHandles New

ShowSymbolHandles New

TrimDouble Changed

UnitsOfMeasurement New

Macro Commands Added or Changed in Version 16:

ConvertToMultiline New

DoEntitySelection New

HatchFill Changed

MultilineMode New

MultiLineStyleEditor New

SelectAddPoint New

Macro Commands Added or Changed in Version 17:

AddLayerToGroup New

ArrangeEntitiesByID New in 17.1

ArrangeEntitiesByLayerOrder New in 17.1

CircleTanLine New

CreateLayerGroup New

DeleteLayerGroup New

DeleteLayerFromGroup New

Perimeter New

RecursiveGroupExplode New

SectionTrim New

UserDefinedViewsEditor New


EA_Axis1 Parameter

EA_AXIS1 ParameterQuery and Change Parameters

EA_AXIS1

Declaration: Alias EA_AXIS1 &H0409

Arguments: Three floating-point numbers representing the coordinate of the end of the first axis (not necessarily the longest axis).

Accessibility: Query only

Purpose: This parameter allows you to determine the endpoint of the first axis of the elliptical arc (the axis from which the starting angle is measured). To change this value, you must change the first radius using EA_RADIUS1.

Query Usage:

Query EA_Axis1, x1, y1, z1

where x1, y1, and z1 are all numeric variables.

Compatibility: Version 14 and higher


WmfOut

>WmfOut

{

<Filename "filename.wmf"

}

Exports the current drawing in WMF format.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 25, 12, 15

}

>FitToWindow

{

}

>WmfOut

{

<Filename "*\test.wmf"

}


DragCopy

>DragCopy

{

<Point 1 = location of copy

}

This command makes a copy of the selected objects.

Note: This command differs from >Duplicate{} in that it uses only the primary selection handle. Therefore with >DragCopy{} it is not possible to make a copy and change the scale and/or orientation of the copy at the same time.

Compatibility: All versions

Example:

>2DBox

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

<Orientation 0

<Type 1

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>DragCopy

{

<Pointxyz 30, 15, 0

}


LineDistance

>LineDistance

{

<Points: 1, 2 = lines to measure

}

This command measures the shortest distance between two lines.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

>Line

{

<Pointxyz 5, 5, -5

<Pointxyz 5, 5, 5

}

>LineDistance

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 5, 5

}


CA_Center Parameter

CA_CENTER ParameterQuery and Change Parameters

CA_CENTER

Declaration: Alias CA_CENTER &H0301

Arguments: Three numbers (floating-point) for the center coordinate

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the arc's center coordinate. Changing the center does not affect the radius, or starting or ending angles, or span angle.

Query Usage:

Query CA_CENTER, cx, cy, cz
where cx, cy, and cz are all numeric variables

Query Usage:

Change CA_CENTER, cx, cy, cz
where cx, cy, and cz are all numeric variables or expressions

Compatibility: Version 14 and higher


Ent_Npts Parameter

ENT_NPTS ParameterQuery and Change Parameters

ENT_NPTS

Declaration: Alias ENT_NPTS &H010D

Arguments: One number (integer) indicating how many points are in the entity

Accessibility: Query only

Purpose: This parameter allows you to query how many points are in the entity. The Query result is the same as Sys(99)

Query Usage:

Query Ent_Npts, epoints

where epoints is a numeric variable

Compatibility: Version 14 and higher


Close

>Close

{

<SaveChanges s

[0 = no, 1 = yes]

<FileName "Filename"

If a specific filename is given in quotes, the file will be saved with that name. An empty string "" saves the file under its current name. A question mark in quotes "?" will close the file if no changes have been made, or open the "Save Changes?" dialog box if the drawing has changed.

}

Closes the currently active drawing.

Note: If you close all open drawings, the only command that will work reliably immediately thereafter is >New{}. Most macro language commands require an open drawing to function. Therefore, you should use >Close{} with caution. You can check the value of Sys(211) to see how many drawing files are open. If it is only 1, you should either not use Close, or if you use it, follow it IMMEDIATELY with New.

Compatibility: All versions

Example:

>Sphere

{

<Orientation 2

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>CircularArray

{

<Angle 1800

<Axis 1

<Ncopy 26

<Offset 120

<Pointxyz -5, 0, 0

}

>Close

{

<SaveChanges 1

<FileName "*\mysave.dcd"

}

>New

{

}


CrossSection

>CrossSection

{

<Axis a:
[0 = Custom Plane, 1 = ZY(fixed X), 2=XZ (fixed Y),

3 = XY (fixed Z)]

<SelectOnly s

0=draw cross section through all solids, 1=draw cross section through selected solids only

<Points: 1 [, 2, 3]

}

Draws a cross section of the selected solids, or opionally all solids in the drawing, that intersect with the selected plane. If Axis = Custom Plane, points 1-3 define the plane for the cross section. The resulting cross sections are plane entities.

Compatibility: Version 13 and higher

Example:

>Cylinder

{

<Color 128, 128, 128
<NFace 20

<Orientation 0

<Pointxyz 0, 0, 0

<Pointrel 0, 5, 0

<Pointrel 15, 0, 0

}

>CrossSection

{

<Layer 3
<Color 128, 255, 255
<Axis 1 ' constant x (zy plane)
<Pointxyz 1, 0, 0

<SelectOnly 0

}


ConvertToMultiLine

>ConvertToMultiLine

{

}

Converts the selected entities to multiline entities.

Compatibility: Version 16 and higher


CopyBitmap

>CopyBitmap{

<Points: 1 = first corner of region, 2 = opposite corner of region copied

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

}

Copies only raster data (pixel for pixel) from the drawing screen to the clipboard.

Note: If you set no points at all, the entire view window is copied to the clipboard. If you specify the first point and the <Incomplete parameter, the user can set the other corner of the region. If you specify only the <Incomplete parameter, the user can set both corners of the region to be copied.

Compatibility: All versions


FORMAT Statement

PURPOSE:To generate a text string according to a specified pattern using variables for portions of the string.

SYNTAX:FORMAT out$, fmt$ [,var1, var2, var3, …]

EXPLANATION:This statement is used to format a text string according to a specified pattern which uses placeholders for numeric and string variables. Out$ is the string variable that is to hold the generated string. Fmt$ is the string that specifies the pattern. Var1, var2, etc. are string and numeric variables. They must appear in the same order as the format specifiers in the format string. If more format specifiers are used than variables, the unmatched format specifiers are ignored and converted as plain text.

You may purposely display a format specifier verbatim by preceding it with a % mark – ex. %%10d will be converted to "%10d" in the output string.

If you are familiar with the sprintf() function of C, you should immediately grasp how to use this command.

Format specifiers:
%[-][n]s formats a string variable.
If the optional length specifier n is present, the resulting field will contain at least n characters. If the string variable is shorter than n characters, the string will be right-justified, and the remaining characters will be padded with spaces to the left of the string. If the string is longer than n characters, the entire string will be included, and no padding will occur. If the optional minus sign is present along with the length specifier n, the field will be left-justified with added spaces on the right instead of on the left.

%[-][0][n]d formats an integer variable.
If the optional length specifier n is present, the resulting field will contain at least n decimal digits. If the integer is shorter than n digits, the number will be right-justified and any remaining digits will be filled in with spaces to the left of the number. If the optional 0 is present, the remaining digits will be filled in with leading zeros instead of spaces. If the optional minus sign is present, the number will be left-justified (and the optional 0 will be ignored if present).

%[-][0][n]u formats an unsigned integer variable. (Negative integers will be converted to their twos-complement form and presented as positive integers)
If the optional length specifier n is present, the resulting field will contain at least n decimal digits. If the integer is shorter than n digits, the number will be right justified, and any remaining digits will be filled in with spaces to the left of the number. If the optional 0 is present, the remaining digits will be filled in with leading zeros instead of spaces. If the optional minus sign is present, the number will be left-justified, and any remaining digits will be padded with spaces on the right instead of on the left.

%[-][0][n]o formats an integer variable into octal form.
If the optional length specifier n is present, the resulting field will contain at least n octal digits. If the integer is shorter than n digits, the remaining digits will be filled in with spaces to the left of the number. If the optional 0 is present, the remaining digits will be filled in with leading zeros instead of spaces. If the optional minus sign is present, the number will be padded with spaces on the right instead of on the left.

%[-][0][n]x formats an integer variable into hexadecimal form.
If the optional length specifier n is present, the resulting field will contain at least n hexadecimal digits. If the integer is shorter than n digits, the remaining digits will be filled in with spaces to the left of the number. If the optional 0 is present, the remaining digits will be filled in with leading zeros instead of spaces. If the optional minus sign is present, the number will be padded with spaces on the right instead of on the left.

%[-][x.y]f formats a floating-point variable.
The default format displays six digits after the decimal character. If the optional width x.y is specified, the number will be formatted with y digits after the decimal point and a width of at least x digits (including the decimal character). If the optional minus sign is included, the number will be padded to the left. Regardless of the width specifier x, the complete integer portion of the number will always be displayed. If the fractional width specifier y is absent, the default number of fractional digits is 6.

See Also: PARSE

COMPATIBILITY:All versions

EXAMPLES:

fmt$ = "This is an integer: %d"

Format out$, fmt$, 12

Message out$

' out$ = "This is an integer: 12"

fmt$ = "float 2.5: (%2.5f) float 10.2: (%10.2f) " + Chr$(13) + _

"decimal left-justified 10 wide (%-10d) " + Chr$(13) + _

"decimal right-zero-padded 10 wide (%010d) " + Chr$(13) + _

"unused (%10d) (no variable)"

x1 = 12345.1234567

y1 = 1234567

Format out$, fmt$, x1, x1, y1, y1

Message out$

' out$ = "float 2.5 (12345.12345) float 10.2 ( 12345.12)
' decimal left-justified 10 wide (12 )
' decimal right-zero-padded 10 wide (0001234567)
' unused (%10d) (no variable)"
'Note that the first floating point number is wider than two
'digits, but that exactly five decimal digits are still shown.

' Get three points from the user then display their values
Dim X(3), Y(3), Z(3)

Get3:

SetPoint "Set three points: ", 3
If Sys(1) < 3 Then Goto Get3

For i = 1 to 3
PointVal X(i), Y(i), Z(i), i
Next i

xyz$ = "Point %d:" + Chr$(13) + "x: %-20.5f" + Chr$(13) + _
"y: %-20.5f" + Chr$(13) + "z: %-20.5f"

For i = 1 To 3

Format point$, xyz$, i, x(i), y(i), z(i)

Message point$

Next i


ErasePresetPoint

>ErasePresetPoint

{

}

This command erases the last point in the point buffer.

Compatibility: All versions

Example: Preset some points, then erase the last one.

Sys(1) = 0
>PresetPoint
{
<Pointxyz 10, 0, 0

<PointRel 10, 0, 0
<PointRel 0, 20, 0
<PointRel -10, 0, 0
<PointRel 0, -30, 0
}

' Changed my mind -- I don't like the last point
>ErasePresetPoint
{

}


AW_Type Parameter

AW_TYPE ParameterQuery and Change Parameters

AW_TYPE

Declaration: Alias AW_TYPE &H0901

Arguments: A numeric value (integer [0 - 13]) indicating the arrowhead type.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine or change an arrow entity's arrowhead type.

Query Usage:

Query AW_Type, artype

where artype is a numeric variable.

Change Usage:

Change AW_Type, artype

where artype can be a numeric variable or expression.

Compatibility: Version 14 and higher


AW_DOUBLE Parameter

AW_DOUBLE ParameterQuery and Change Parameters

AW_DOUBLE

Declaration: Alias AW_DOUBLE &H0904

Arguments: One numeric value (integer [0, 1]) indicating whether the arrow is double-headed or not.
Values: 0 = single-headed, 1 = double-headed

Accessibility: Query/Change

Purpose: This parameter can be used to determine or change whether the arrow has one arrowhead or two.

Query Usage:

Query AW_Double, adouble

where adouble is a numeric variable.

Change Usage:

Change AW_Double, adouble

where adouble can be a numeric variable or expression.


Hammer

>Hammer

{

<Radius r

<Type t

[0 = round hammer, 1 = pointed hammer]

<Fix fx

[0 = hammered surface fixed to grid edges, 1 = free edges]

<Points 1 = strike point, 2 = depth of strike

}

This command makes a dent in a grid surface.

Note:This command will only operate in 3D mode

Compatibility: All versions

Example:

'Hammer does not operate in 2D Mode, so

'If 2D Drafting Mode, return to 3D mode

If Sys(344) Then

>2DMode

{

}

End If

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

}

>Line

{

<Pointxyz 20, 0, 0

<Pointxyz 10, 15, 0

}

>Line

{

<Pointxyz 10, 15, 0

<Pointxyz 0, 0, 0

}

>Patch

{

<Nplane 20, 20

<Pointxyz 10, 0, 0

<Pointxyz 15, 7.5, 0

<Pointxyz 5, 7.5, 0

}

>Hammer

{

<Type 0

<Radius 8

<Fix 1

<Pointxyz 10, 7.5, 0

<Pointxyz 10, 7.0, 6

}


Line Break Character

You may break up long lines of code using the underscore character '_'. When the underscore is the last character on a line, and is preceded by at least one space, it indicates to DesignCAD that the line of code is continued on the following line. If the underscore character is inside a quoted string, it will be ignored.

The overall length of the combined lines may not exceed 255 characters; however, any white space at the beginning or end of the lines does not count toward the 255 character limit.

Examples:

' broken line of code

x = 2*_pi_*r^2 _

+ 128*(z - 32*deltaX1 + 13.5*deltaY2) _

+ 15*sqrt(z^2 + deltaX1*z + deltaX1^2)

' unbroken line -- the character is in a quoted string.

myStr$ = "This is not _ a broken line of code"

' broken line of code -- breaks up long quoted strings.

myStr$ = "This is a " _
+ "broken line of code"


EA_StartAngle Parameter

EA_STARTANGLE ParameterQuery and Change Parameters

EA_STARTANGLE

Declaration: Alias EA_STARTANGLE &H0404

Arguments: One floating-point number representing the starting angle of the ellipse or elliptical arc, relative to the first axis.

Accessibility: Query/Change

Purpose: This parameter allows you to query and change the starting angle of the elliptical arc. Changing this value will shift the End Angle by an equal amount, but will not affect the Span Angle.

Query Usage:

Query EA_StartAngle, estart

where estart is a numeric variable

Change Usage:

Change EA_StartAngle, estart

where estart can be a numeric variable or expression

Compatibility: Version 14 and higher


DL_Fill Parameter

DL_FILL ParameterQuery and Change Parameters

DL_FILL

Declaration: Alias DL_FILL &H0204

Arguments: One number (integer [0, 1]) which represents the doubleline entity's fill flag.

Values: 0 = unfilled, 1 = filled.

Accessibility: Query/Change

Purpose: To examine or change the doubleline entity's fill setting.

Query Usage:

Query DL_FILL, edlfill

where edlfill is a numeric variable

Change Usage:

Change DL_FILL, edlfill

where edlfill is a numeric variable or expression that evaluates to 0 or 1

Compatibility: Version 14 and higher


Torus

>Torus

{

<Orientation o

[0 = vertex, 1 = midpoint]

<Latitude l

number of segments around the torus' outer perimeter (looking "down")

<Latitude m

number of facets around the tube's inner cross-section (looking "through")

<Points: 1 = central axis, 2=central radius, 3=radius of tube

}

Draws a donut shape.

Compatibility: All versions

Example:

>Torus

{

<Pointxyz 25, 0, 0

<Pointxyz 0, 0, 0

<Pointxyz 0, 5, 0

<Orientation 0

<Longitude 8

<Latitude 36

<Color 128, 128, 152

}


ExtrudeAlongCurve

>ExtrudeAlongCurve

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Scale 0, sfixed

The ending scale factor for fixed scale extrusion. There is no need to specify this scale for a varying scale extrusion; it is always 1.0.

<Scale 1, sf1

Scale factors 1 through n are only used for varying scale extrusion. Scale factor 1 applies at the SECOND point, factor 2 at the THIRD, etc.

<Scale 2, sf2

<Scale 3, sf3

<Scale n, sfn

<Type t

[0 = fixed scale, 1 = varying scale]

<Orientation o

[0=original -- the orientation of the original copy is retained for all subsequent copies.
1=Forward -- each copy shifts its orientation so that an arrow from handles 1-2 points along the direction of the curve, and an arrow from points 1-3 points "upward" from the plane of the curve
2=Reverse -- each copy shifts its orientation so that an arrow from handles 1-2 points in the opposite direction of the curve
3=Left -- each copy shifts orientation so that an arrow from handles 1-2 points to the left of the direction of travel along the curve
4=Right -- each copy shifts orientation so that an arrow from handles 1-2 points the right of the direction of travel along the curve
5=Perpendicular -- mimics the behavior of the Perpendicular flag in older versions of DesignCAD]
If this parameter is present, it overrides the Perpendicular parameter (and only applies if AlongCurve is set to 1)

<Points: 1 = reference, 2 = first distance, 3 = 2nd distance, ...

}

This command creates a surface by extruding a profile along a curve.

Compatibility: Version 15 and higher


SetGridCenter

>SetGridCenter

{

<Point 1 = new center for display grid

}

Sets a new location for the center of the display grid (and the snap grid, if Sys(1016) is set to 1)

Example: Make the snap and display grid align with the left and bottom edges of a box.

Sys(1016) = 1 ' synchronize grids

>2DBox

{

<Pointxyz 2.6825, 7.1025, 0

<Pointrel 25, 10, 0

}

>SetGridCenter

{

<Pointxyz 2.6825, 7.1025, 0

}

Compatibility: All versions


BlockInsert

>BlockInsert

{

<Name n$ - name of the block definition to be inserted.

<Type t - [1=uniform scale, 0=non-uniform scale]

This parameter is useful when using SpecifyScaleOnscreen

<Scale xscale, yscale, zscale - scale factors.

If this parameter is omitted, uses SpecifyScaleOnScreen option.

<Angle a - the angle of the inserted block

If this parameter is omitted, uses SpecifyAngleOnScreen option.

<ExplodeOnCreate e - explode the block after insertion?

[0=no, 1=yes]

<SelectAfter s - Select the block after insertion?

[0=no, 1=yes]

<Incomplete i - Allows the user to finish setting points

<WaitForOK w - optionally displays the dialog box

[0=no, 1=yes]

<UseDefaultText u - Allows you to bypass the prompts for attribute text values, and use the default text automatically.

[0=no, 1=yes]

<Points: 1 = insertion point,

2 = angle (if Angle parameter omitted)

}

Inserts a new copy of an existing block into the drawing.

Compatibility: Version 13 and higher

Example:

>BlockInsert

{

<Name "BlockOne

<Type 1 'Uniform scale

<Scale 1.0

<Angle 0

<ExplodeOnCreate 0

<SelectAfter 0

<Pointxyz 10.0, 10.0, 0.0

}


ApplyDoubleLineStyle

>ApplyDoubleLineStyle

{

<ApplyAutoTrim

if present applies AutoTrim setting

<ApplyAlignment

if present applies Alignment

<ApplyEndCaps

if present applies Endcaps

<ApplyFill

if present applies Filled setting

<ApplyWidth

if present applies current width

}

Applies the specified double line settings to the selected double-line entities. All non-double-line items are unaffected.

Note that the parameters for this command require no arguments - each applies the current setting if that parameter is present. Running this command with all parameters omitted would have no effect on the selection.

Current Double Line Width can be obtained from Sys(370), CapStyle from Sys(371), AutoTrim from Sys(372), Alignment from Sys(373), and Fill from Sys(374)

Compatibility: All versions

Example: Apply the current Alignment, Width, and CapStyle to the selected double lines.

>ApplyDoubleLineStyle

{

<ApplyAlignment

<ApplyEndCaps

<ApplyWidth

}


TangentBetween

>TangentBetween

{

<Points: 1, 2 = circles tangent to the line

}

Draws a line tangent to two circles.

Compatibility: All versions

Example:

>Circle

{

<Type 0

<Pointxyz 12, 12, 0

<Pointxyz 12, 15, 0

}

>Circle

{

<Pointxyz -15, -10, 0

<Pointxyz -15, -5, 0

}

>TangentBetween

{

<Pointxyz 12, 15, 0

<Pointxyz -15, -15, 0

}


PointMove

>PointMove

{

<Points: 1=point to be moved, 2 = new location

}

This command moves any vertex to a new location.

Compatibility: All versions

Example:

>2DBox

{

<Orientation 0

<Pointxyz 0, 0, 0

<Pointxyz 30, 20, 0

}

>Pointmove

{

<Pointxyz 30, 0, 0

<Pointxyz 30, 10, 0

}


BM_Width Parameter

BM_WIDTH ParameterQuery and Change Parameters

BM_WIDTH

Declaration: Alias BM_WIDTH &H0D04

Arguments: A number representing the width, in pixels, of the original bitmap.

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine the image width.

Query Usage:

Query BM_Width, bmwidth

where bmwidth is a numeric variable

Compatibility: Version 14 and higher


DesignCAD Macro Commands

The information is given in the following format:

CommandName

>CommandName

{

<parameter [arguments, if any]

description of parameter and/or arguments

<parameter [arguments]

description

<Points used by the command [if applicable]

}

Note: additional useful information

Example:

>CommandName

{

<parameter1 35

<parameter2 23

<parameter3 "35"

<Color [red, green, blue]

<layer 1

<incomplete

}

Note:Certain macro parameters are common to almost all of the DesignCAD drawing commands. In order to save space, these common macro parameters are listed here, rather than being repeated for every command that accepts them.

The majority of the drawing commands will take these parameters:

<Color red, green, blue

red, green, and blue color components [0-255]

<Layer n

layer number [0-1000]

<Linestyle type, scale, thickness

type: [0-12] 0 = solid, 1 = dashed, etc.

scale: line type scale (affects length of dashes and gaps)

width: line thickness

The linestyle parameter only affects lines, circles, arcs, and curves. Solids and surfaces are not affected. Double Line entities are also unaffected.

Several drawing commands will also accept:

<Incomplete i [0=false, 1 = true]

Set this parameter to 1 if you have only set some (or none) of the points required for the drawing command and you want the user to set the points required to complete it. For example, if you are drawing a line, by including this parameter you can place the first several points of the line in your macro, then let the user complete the line as he wishes. For backward compatibility, omitting the value is the same as setting it to true. In other words,

<Incomplete 1

is the same as

<Incomplete

<NULL

if present, doesn't draw anything, but updates the drawing command to default to the specified parameters.

Example:

>Sphere

{

<Latitude 10

<Longitude 10

<Orientation 2

<Null

}

Doesn't draw a sphere, but presets the sphere command defaults to use 10 facets around, 10 facets top to bottom, and a polar orientation.

If Double Line Mode is active then many drawing commands will accept these parameters as well:

<Alignment n

[0=no, 1=yes]
Use this parameter to control whether the double-line entity is drawn centered on the points, left-aligned, or right-aligned.

<AutoTrim n

[0=no, 1=yes]
Use this parameter to control whether the double-line entity is drawn with AutoTrim turned on or of.

<Cap n

[0=No Caps, 1=Cap Beginning, 2=Cap End, 3=Cap Both]
Use this parameter to control whether the double-line entity is drawn centered on the points, left-aligned, or right-aligned.

<Filled n

[0=no, 1=yes]
Use this parameter to control whether the double-line entity is drawn hollow or filled.

<Width w

Use this parameter to set the double-line entity's width.

The five parameters above only take effect if Double Line Mode is active. Otherwise, they are ignored.

New Macro Parameters

<MinPoints np

Use this parameter to set the minimum number of points a drawing command will accept. If the user sets less than this number of points, and ends the command by double-clicking or pressing the Enter key, the command aborts, and draws nothing. (This only affects the commands such as Line, Curve, OrthoLine, OrthoLine2, Arrow, Hatch, and Plane, which all accept an arbitrary number of points.)

<MaxPoints mp

Use this parameter to set the maximum number of points a drawing command will accept. Once the maximum number of points has been set, the command ends automatically. (This only affects the commands such as Line, Curve, OrthoLine, OrthoLine2, Arrow, Hatch, and Plane, which all accept an arbitrary number of points.)

<CmdPrompt prmpt$

Use this parameter to temporarily replace the default command prompt with one of your own choosing. This parameter should work with any command that shows a command prompt in the status bar.

<UsePresetPoint

Use this parameter to set all the points in the point buffer for use by the drawing command.

<QuadrantSnap x, y, z

Snap to the quadrant of a circle or arc nearest the specified point. Example given above.

Example 1:

>Plane

{

<MinPoints 4 'this command requires at least 4 points

<MaxPoints 10 'this command accepts up to 10 points

<CmdPrompt "Set 2 to 8 more points to complete the plane"

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

Example 2:

Sys(1) = 0 'clear all the points (new to 13.0.007)

SetPoint "Set up to five points...", 5

' add two more points to the point buffer

>PresetPoint '(new to 13.0.007)

{

<Pointxyz 12.5, 0, 0

<Pointxyz 15, 20, 0

}

>Line

{

<Pointxyz 0, 0, 0 ' set starting point

<UsePresetPoint ' add the points from the buffer

<Pointxyz 0, 0, 0 ' close the line

}

Sys(1) = 0


TA_Radius Parameter

TA_RADIUS ParameterQuery and Change Parameters

TA_RADIUS

Declaration: Alias TA_RADIUS &H0702

Arguments: One floating-point number for the radius of the text arc (the distance from center to inside arc enclosing the text).

Accessibility: Query only

Purpose: This parameter reveals the radius of a text arc.

Query Usage:

Query TA_Radius, tr

where tr is a numeric variable

Compatibility: Version 14 and higher


EXIT DO Statement

PURPOSE:To exit a DO WHILE loop prematurely.

SYNTAX:EXIT DO

EXPLANATION:The EXIT DO statement can be used to exit a DO loop from anywhere within the loop. This makes it easy to exit a DO loop without using a label and a GOTO statement.

See Also: DO WHILE and LOOP

COMPATIBILITY:All versions

EXAMPLE:

Do While i < 1000

Anykey keycode

If keycode = 27 Then Exit Do

27 is the ASCII value for Esc

.

.

Loop


LOCATE Statement

PURPOSE:To position the cursor in a text window.

SYNTAX:LOCATE row, column

EXPLANATION:The LOCATE statement positions the cursor in the text window that was opened by the WINDOW statement. The next PRINT statement will begin at the specified row and column.

This statement has no effect if a text window is not open (it has no effect on PRINT # statements either).

See Also: WINDOW

COMPATIBILITY:All versions.

EXAMPLE:

Window 7, 40

Locate 3, 9

Print "centered in the window"

Anykey


Wall

>Wall

{

<Thick t - wall thickness

<Points: 1 = corner, 2 = opposite corner

}

Draws a rectangular section of wall.

Compatibility: All versions

Example:

>Wall

{

<Thick 0.5

<Pointxyz 0, 0, 0

<Pointxyz 35, 10, 0

}


SaveCurrentView

>SaveCurrentView

{

<Text "view name"

}

This command saves the current view angles and view distance as a named view setting in the Viewing Toolbox view list. This named view is saved along with DesignCAD's other custom settings and will continue to be available in other drawing sessions.

Note: Do not confuse this command with ViewSave, which saves the number of view windows, their sizes, the zoom factors, view angles for each view window, and other details in a separate file.

Compatibility: All versions

Example:

>SaveCurrentView

{

<Text "Custom View"

}


FillWideLine

>FillWideLine

{

}

Toggles wide line fill mode off or on.

Note:This command will not affect existing lines. It simply toggles the Fill Wide Lines setting in the Linestyle toolbox, and will affect any lines drawn after the change. DesignCAD currently allows a mix of filled and unfilled wide lines in the same drawing.

Compatibility: All versions

Example: Check to see if Fill Wide Lines is on; if not, set it.

If NOT Sys(24) Then

>FillWideLines

{

}

End If


IgesIn

>IgesIn

{

<Filename "Filename.ext"

}

This command imports an IGES file.

Note:As with HpglIn, you can use an asterisk in the filename parameter to refer to the DesignCAD directory.

Compatibility: All versions


Curve

>Curve

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Type n

[0 = spline curve, 1 = vectorized curve]

<Points: 1 = start, 2 = point on curve, 3-k points along curve

}

Draws a spline curve.

Compatibility: All versions

Example:

>Curve

{

<Color 0, 128, 255

<Layer 3

<Linestyle 5, 2, 0

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

<Pointxyz 20, 0, 0

<Pointxyz 30, 10, 0

<Incomplete

Message "Finish the curve."

}


SaveCopy

>SaveCopy

{

<SelectOnly ss

[0=save everything, 1=only save selected items]

<Save2D t

[0=no, 1=2D projection, 2=2D with hidden line removal, 3=2D hidden line with automatic cleanup]

<Filename "filename.ext"

}

Saves a copy of the current drawing under a new filename. The name of the file being edited remains unchanged.

Note: As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Compatibility: Version 15 and higher

Example:

>New

{

}

>Sphere

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Color 128, 0, 255

<Layer 3

}

>SaveAs

{

<SelectOnly 0

<Save2D 0

<Filename "*\Spheres1.dcd"

}

>Sphere

{

<Pointxyz 20, 0, 0

<Pointxyz 20, 10, 0

<Color 255, 0, 0

}

>SaveCopy

{

<SelectOnly 0

<Save2D 0

<Filename "*\spheres2.dcd"

}


SaveSelected

>SaveSelected

{

<Filename "filename.ext"

}

Saves the selected objects to a separate drawing file.

Note: The selection handles will be used as the new file's drawing handles. As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Compatibility: All versions

Example:

>SaveSelected

{

<Filename "*\myfiles\selected.dc"

}


DIM Statement

PURPOSE:To specify the size of one or more arrays.

SYNTAX:DIM variable(expression) {, variable(expression)...}

EXPLANATION:The DIM statement is used to allocate storage for arrays. An array is a single variable with several elements, addressed with a subscript in parentheses such as: A(20).

An array must be dimensioned before it is used. Any numeric expression can be used for the array size. String arrays are allowed. All arrays are one-dimensional – that is, an array can have only one subscript.

An array cannot be re-dimensioned. A DIM statement must be executed only once for a particular variable.

COMPATIBILITY:All versions

EXAMPLES:

Dim a(10)

Dim jx(200), jy(200)

Dim a$(20)

n = 15

Dim point(n)


SY_ZScale Parameter

SY_ZSCALE ParameterQuery and Change Parameters

SY_ZSCALE

Declaration: Alias SY_ZSCALE &H0E06

Arguments: A floating-point number representing the block's scale factor along its z axis.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine the z-scale factor of the block. Only blocks can be scaled independently along x, y, and z. Symbols are scaled globally along all three axes and only use the SY_XScale parameter.

Query Usage:

Query SY_ZScale, scalez

where scalez is a numeric variable

Change Usage:

Change SY_ZScale, scalez

where scalez is a numeric variable or expression.

Compatibility: Version 14 and higher


PolygonIntersect

>PolygonIntersect

{

}

Finds the common region of two or more shapes.

Compatibility: Version 13 and higher

Example: Find the intersection of two overlapping circles.

>Circle

{

<Pointxyz 20, 20, 0

<Pointxyz 30, 20, 0

}

>Circle

{

<Pointxyz 35, 20, 0

<Pointxyz 45, 20, 0

}

>PolygonIntersect

{
<Pointxyz 20, 30, 0

<Pointxyz 35, 30, 0

}


SnapSize

>SnapSize

{

}

same as GridOptions above

Compatibility: All versions


ConstructionLine

>ConstructionLine

{

<Type t:
[0 = Line, 1 = Ray]

<Points: 1 = center of construction Line, 2 = direction

}

Draws a construction line.

Compatibility: Version 13 and higher

Example:

>ConstructionLine

{

<Layer 32
<Color 255, 255, 128
<Type 0 ' line

<Pointxyz 10, 10, 0

<Pointrel 10, 0, 0 'horizontal line

}

>ConstructionLine

{

<Layer 31
<Color 128, 255, 255
<Type 1 ' ray

<Pointxyz 10, 10, 0

<Pointrel 0, 10, 0 ' vertical ray

}


PM_Center Parameter

PM_CENTER ParameterQuery and Change Parameters

PM_CENTER

Declaration: Alias PM_CENTER &H0C03

Arguments: Three floating point numbers for the x, y, and z components of the pointmark's center location.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine and/or change the center location of the pointmark entity.

Query Usage:

Query PM_Center, pmx, pmy, pmz

where pmx, pmy, and pmz are numeric variables.

Change Usage:

Change PM_Center, pmx, pmy, ,pmz

where pmx, pmy, and pmz are numeric variables or expressions.

Compatibility: Version 14 and higher

Example:

' assumes a point mark has already been drawn and selected.

Include "*\dcadalias.d3i"

Getselect 1, i

Entity i

Query PM_Type, pmtype

Query PM_Size, pmsize

Query PM_Center, pmx, pmy, pmz

fmt$ = "Type: %d size: %f Center: %f, %f, %f"

Format msg$, fmt$, pmtype, pmsize, pmx, pmy, pmz

Message msg$

Change PM_Type, (pmtype + 1 mod 5)

Change PM_Size, (pmsize/2)

Change PM_Center, pmx+1, pmy-5, pmz

Update

Regen

Query PM_Type, pmtype

Query PM_Size, pmsize

Query PM_Center, pmx, pmy, pmz

fmt$ = "Type: %d size: %f Center: %f, %f, %f"

Format msg$, fmt$, pmtype, pmsize, pmx, pmy, pmz

Message msg$

End


Extend

>Extend

{

<SelectOnly s

[0 can affect any line; 1 only will extend a selected line]

<Points: 1 = line to be extended, 2 = distance to extend the line.

}

This command extends a line.

Note: Point 1 must be near the endpoint to be extended. Point 2 does not have to lie along the original line.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0,0,0

<Pointxyz 10,10,10

}

>Pointselect

{

<Pointxyz 8,8,8

}

>Extend

{

<Pointxyz 10,10,10

<Pointxyz 15,15, 12

}


DimDiameter

>DimDiameter

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Axis y

[0 = text and arrows inside, 1 = external text and arrows; arrows connected by line, 2 = external text and single arrow, 3 = arrows inside, text outside]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = circle to measure, 2 = dimension location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>Circle

{

<Pointxyz 25, 25, 0

<Pointxyz 25,35, 0

}

>DimDiameter

{

<Size 1.5

<Type 0

<Arrowhead 4

<Format 0

<Axis 0

<Pointxyz 35, 25, 0

<Pointxyz 35, 30, 0

}


T_Angle Parameter

T_ANGLE ParameterQuery and Change Parameters

T_ANGLE

Declaration: Alias T_ANGLE &H0506

Arguments: One floating-point number representing the text angle

Accessibility: Query/Change

Purpose: This parameter allows you to query and change the text angle of the text entity. When you change the angle, the tilt is centered on the insertion point.

Query Usage:

Query T_Angle, tangle

where tangle is a numeric variable

Change Usage:

Change T_Angle, tangle

where tangle can be a numeric variable or expression.

Compatibility: Version 14 and higher


HiddenEdge

>HiddenEdge

{

<Point 1 = point on line to be hidden

}

This command hides the specified line segment.

Compatibility: All versions

Example:

>Plane

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, 20, 0

<Pointxyz 0, 20, 0

}

>Line

{

<Pointxyz 10, -5, 0

<Pointxyz 10, 25, 0

}

>Circle

{

<Type 2

<Pointxyz 10, 10, 0

<Pointxyz 10, 15, 0

}

>Circle

{

<Type 2

<Pointxyz 10, 10, 0

<Pointxyz 10, 15, 0

}

>CutPlane

{

<Pointxyz 10, -5, 0

<Pointxyz 0, 0, 0

}

>PlaneSubtract

{

<Pointxyz 10, 15, 0

<Pointxyz 0, 0, 0

}

>PlaneSubtract

{

<Pointxyz 10, 15, 0

<Pointxyz 10, 0, 0

}

>HiddenEdge

{

<Pointxyz 10, 2.5, 0

}

>HiddenEdge

{

<Pointxyz 10, 17.5, 0

}


ApplyFixedText

>ApplyFixedText

{

<Text t

}

Applies a fixed text string to the selected dimension(s). An existing fixed text string can be removed by applying an empty string.

Compatibility: All versions

Example: Apply a fixed text string to a selected dimension, then remove it.

t$ = "100.123 cm"

>ApplyFixedText

{

<Text [t$]

}

REGEN

Message "The fixed text has been applied..."

>ApplyFixedText

{

<Text ""

}

Message "The fixed text has been removed."


HideCommand

>HideCommand

{

}

Opens the Hide command dialog box for user interaction.

Compatibility: All versions


Explode

>Explode

{

}

This command explodes the selected compound object (dimensions, grids, symbols, etc.) into its component pieces.

Compatibility: All versions


GETATTR Statement

PURPOSE:To get entity type, group status, and layer of an entity.

SYNTAX:GETATTR entity, type {,select, laynum, group, red, green, blue, solid}

EXPLANATION:This statement is used to get the entity type, group status, and layer of an entity. Entity is the entity number – one for the first entity in the drawing, two for the second, etc. Type is the entity type: Possible values are:

1 = Line

2 = Ellipse

3 = 3D Text

4 = Curve

7 = Elliptical Arc

11 = Bezier Curve (4-point)

12 = Bezier Curve (Continuous)

13 = 2D Text

15 = Attribute

16 = Circle, Circular Arc

17 = Hatch

22 = Text Arc

24 = Arrow

26 = Symbol

31 = Plane

32 = Grid Header

33 = Grid Line

34 = Group

68 = Construction Line

70 = Point Mark
71 = Attribute Definition

74 = Dimension, Angle

75 = Dimension

76 = Dimension, Diameter/Radius

77 = Dimension, Arc

78 = Dimension, Radius Progressive

79 = Dimension, Progressive

80 = Dimension, Chamfer

81 = Dimension, Coordinate

90 = Bitmap Image
92 = Double Line
93 = Double Curve
94 = Double Bezier
95 = Double Circle/Arc
96 = Double Elliptical Arc
97 = Double Ellipse
119 = Multiline Text

Select is zero if the entity is not selected, or one if the entity is currently selected. Laynum is the layer number of the entity. Group is the group ID number if the entity is part of a Group, or zero otherwise. Red, green, and blue are the color components of the entity's color. Solid is the solid ID of the entity; it is zero if the entity is not part of a solid.

Type, select, laynum, group, red, green, blue, and solid must be variables, not expressions, since they will be assigned values.
Do NOT use "entity" or "layer" as variable names! Both are reserved words.

Note that symbols and blocks indicate the same entity type (26). To determine a symbol's entity type more explicitly, you must access the symbol entity's data using the Entity statement, and then check the value of Sys(296).

See Also: PUTATTR, ENTITY

COMPATIBILITY:All versions

EXAMPLE:

' Gets the total length of all lines in the drawing.

' We can't use length as a variable name because

' it's a reserved word, so we use leng. We use the
' Length() function to determine the length of each line
' entity.

leng = 0

For j = 1 To Sys(9) ' Sys(9) is the number of entities

Getattr j, type

If type = 1 Then leng = leng + Length(j)

Next j

Message "The length is ", leng


SnapToolBox

>SnapToolbox

{

}

Toggles the Snap Toolbox on or off.

Compatibility: All versions


CircularArray

>CircularArray

{

<Angle a

span angle for the array of copies

<Axis j

central axis for the array: [0 = x, 1 = y, 2 = z, 3 = 2-point, 4 = line, 5 = plane]

<Ncopy m

number of copies to create (including original)

<Offset d

total offset from first to last copy along central axis

<Perpendicular p

[0 = each copy retains the orientation of the original, 1 = rotate each copy]

<Point 1 = center of rotation for the circular array

}

Creates an array of copies of the selected objects in a circular pattern.

Compatibility: All versions

Example:

>Sphere

{

<Orientation 2

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>CircularArray

{

<Angle 1800

<Axis 1

<Ncopy 26

<Offset 120

<Pointxyz -5, 0, 0

}


Weld

>Weld

{

}

Welds the selected objects into a single group.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

<Pointxyz 20, 30, 0

<Pointxyz 10, 30, 0

<Pointxyz 10, 10, 0

}

>Circle

{

<Pointxyz 10, 10, 0

<Pointxyz 2, 10, 0

<Pointxyz 10, 15, 0

}

>PointSelect

{

<Pointxyz 10, 30, 0

}

>PointSelect

{

<Type 1

<Pointxyz 2, 10, 0

}

>Weld

{

}


ShowHide

>ShowHide

{

}

Opens the View Options folder.

Compatibility: All versions


DL_Caps Parameter

DL_CAPS ParameterQuery and Change Parameters

DL_CAPS

Declaration: Alias DL_CAPS &H0203

Arguments: One number (integer [0, 3]) which represents the doubleline entity's cap style.

Values: 0=no endcaps, 1=cap starting end, 2=cap trailing end, 3=cap both ends

Accessibility: Query/Change

Purpose: To examine or change the endcap style of the doubleline entity.

Query Usage:

Query DL_CAPS, edlcapstyle

where edlcapstyle is a numeric variable

Change Usage:

Change DL_CAPS, edlcapstyle

where edlcapstyle is a numeric variable or expression that evaluates to 0, 1, 2, or 3

Compatibility: Version 14 and higher


BlockDefine

>BlockDefine

{

<Name n$ - block definition name

<WaitForOK w - wait for user to press OK

[0=don't wait, 1=wait]

<Type t - What to do with the entities

[0=Convert to block, 1=Retain, 2=Delete]

}

Creates a new block definition from the selected entities. The primary selection handle becomes the block's insertion point.

Compatibility: Version 13 and higher

Example:

>Circle

{

<Pointxyz 18.1, 18.1, 0

<Pointxyz 18.5, 18.1, 0

}

>2DBox

{

<Pointxyz 20, 20, 0

<Pointxyz 22, 22, 0

<Type 1 'vector

<Orientation 0 'not angled

}

>PointSelect

{

<Pointxyz 18.1, 18.1, 0

<Type 0

}

>PointSelect

{

<Pointxyz 20, 20, 0

<Type 1

}

>SetHandle

{

Pointxyz 17.7, 17.7, 0}

>BlockDefine

{

<Name "BlockOne"

<Type 0 'convert to block

}


SmoothLine2

>SmoothLine2

{

}

Smoothes the selected lines by slope detection.

Compatibility: All versions


DragSelect

>DragSelect

{

Type t

[0 = select only items inside box, 1 = add items inside box to current selection, 2 = select only items inside or touched by box, 3 = add items inside or touched by box to current selection]

[for PointSelectMode, 0 = new point selection, 1 = add enclosed points, 2 = remove enclosed points, 3 = toggle status of enclosed points]

<Points: 1 = 1st corner of selection rectangle, 2 = opposite corner

}

Selects objects by drawing a rectangle around them. Alternatively, it can be used while in PointSelect mode to select multiple points in one or more selected objects.

Compatibility: All versions

Example: Select all objects within a 10 x 10 x 10 cube centered on the origin.

>SelectMode3D

{

}

>DragSelect

{

<Type 0

<Pointxyz -5, -5, -5

<Pointxyz 5, 5, 5

}

See DragMoveSelectedPoints for an example of usage with PointSelect Mode


PRECISION Statement

PURPOSE:To set the precision for PRINT statements and for numeric-to-string conversions.

SYNTAX:PRECISION expression

EXPLANATION:The PRECISION statement determines the number of digits to the right of the decimal point to be used in PRINT statements and in numeric-to-string conversions.

For example, a precision of zero can be used to print or assign only whole numbers. A precision of four can be used to print numbers to the nearest .0001.

The PRECISION statement affects only the conversion of a numeric expression to a string– it does not affect the value of a numeric variable. Also, it does not affect the numeric precision displayed in DesignCAD's coordinate bar, Info Box, or command dialogs.

The precision remains the same until it is changed again by the PRECISION statement or the macro ends.

Note that the PRECISION statement does not affect the way macro parameters interpret variables; see the last two examples below involving the Text command.

See Also: PRINT, PRINT #

COMPATIBILITY:All versions

EXAMPLE:

x = 44.123456789

Precision 0

Print x * 2' prints "88"

Precision 4

Print x' prints "44.1235"

Precision 0

x = 2

a$ = x

f$ = "file" + a$ + ".dat"

Print f$' prints "file2.dat"

Precision 3
x = 44.123456789
x$ = x
>Text
{
<Text [x$]
}

' Text drawn is "44.123"
' The string assignment was done using the current PRECISION.

>Text
{
<Text [x]
}

' Text drawn is "44.123456789"
' The numeric variable was converted to a string at full
' precision.


SolidSubtract

>SolidSubtract

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1 = solid to be removed, 2 = solid to be left behind

}

Subtracts solid 1 from solid 2

Compatibility: All versions

Example:

>Cone

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 20, 0

}

>Sphere

{

<Pointxyz 0, 20, 0

<Pointxyz 0, 25, 0

}

>SolidSub

{

<Pointxyz 5, 0, 0

<Pointxyz 0, 25, 0

}


RESUME Statement

PURPOSE:To resume macro execution after an ON ERROR unit.

SYNTAX:RESUME {label}

EXPLANATION:The RESUME statement is used to continue macro execution after an ON ERROR unit has been activated by a macro language error.

Label can be used to specify the location at which macro execution will resume. If the label is omitted, the macro execution will resume at the statement following the one that caused the error.

See Also: ON ERROR

COMPATIBILITY:All versions

EXAMPLE:

On Error Goto handler

Open "i", 1, "------" ' invalid file name

Print "No error" ' this won't be printed

cont:

Print "Macro done" ' second line printed

End

handler:

Print "Error: ", err(1) ' first line printed

Resume cont


TruncatedCone

>TruncatedCone

{

<Orientation o

[0 = vertex, 1 = midpoint]

<NFace n

<Points: 1=center of base, 2=base radius, 3=height(and direction), 4=top radius

}

Draws a truncated cone.

Compatibility: All versions

Example:

>TruncatedCone

{

<Pointxyz 10, 0, 0

<Pointxyz 0, 0, 0

<Pointxyz 0, 20, 0

<Pointxyz 5, 20, 0

}


CutoffDel

>CutoffDel

{

<Points: 1 = first corner of region, 2 = opposite corner

}

Deprecated. This command is identical to SectionDeleteCut below. SectionDeleteCut is the preferred form.

Compatibility: All versions up to 17. Version 17 remaps this command to SectionTrim .
(Version 17.1 also automatically sets the <TrimArea parameter for SectionTrim to 1. Version 17.0 simply uses the most recent setting of the TrimArea parameter for CutoffDel.)

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 25, 25, 25

}

>CutoffDel

{

<Pointxyz 15, 15, -2

<Pointxyz 26, 26, 15

}


SectionDeleteCut

>SectionDeleteCut

{

<Points: 1 = first corner of region, 2 = opposite corner

}

Deletes a rectangular section of the drawing. Same as CutOffDel above. SectionDeleteCut is the preferred usage.

Note: In version 17 and later, SectionDeleteCut is automatically mapped to the new SectionTrim command. (Version 17.1 also automatically sets the <TrimArea parameter for SectionTrim to 1. Version 17.0 simply uses the most recent setting of the TrimArea parameter for CutoffDel.)

Compatibility: All versions; deprecated for use in Version 17 and higher.


ChangePSTemplateProperties

>ChangePSTemplateProperties{

<Orientation or

[0=Portrait, 1=Landscape

<Width w

the width of the page (in paper units)

<Height h

the height of the page (in paper units)

<LeftMargin ln

the width of the left margin (in paper units)

<RightMargin rm

the width of the right margin (in paper units)

<TopMargin tm

the width of the top margin (in paper units)

<BottomMargin bm

the width of the bottom margin (in paper units)

<Name templatename$

the name of the paperspace template

<UnitsOfMeasurement units

[1=inches, 2= feet, 3=mi, 4=mm, 5=cm, 6=m, 7=km]

}

Sets/Changes the page properties properties of the current paperspace template. You must be in Paper Space Mode to activate this command.

Compatibility: Version 15 and higher

Example:

>PaperSpaceMode

{

}

>ChangePSTemplateProperties

{

<Orientation 1 'landscape

<UnitsOfMeasurement 1 'inches

<Width 11.0

<Height 8.5

<LeftMargin 0.5

<RightMargin 0.5

<TopMargin 0.25

<BottomMargin 0.25

<Name "LetterLandscapeInches"

}


Ent_MaterialName Parameter

ENT_MATERIALNAME ParameterQuery and Change Parameters

ENT_MATERIALNAME

Declaration: Alias ENT_MATERIALNAME &H0112

Arguments: One string containing the name of the entity's material.

Accessibilty: Query/Change

Purpose: This parameter allows you to query or change the entity's material by name.

Query Usage:

Query Ent_MaterialName, ematname$

where ematname$ is a string variable

Change Usage:

Change Ent_MaterialName, ematname$

where ematname$ is a string variable or expression

Compatibility: Version 14 and higher


ZoomIn

>ZoomIn

{

<Point 1 = center of zoom

}

Enlarge the current view.

Compatibility: All versions


BatchPrint

>BatchPrint

{

}

Opens the Batch Print dialog box.

Compatibility: All versions


SemiCircle

>SemiCircle

{

<Type t

[0=arc, 1=vector arc]

}

Draws a semicircle in counterclockwise direction from first to second point.

Compatibility: All versions

Example:

>SemiCircle

{

<Color 0,0,0

<Layer 1

<LineStyle 0,2.0000,0.0000

<PointXYZ 127.1498,145.6490,0.0000

<PointXYZ 155.1600,142.6791,0.0000

<PointXYZ 152.7457,150.4489,0.0000

<Type 0

}


SolidXOr

>SolidXOr

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1, 2 = solids to be exclusive-or'ed

}

Removes the overlapping portion of two solids.

Compatibility: All versions

Example:

>Cone

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 20, 0

}

>Sphere

{

<Pointxyz 0, 20, 0

<Pointxyz 0, 25, 0

}

>SolidXOr

{

<Pointxyz 5, 0, 0

<Pointxyz 0, 25, 0

}


T_Italic Parameter

T_ITALIC ParameterQuery and Change Parameters

T_ITALIC

Declaration: Alias T_ITALIC &H0505

Arguments: One number (integer [0, 1]) representing whether the text is italicized.

Values: 0 = normal, 1 = italicized

Accessibility: Query/Change

Purpose: This parameter allows you to query and change a text entity's italic state. (Italics can only be applied to TrueType fonts, not Vector fonts).

Query Usage:

Query T_Italic, tital

where tital is a numeric variable

Change Usage:

Change T_Italic, tital

where tital can be a numeric variable or expression

Compatibility: Version 14 and higher


DeleteLayerFromGroup

>DeleteLayerFromGroup

{

<LayerGroupIndex gi

<Layer layernum1

<Layer layernum2

…

<Layer layernumlast

}

Deletes the specified layer(s) from the specified layer group.

Compatibility: Version 17 and higher


AttribNormalDisplay

>AttribNormalDisplay

{

}

Has some affect on the display of attributes

Compatibility: Version 14 and higher

Example:

>AttribNormalDisplay

{

<Style 0 ' normal text

}


GetEntity

>GetEntity

{

<Point 1 = starting point to snap from

<Type T1 – first entity type to find

…

<Type Tn – last entity type to find.
Entity types are listed in the GETATTR Statement topic.

<All a – find only on editable layers? [0=yes, 1=no]

<MarkSkip ms – mark entity to be skipped after found? [0=no, 1=yes]

<SkipMark onlyms – find only among skipped entities? [0=no, 1=yes]

}

This command allows the programmer to find an entity and its section number by snap point. The entity id is returned in Sys(1040), and the section number is returned in Sys(1041).

Compatibility: Version 14 and higher

Example:

>Curve

{

<Layer 1

<LineStyle 0, 2, 0

<Pointxyz 5, 20, 0

<Pointxyz 25, 5, 0

<Pointxyz 52, 3, 0

}

>Line

{

<Layer 1

<Pointxyz 5, 20, 0

<Pointxyz 14, 40, 0

<Pointxyz 58, 36, 0

<Pointxyz 89, 0, 0

<Pointxyz 30, -11, 0

}

KeepLooking = 1

Again:

>GetEntity

{

<PointXYZ 6, 21, 0

<Type 4

<Type 1

<All 0

<MarkSkip 1

<SkipMark 1

}

If (Sys(1040) <> 0) Then

KeepLooking = 1

Entity Sys(1040)

Message Sys$(300)

Message "Segment #", Sys(1041)

Else

KeepLooking = 0

Message "No (more) entities of the correct type were found within snapping range."

End If

Do While KeepLooking = 1

Goto Again

Loop

End


TrimMultiLines

>TrimMultiLines

{

<TrimPickedSegmentsOnly [0=no, 1=yes] (V17.1)

<Points: 1 = first line to clip, 2 = next line to clip, ..., last = line to be trimmed against.

}

Trim a series of lines to their intersections with a reference line.

Compatibility: All versions. <TrimPickedSegmentsOnly is only available in 17.1 and higher.

Example:

>Line

{

<PointXYZ 0, 0, 0

<PointXYZ 28, 0, 0

}

>PointSelect

{

<PointXYZ 0, 0, 0}

}

>Array

{

<PointXYZ 0, 5, 0

<NCopy 5, 0, 0

}

>Line

{

<PointXYZ 25, -5, 0

<PointXYZ 25, 25, 0

}

>TrimMultiLines

{

<PointXYZ 0, 0, 0

<PointXYZ 0, 5, 0

<PointXYZ 0, 10, 0

<PointXYZ 0, 15, 0

<PointXYZ 0, 20, 0

<PointXYZ 25, 25, 0

}


SelectAddPoint

>SelectAddPoint

{

Point 1: Point on the entity where a point is to be added.

Point 2: The location of the new point.

}

Adds a new point to a selected line or curve, much as you can manually in Point Select Mode.

Caveats:

1) You must be in Point Select Mode to use this command effectively.

2) Point 1 must be near enough to snap to the intended segment of the line or curve; otherwise Point 1 will be inserted into the first segment of the entity and the second point ignored.

3) If Point 1 is exactly on the ENDPOINT of a given segment of the line or curve (i.e. entity point 2 for the first segment, or entity point 3 for the second segment, etc.), the new point is added to that segment. Knowing this can help avoid the problems of item 2 above. (You should perhaps avoid inserting a point at the very first point in a line or curve unless it is a closed entity.)

Compatibility: Version 16 and higher

Example:

' SelAddPt.d3m

' Test of the SelectAddPoint macro command.

' First, we'll draw a line to play with

>Line

{

<Pointxyz 10, 10, 0
<Pointxyz 30, 10, 0
<Pointxyz 30, 20, 0
<Pointxyz 10, 25, 0
<Pointxyz 10, 10, 0
}

' Next we must select the line to be modified

>PointSelect

{

<Pointxyz 10, 10, 0

}

' We also *MUST* be in Point Select Mode

If Not Sys(345) Then

>PointSelectMode

{

}

End If

' Now we use SelectAddPoint to add a point to a specific segment

' on the selected line.

' Point 1 specifies which segment is to be bent,

' Point 2 specifies the vertex of the new bend.

>SelectAddPoint

{

' Note that the first point here is EXACTLY ON the line's

' first segment.

<Pointxyz 12, 10, 0

<Pointxyz 15, 5, 0

}

' This next attempt doesn't work as you might expect!

' Basically, if the first point is too far away from the

' segment, the command adds that first point to the FIRST

' SEGMENT in the line or curve, and completely ignores the

' second point.

>SelectAddPoint

{

<Pointxyz 15, 26, 0

<Pointxyz 15, 40, 0

}

' But, wait -- there's a workaround!

' Whenever you set the first point exactly on, or close enough

' to Gravity snap to, the END point of the segment (which could

' be determined ahead of time using the Entity statement and

' reading the points into an array.
' In this case, we know the point locations and order, so we'll

' gravity to the second point we set (which is now the third

' point in the entity.

>SelectAddPoint

{

<Gravity 30, 20, 0

<Pointxyz 35, 15, 0

}

' Finally, you can JUST specify one point; if it's close enough

' to an existing segment, the point will be added to the nearest

' segment. Otherwise, the point will be added to the first

' segment of the line or curve.

>SelectAddPoint

{

<Pointxyz 10, 17.5, 0

}

End


Origin

>Origin

{

<point 1 = new origin

}

Moves the origin of the drawing to the specified location.

Compatibility: All versions


ColorToolBox

>ColorToolbox

{

}

Toggles the visibility of the Color Toolbox.

Compatibility: All versions


FileBackup

>FileBackup

{

}

This command toggles DesignCAD's automatic save of backup file versions. See also Sys(1008).

Compatibility: Version 15 and higher

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, 20, 0

}

>Fillet

{

<Type 0

<Radius 2

<Pointxyz 10, 0, 0

<Pointxyz 20, 10, 0

}


DL_Trim Parameter

DL_TRIM ParameterQuery and Change Parameters

DL_TRIM

Declaration: Alias DL_TRIM &H0201

Arguments: One number (integer [0, 1]) representing the doubleline entity's trim setting

Values: 0 = untrimmed, 1 = trimmed

Accessibility: Query/Change

Purpose: Allows you to Query or Change the entity's doubleline trim setting.

Query Usage:

Query DL_TRIM, edltrim

where edltrim is a numeric variable to hold the trim setting for the entity.

Change Usage:

Change DL_TRIM, edltrim

where edltrim is a numeric variable or expression that evaluates to 0 or 1

Compatibility: Version 14 and higher


DL_HatchName Parameter

DL_HATCHNAME ParameterQuery and Change Parameters

DL_HATCHNAME

Declaration: Alias DL_HATCHNAME &H0207

Arguments: One string that represents the name of the fill pattern used by the double-line entity.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the fill pattern name for the doubleline entity.

Query Usage:

Query DL_HATCHNAME, edlhatchname$

where edlhatchname$ is a string variable

Change Usage:

Change DL_HATCHNAME, edlhatchname$

where edlhatchname$ is a string expression or variable.

Compatibility: Version 14 and higher


SelectScaleOrtho

>SelectScaleOrtho

{

<Zoomfactor f

}

Enlarges or reduces the selected objects.

Compatibility: All versions

Example:

>Sphere

{

<Pointxyz 10, 10, 0

<Pointxyz 10, 0, 0

}

>PointSelect

{

<Pointxyz 10, 0, 0

}

>SelectScaleOrtho

{

<ZoomFactor 1.5

}


UPDATELAYER Statement

PURPOSE:To update all entities in a layer to match the layer's settings.

SYNTAX:UPDATELAYER [laynum]

EXPLANATION:This statement forces DesignCAD to all entities in a layer to match the layer's settings. If laynum is not specified, all entities in the drawing are updated to match their host layer.

See Also: SETLAYERPROPS, GETLAYERPROPS

COMPATIBILITY:Version 14 and later

EXAMPLE:

Entity 1

Change ENT_POINT, 1, 0, 0, 0

Update

RegenerateAll

{

}


Cylinder

>Cylinder

{

<Nface m

number of faces [3-100]

<Orientation o

[0 = point 2 on vertex, 1 = point 2 on midpoint of a side]

<Points: 1 = center of base, 2 = radius of base, 3 = height of cylinder

}

Draws a cylinder.

Compatibility: All versions

Example:

>Cylinder

{

<Orientation 1

<Nface 20

<Pointxyz 10, 10, 0

<Pointxyz 10, 10, 10

<Pointxyz 40, 10, 0

}


SolidDefine

>SolidDefine

{

}

Defines the selected entities as a solid.

Compatibility: All versions


Redraw

>Redraw

{

}

Refreshes the active view image.

Compatibility: All versions


SaveBMP

>SaveBmp

{

<Filename "filename.ext"

<Points: 1 = 1st corner of rectangular region, 2 = opposite corner.

}

Saves a bitmap image of all or part of the view.

Note: As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Note on Points: If no points are set, and <Incomplete is not specified, the entire view will be saved as a bitmap.

Compatibility: All versions

Example:

>Sphere

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

>Shade

{

}

>SaveBmp

{

<Filename "*sphere.jpg"

}


D_TruncateZeros Parameter

D_TRUNCATEZEROS ParameterQuery and Change Parameters

D_TRUNCATEZEROS

Declaration: Alias D_TRUNCATEZEROS &H0A0A

Arguments: A number (integer [0, 1]) indicating whether the dimension truncates trailing zeros from the displayed value.

Values: 0 = false (no truncation occurs), 1 = true (trailing zeros removed)

Accessibility: Query/Change

Purpose: This parameter allows you to determine or specifiy whether a dimension displays trailing zeros or not.

Query Usage:

Query D_TruncateZeros, dtrunc

where dtrunc is a numeric variable

Change Usage:

Change D_TruncateZeros, dtrunc

where dtrunc is a numeric variable or expression

Compatibility: Version 14 and higher


CA_Direction Parameter

CA_DIRECTION ParameterQuery and Change Parameters

CA_DIRECTION

Declaration: Alias CA_DIRECTION &H0306

Arguments: One number (integer [-1, 1]) for the arc's direction

Values: -1 = clockwise, 1 = counterclockwise.

Accessibility: Query only

Purpose: This parameter allows you to query the direction of an arc.

Query Usage:

Query CA_Direction, cdir
where cdir is a numeric variable

Compatibility: Version 14 and higher


LockX

>LockX

{

<LockCoordinate k

[0=unlocked, 1=locked]

<Point with the x-value to be locked. This point is ignored if LockCoordinate is set to 0

}

This command either locks or unlocks the cursor to set points at constant X. The cursor may move freely while the coordinate is locked, but all points will shift to the locked X value.

Note: Any Locked coordinate can by unlocked by any other Lock command that sets LockCoordinate to 0. Also, switching from locked X to locked Y or Z does not require an intermediate unlock operation.

Compatibility: Version 13 and higher

Example:

>LockX

{

<LockCoordinate 1

<Pointxyz 15, 0, 0

}

Message "X is now locked at 15. Set points for a line and press Enter when done..."

>Line
{
}

>LockX
{
<LockCoordinate 0
}

Message "X is unlocked. Set points for a line and press Enter when done..."

>Line
{
}


LockY

>LockY

{

<LockCoordinate k

[0=no, 1=yes]

<Point with the y-value to be locked. This point is ignored if LockCoordinate is set to 0

}

This command either locks or unlocks the cursor to set points at constant Y. The cursor may move freely while the coordinate is locked, but all points will shift to the locked Y value.

Note: Any Locked coordinate can by unlocked by any other Lock command that sets LockCoordinate to 0. Also, switching from locked X to locked Y or Z does not require an intermediate unlock operation.

Compatibility: Version 13 and higher

Example:

Message "Locking X to 10"

>LockX

{

<LockCoordinate 1

<Pointxyz 10, 0, 0

}

>Line

{

}

>LockX

{

<LockCoordinate 0

<Pointxyz 20, 0, 0

}

Message "Free motion..."

>Line

{

}

Message "Locking Y at 15"

>LockY

{

<LockCoordinate 1

<Pointxyz 20, 15, 30

}

>Line

{

}

Message "Locking Z at 5"

>LockZ

{

<LockCoordinate 1

<Pointxyz 10, 15, 5

}

>Circle

{

}

Message "Freedom Rings"

>LockX

{

<LockCoordinate 0

}

>Line

{

}


LockZ

>LockZ

{

<LockCoordinate k

[0=no, 1=yes]

<Point with the z-value to be locked. This point is ignored if LockCoordinate is set to 0

}

This command either locks or unlocks the cursor to set points at constant Z. The cursor may move freely while the coordinate is locked, but all points will shift to the locked Z value.

Note: Any Locked coordinate can by unlocked by any other Lock command that sets LockCoordinate to 0. Also, switching from locked X to locked Y or Z does not require an intermediate unlock operation.

Compatibility: Version 13 and higher

Example:

Message "Locking X to 10"

>LockX

{

<LockCoordinate 1

<Pointxyz 10, 0, 0

}

>Line

{

}

>LockX

{

<LockCoordinate 0

<Pointxyz 20, 0, 0

}

Message "Free motion..."

>Line

{

}

Message "Locking Y at 15"

>LockY

{

<LockCoordinate 1

<Pointxyz 20, 15, 30

}

>Line

{

}

Message "Locking Z at 5"

>LockZ

{

<LockCoordinate 1

<Pointxyz 10, 15, 5

}

>Circle

{

}

Message "Freedom Rings"

>LockX

{

<LockCoordinate 0

}

>Line

{

}


DoubleLineMode

>DoubleLineMode

{

}

This command toggles DoubleLine Mode off or on.

Compatibility: All versions

Example:

If Not (Sys(346)) Then

>DoubleLineMode

{

}

End If


Arc

>Arc

{

<Type t

[0 = arc, 1 = line]

<Angle a

span angle of the arc

<Points: 1 = center, 2 = starting point, 3 = plane reference(optional)

}

Draws an arc of specified span angle from a given center point and starting point, with an optional third point to specify the arc's planar orientation.

Compatibility: All versions

Example: Draw a 90° arc from the tip of a line to the left, with the center of the arc at the midpoint of the line.

>Line

{

<Pointxyz 20, 10, 0

<Pointxyz 45, 57, 0

}

>Arc

{

<MidPoint 22, 15, 0

<Gravity 45, 55, 0

<Pointrel -10, 0, 0

<Angle 90

<Type 0

}


WCLOSE Statement

PURPOSE:To close the text window

SYNTAX:WCLOSE

EXPLANATION:This statement closes the text window. The drawing behind the text window will return.

A text window that is opened by the WINDOW statement remains on the screen until it is closed or until the macro terminates.

See Also: WINDOW

COMPATIBILITY:All versions

EXAMPLE:

Window 5, 20 ' open a window 5 x 20 chars.

Locate 3, 10

Print "This is a test"

Anykey

Wclose' close the text window


D_TextFormat Parameter

D_TEXTFORMAT ParameterQuery and Change Parameters

D_TEXTFORMAT

Declaration: Alias D_TEXTFORMAT &H0A13

Arguments: One number (integer [0, 1, 2, 3]) representing the numeric format of the displayed text.

Values: 0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the format used to display the dimension text.

Query Usage:

Query D_TextFormat, tformat

where tformat is a numeric variable.

Change Usage:

Change D_TextFormat, tformat

where tformat is a numeric variable or expression.

Compatibility: Version 14 and higher


TA_StartPoint Parameter

TA_STARTPOINT ParameterQuery and Change Parameters

TA_STARTPOINT

Declaration: Alias TA_STARTPOINT &H0706

Arguments: Three floating-point numbers representing the coordinate of the beginning of the text arc.

Accessibility: Query only

Purpose: This parameter allows you to determine the exact starting point of the text arc.

Query Usage:

Query TA_StartPoint, xs, ys, zs

where xs, ys, and zs are all numeric variables.

Compatibility: Version 14 and higher


PrintCurrentView

>PrintCurrentView

{

}

Prints the portion of the drawing that is currently displayed in the active view, sized to fill the page.

Compatibility: Version 13 and higher


SelectDuplicate

>SelectDuplicate

{

}

Same as Duplicate above.

Compatibility: All versions


Box

>Box

{

<Points: 1 = first corner, 2 = opposite corner

}

Draws a rectangular line or plane or a 3D box. (Also see 2DBox)

Compatibility: All versions

Example: Draw a box 30 x 20 x 10

>SetStartPoint

{

}

>Box

{

<Color 0, 0, 255

<Layer 1

<Pointxyz 0, 0, 0

<Pointrelative 30, 20, 10

}


MoveToBackOf

>MoveToBackOf

{

<Point - item to be directly in "front" of selected items.

}

Moves the selected items to the back of the clicked item in the display list (so they appear to be "behind" the object referenced by the point).

Compatibility: All versions


LineSnap

>LineSnap

{

<point near line to snap to

}

This command moves the cursor to the nearest point on the nearest line.

Note: To snap to a line inside the parameters section of a macro command, use the parameter
<Linesnap x, y, z. See Parameters to Set Points.

Compatibility: All versions


MoveToFront

>MoveToFront

{

}

Moves the selected items to the front of the display list (so they appear to be "in front of" all other objects in the drawing).

Compatibility: All versions


CutPlane

>CutPlane

{

<Points: 1 = cutting line, 2 = plane to be cut

}

Cuts a plane along an overlapping line.

Compatibility: All versions

Example:

>Plane

{

<Pointxyz 0,0,0

<Pointxyz 0, 10, 0

<Pointxyz 10,10, 0

<Pointxyz 10, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, -10, 0

<Pointxyz 10, -10, 0

<Pointxyz 10, -20, 0

<Pointxyz 0, -20, 0

<Pointxyz 0, -10, 0

<Pointxyz -10, -10, 0

<Pointxyz -10, 0, 0

}

>Line

{

<Pointxyz 0, -10, 0

<Pointxyz 20, -5, 0

<Pointxyz 0, 0, 0

}

>Cutplane

{

<Pointxyz 20, -5, 0

<Pointxyz 0, 10, 0

}


ExportPlotFile

>ExportPlotFile

{

}

This command exports a plotter/cutter/engraver file (HPGL, DMPL, Dhalgren Intermediate File, etc).

Compatibility: Version 13 and higher


ComplementArc

>ComplementArc

{

}

Complements the selected arcs.

Compatibility: All versions


TA_VScale Parameter

TA_VSCALE ParameterQuery and Change Parameters

TA_VSCALE

Declaration: Alias TA_VSCALE &H0708

Arguments: One floating-point number representing the vertical scale factor for the text.
Accessibility: Query only (Query/Change 14.0.004+)

Purpose: This parameter allows you to determine the relative height of the text in the text arc.

Query Usage:

Query TA_VScale, tvs

where tvs is a numeric variable.

Change Usage: (Version 14.0.004+)

Change TA_VScale, tvs

where tvs is a numeric variable or expression.

Compatibility: Version 14 and higher


TickMark

>TickMark

{

<Segment s

number of divisions

<Distance d

distance along divisions

<Division div

number of small divisions for each large division

<LargeMark lm

size of large tickmark

<SmallMark sm

size of small tickmark

<Type t

0 = set tickmarks by distance; 1 = divide line into Segment pieces

<Points: 1 = line to be ticked, 2 = side for tickmarks

}

Draws tickmarks along a line.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 10, 10, 0

<Pointrel 25, 0, 0

}

>Line

{

<Pointxyz 10, 20, 0

<Pointrel 25, 0, 0

}

>Tickmark

{

<Type 0

<Segment 10

<Division 5

<SmallMark 0.5

<LargeMark 1

<Pointxyz 10, 10, 0

<Pointxyz 10, 11, 0

}

>Tickmark

{

<type 1

<Distance 10

<Division 5

<Pointxyz 10, 20, 0

<Pointxyz 10, 21, 0

}


SendAllFiles

>SendAllFiles

{

<Type t [0 = drawing, 1 = image] *new in Version 15

}

Sends all open drawings in an email as attachments.

Compatibility: All versions. Type parameter only exists in Version 15 and higher


Cut

>Cut

{

}

Cuts the selected items from the drawing to the clipboard.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>PointSelect

{

<Pointxyz 12, 12, 0

}

>SetHandle

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>Cut

{

}

>Paste

{

<Type 0

<Pointxyz 12, 24, 0

<Pointxyz 40, 24, 0

}


EA_SpanAngle Parameter

EA_SPANANGLE ParameterQuery and Change Parameters

EA_SPANANGLE

Declaration: Alias EA_SPANANGLE &H0406

Arguments: One floating-point number representing the span angle of the ellipse or elliptical arc.

Accessibility: Query/Change

Purpose: This parameter allows you to determine the ending angle of the elliptical arc. Changing this value will also change the ending angle. Setting the span angle to 0 is treated as setting the span angle to 360. If the absolute value of the span angle exceeds 360, the angle's size is reduced by 360 degree increments until it is less than 360. Negative span angles are allowed.

Query Usage:

Query EA_SpanAngle, espan

where espan is a numeric variable

Change Usage:

Change EA_SpanAngle, espan

where espan can be a numeric variable or expression

Compatibility: Version 14 and higher


LineAngle

>LineAngle

{

<Points: 1, 2 = lines to measure

}

This command measures the angle between two lines.

Note:This command only works on two co-planar lines.

Result returned in Sys(651)

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 0, 10, 20

}

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 15, 12, -5

}

>LineAngle

{

<Pointxyz 0, 10, 0

<Pointxyz 15, 12, -5

}


CA_StartAngle Parameter

CA_STARTANGLE ParameterQuery and Change Parameters

CA_STARTANGLE

Declaration: Alias CA_STARTANGLE &H0303

Arguments: One floating-point number for the circle/arc's starting angle

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the circle/arc's starting angle. Changing the starting angle does not affect the the span angle, but does affect the ending angle.

Query Usage:

Query CA_StartAngle, csa
where csa is a numeric variable

Query Usage:

Change CA_ StartAngle, cr
where csa is a numeric variable or expression

Compatibility: Version 14 and higher


PM_Type Parameter

PM_TYPE ParameterQuery and Change Parameters

PM_TYPE

Declaration: Alias PM_TYPE &H0C01

Arguments: A number (integer [0, 1, 2, 3, 4]) representing the format of the pointmark entity.

Values: 0 = cross, 1 = cross+circle, 2 = cross+square, 3 = cross+square+circle,
4 = filled dot

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the shape of a pointmark entity.

Query Usage:

Query PM_Type, pmtype

where pmtype is a numeric variable

Change Usage:

Change PM_Type, pmtype

where pmtype is a numeric variable or expression

Compatibility: Version 14 and higher


Ent_FixedWidth Parameter

ENT_FIXEDWIDTH ParameterQuery and Change Parameters

ENT_FIXEDWIDTH

Declaration: Alias ENT_FIXEDWIDTH &H010B

Arguments: One number (integer [0, 1]) indicating if the entity uses a fixed weight or not.

Values: 0 = standard width, 1 = fixed width (doesn't scale when zooming/printing)

Accessibility: Query/Change

Purpose: This parameter allows you to determine and change whether the entity uses a fixed line width or not. The Query result is the same value as Sys(538).

Query Usage:

Query Ent_FixedWidth, elfixed

where elfixed is a numeric variable

Change Usage:

Change Ent_FixedWidth, elfixed

where elfixed is a numeric variable or expression

Compatibility: Version 14 and higher


DimCenterPoint

>DimCenterPoint

{

<Type t --
[0=size in percent of radius, 1 = size in units]

<Size s -- the size (radius) of the center mark. Also, for type 0, it is the percentage of crosshair overshoot.

<Overshoot o -- the size (in drawing units) of the crosshair overshoot.

<Gap g -- the distance between the outside of the center mark and the inside of the crosshair line.

<Showline sl -- whether or not the crosshairs are drawn.
[0 = centermark only, 1 = center mark plus crosshairs]

<Points: 1 = chamfer line, 2, 3... = body of dimension

}

Marks the center point of a circle.

Compatibility: Version 13 and higher

Example:

>DimCenterPoint

{

<Type 1

<Size 1.5

<Overshoot 0.5

<Gap 1.0

<ShowLine 1

<Pointxyz 25, 0, 0

}


ShadeCommand

ShadeCommand

{

<ShowLine sl

[0 = no show, 1 = show lines]

<ShowArrow sa

[0 = no show, 1 = show arrows]

<ShowDim sd

[0 = no show, 1 = show dimensions]

<ShowText st

[0 = no show, 1 = show text]

}

Open the Shade command dialog box.

Compatibility: All versions


HatchLine

>HatchLine

{

<Scale s

pattern scale

<Angle a

pattern angle

<Type t

hatch pattern: 0 = ANGLE, 1 = ANSI31, 2 = ANSI32, etc.
Since there may be custom hatch patterns in the drawing, this parameter is unreliable from system to system. Instead, your new macros should use the new Name parameter instead.

<Name Pattern$

hatch pattern name: "ANGLE", "HEX", "WIN_SOLID", etc.
This parameter is now preferred over the Type parameter.

<Points on each line to be hatched

}

This command inserts a hatched area into the region enclosed by the line(s) specified.

Note:This command will only work in 2D Mode.

Compatibility: All versions

Example:

If NOT Sys(344) Then

>2DMode

{

}

End If

>Circle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 10, 0

}

>2DBox

{

<Type 1

<Pointxyz 24, 24, 0

<Pointxyz 12, 12, 0

}

>HatchLine

{

<Name "BRICK2"

<Pointxyz 10, 0, 0

<Pointxyz 24, 24, 0

}


Gravity

>Gravity

{

<Point 1 = starting point to snap from

}

Note: To set a gravity point inside the parameters section of another macro command, use the <Gravity x, y, z parameter. See Parameters to Set Points.

This command moves the cursor to the nearest existing point from the point specified.

Compatibility: All versions


A_Horizontal Parameter

A_HORIZONTAL Parameter (new in 15) Query and Change Parameters

A_HORIZONTAL

Declaration: Alias A_HORIZONTAL &H0606

Arguments: One integer indicating whether the attribute should always be displayed as horizontal text. If the value is set to one, the T_ANGLE parameter for the current entity will be set to zero.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the text contents of a stand-alone attribute definition (one that is not part of a block).

Query Usage:

Query A_Value, aval$

where aval$ is a string variable

Change Usage:

Change A_Value, aval$

where aval$ can be a string variable or expression

Compatibility: Version 15 and higher


UnWorkplane

>UnWorkplane

{

}

Restores the default working plane.

Compatibility: All versions

Example: See Workplane.


MESSAGE Statement

PURPOSE:To output data to the screen.

SYNTAX:MESSAGE {list of expressions}

EXPLANATION:The MESSAGE statement is used to output numeric and/or string expressions to the DesignCAD screen. It is similar to the PRINT statement, except that a dialog box is opened for each message statement. The macro pauses until the user presses one of the message box buttons. This command uses the Windows MessageBox function.

If more that one line is to be output, Chr$(13) can be included in the output expressions to provide a carriage return.

As of version 13, you can now specify what the style of message box the MESSAGE statement displays -- OK, Yes/No, OK/Cancel, Retry/Cancel, etc.
Sys(1027) sets the MessageBox Style, while Sys(1028) holds the user's response.

See Also: WINDOW, INPUT

COMPATIBILITY:All versions

EXAMPLES:

Message j, " is the current value."

Message "x: ", x, chr$(13), "y: ", y

'(This puts x and y on separate lines in the same message box.)

Again:

Sys(1027) = 4 'Yes/No MessageBox style
Message "Do you want to show this dialog box again?"
If Sys(1028) = 6 Then
Goto Again ' If user presses yes, show it again
End If
Sys(1027) = 0 'Simple OK MessageBox style
Message "See you later!"

End


MultilineMode

>MultilineMode

{

}

Toggles Multiline Mode off and on.

Compatibility: Version 16(?) and higher


RemoveToolbox

>RemoveToolbox

{

<Toolboxname "name"

Displayed name of toolbox under View | Options

}

Deletes the specified custom toolbox from DesignCAD's interface.

Compatibility: All versions


DCADTile

>DcadTile

{

}

Arranges the view windows in the default DesignCAD arrangement


DoubleLineBar

>DoubleLineBar

{

}

This command toggles the DoubleLineToolbar off or on.

Compatibility: All versions

Example:

If Not (Sys(232)) Then

>DoubleLineBar

{

}

End If


Sphere

>Sphere

{

<Latitude la

Number of divisions from pole to pole

<Longitude lo

Number of divisions around the equator

<Orientation o

[0 = point 2 on vertex on equator, 1 = point 2 on midpoint on equator, 2 = point 2 on a pole]

<Points: 1 = center, 2 = radius

}

Draws a sphere.

Compatibility: All versions


Slice

>Slice

{

<SelectOnly s

[0 = False, 1 = True]

<Type t

[0 = custom cutting plane, 1 = constant-X cutting plane, 2 = constant-Y, 3 = constant-Z]

<

<Points(custom): 1-3 = cutting plane,
4 (optional) = side to delete after the slice. If point 4 is omitted, both halves remain after the slice.

<Points(constant X, Y, or Z): 1 = cutting plane,
2 (optional) = side to delete after the slice. If point 2 is omitted, both halves remain after the slice.

}

Slice away part of the drawing, or part of the selection, along a specific cutting plane.

Compatibility: All versions. Type parameter only available in Version 13 and higher. Previous versions always required 3 or 4 points.

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}

>Slice

{

<SelectedOnly 0

' Slice along the plane X=5

<Type 1

' By only setting 1 point, we keep both sides

' of the slice

<Pointxyz 5, 5, 0

}


Built-In Constants

DesignCAD now provides a built-in constant for pi (ð) to simplify your mathematical coding:

_PI_ = 3.141592653589793 -- the ratio of a circle's diameter to its circumference.

_PI_ can be used in BasicCAD programs or from within the calculator.

(DesignCAD 13.0 and later)


Dimension

>Dimension

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<LinePosition lp

[0 = arrows inside leaders, 1 = arrows outside leaders]

<Axis y

[0 = Auto, 1 = Free, 2 = X, 3 = Y, 4 = Z]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1, 2 = distance to measure, 3 = dimension location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>Dimension

{

<Layer 12

<Type 0

<Arrowhead 3

<Arrowsize 1

<Axis 2

<Size 1

<Fix 0

<Format 2

<Precision 4

<Pointxyz 10, 5, 0

<Pointxyz 25.10364, 5, 0

<Pointxyz 25, 10, 0

}


SmoothOff

>SmoothOff

{

}

Toggles facet smoothing off for smooth shading.

Compatibility: All versions


GroupPointsMove

>GroupPointsMove

{

<Points: 1=any reference location, 2 = offset distance from point 1

}

This command moves all selected points in to a new location. You must be in Preset Point Mode with some points selected in order to use this command. This command is equivalent to the MovePoints command.

Compatibility: Version 15 and higher

Example:

Retry:

Message "Select an object on the screen"

SetPoint "Set a point on an object... ", 1

PointVal x, y, z, 1

>PointSelect

{

<Pointxyz [x, y, z]

}

If Sys(80) < 1 Then Goto Retry

If Not Sys(345) Then

>PointSelectMode

{

}

End If

Message "Now select some points on the object"

Retry2:

Sys(41) = 2 ' rubberband box for user points

Setpoint "Set two points for a selection box", 2

If Sys(1) < 2 Then Goto Retry2

>DragSelect

{

Pointval x y z 1 ' get the first point the user set

<Pointxyz [x, y, z]

Pointval x y z 2 ' get the second point the user set

<Pointxyz [x, y, z]

}

SetSelectedPoints

If Sys(1) < 1 Then

Message "No points selected. Try again."

Goto Retry2

End If

Message "Moving the selected points..."

Pointval x y z 1 ' get the first selected point

>GroupPointsMove

'>MovePoints

{

<Pointxyz 0, 0, 0' [x, y, z]

<PointRel 5, 5, 0

}


Ent_Handle Parameter

ENT_HANDLE ParameterQuery and Change Parameters

ENT_HANDLE

Declaration: Alias ENT_HANDLE &H0114

Arguments: one number (integer) for the index of the handle of interest, and three numbers (floating-point) for the handle's x, y, z coordinate.

Accessibility: Query/Change

Purpose: This parameter allows you to query and change the location of a specific handle on the entity.

Note: Modifying an object's points with the Change command (such as moving a circle's center) will not automatically move the handles to match; the handles must be explicitly updated using Change Ent_Handle.

Query Usage:

Query Ent_Handle, hindex, hx, hy, hz

where hindex is a numeric variable or expression, and hx, hy, and hz are numeric variables.

Change Usage:

Change Ent_Handle, hindex, hx, hy, hz

where hindex, hx, hy, and hz are all numeric variables or expressions.

Compatibility: Version 14 and higher


Redo

>Redo

{

}

Restores an operation that was previously cancelled with Undo.

Compatibility: All versions


RestoreDefaultMenu

>RestoreDefaultMenu

{

}

Restores the default DesignCAD menu.

Compatibility: All versions


CircleTan3Lines

>CircleTan3Lines

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<SelectOnly s

[0 - can use any circles, 1 - only draws tangent to the selected circles]

<Points: 1,2,3 = tangent lines

}

Draws a circle that lies tangent to the three lines specified.

Note: the tangent lines must be in the same plane.

Compatibility: All versions

Example:

>2DBox

{

<Orientation 1

<Type 1

<Pointxyz 0,0,0

<pointxyz 20, 20, 0

<Pointxyz 0, 40, 0

}

>CircleTan3Lines

{

<Type 0

<Pointxyz 10, 10, 0

<Pointxyz 10, 30, 0

<Pointxyz -10, 10, 0

}


ArrangeEntitiesByLayerOrder

>ArrangeEntitiesByLayerOrder

{

}

Sorts all entities so that they display in the order of their layers.
This is likely to change all entity IDs reported by BasicCAD!

Compatibility: Version 17.1 and higher


2DSelectMode

>2DSelectMode

{

}

Note: This command forces the program into 2D Selection Mode.

Compatibility: All versions


CenterOfGravity

>CenterOfGravity

{

<pointxyz x, y, z

}

Note: This cannot be used to set a point during another command; it can only be used for cursor movement or selection. See Parameters to Set Points.

Compatibility: All versions


LoadBMP

>LoadBmp

{

<Filename "filename.ext"

<Points: 1 = starting corner, 2 = opposite corner (optional)

}

This command inserts an image file into the current drawing. It can load image files of many types, including BMP, JPG, TIF, etc.

Note: As with the DxfIn command, you may use an asterisk in front of the filename for a shortcut to the DesignCAD directory, such as "*\mybmp.bmp".

Compatibility: All versions

Example:

>LoadBmp

{

<Filename "c:\windows\bubbles.bmp"

<Pointxyz 0, 0, 0

}


CutLine

>CutLine

{

<Points 1 = line to cut, 2 = location of cut, 3 = opposite end of cut (required for closed entities such as circles, ellipses, and rectangles)

}

Cuts a line at a specific point, or a closed entity at two points.

Compatibility: Version 13 and higher

Example:

>2DBox

{

<Orientation 0

<Type 1 ' vector

<Pointxyz 10, 10, 0

<Pointxyz 30, 20, 0

}

>CutLine

{

<Pointxyz 10, 10, 0

<Pointxyz 15, 10, 0

<Pointxyz 15, 30, 0

}


Ent_LineType Parameter

ENT_LINETYPE ParameterQuery and Change Parameters

ENT_LINETYPE

Declaration: Alias ENT_LINETYPE &H0105

Arguments: One number (an integer) representing the linetype.

Values: 0 = solid, 1 = Dashed, 2 = Hidden, 3 = Center, 4 = Phantom, 5 = Dot,
6 = Dashdot, 7 = Border, 8 = Divide, 9 = Special-1, 10 = Special-2,
11 = Special-3, 12 = Special-4.
Numbers over 12 are custom line types in their order of definition in DcLstyle.sys.

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the entity's line type index. The Query result is indentical to Sys(91).

Query Usage:

Query Ent_LineType, eltype

where eltype is a numeric variable

Change Usage

Change Ent_LineType, eltype

where eltype is a numeric variable or expression

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' this should be placed at the very top of the macro

Entity 1 ' load the first entity's data

Query Ent_Linetype, eltype ' find out the entity's linetype

Query Ent_Layer, elayer

If elayer = 4 and eltype <> 2 Then

Change Ent_Linetype, 2

Else

Change Ent_Linetype, 0

End If

Update 'ALWAYS Update the entity when done with Change

End


SelectImageSource

>SelectImageSource

{

}

Compatibility: All versions


REGEN Statement

PURPOSE:To redraw the currently active view.

SYNTAX:REGEN

EXPLANATION:Some activities, when performed from a BasicCAD program, may not regenerate the screen immediately afterwards. The REGEN statement forces DesignCAD to redraw the drawing onto the screen. The REGEN statement may be necessary, for example, after changing layers, or after changing the background color.

COMPATIBILITY:All versions

EXAMPLE:

' change the background color to black

Sys(321) = 0

Sys(322) = 0

Sys(323) = 0

' change the current drawing color to light red

Sys(300) = 255

Sys(301) = 64

Sys(302) = 64

REGEN

' now you have a black background, and all

' items will be drawn in light red


CHANGE Statement

PURPOSE:To change specific parameters of an entity that has been loaded using the ENTITY statement.

SYNTAX:CHANGE parameter, value [,value, value,…]

EXPLANATION:This statement is used to change a specific parameter of an entity to a new value. Available parameters and corresponding values are listed in DCADALIAS.d3i, and also in QUERY and CHANGE Parameters

Note: Immediately after you have finished changing all the desired parameters to an entity, run the Update statement to refresh the entity.

See Also: QUERY, UPDATE, QUERY and CHANGE Parameters

COMPATIBILITY:Version 14 and later

EXAMPLE:

Include "*\dcadalias.d3i"

Entity 1

Change ENT_COLOR, 255, 0, 0 ' Change the first entity’s color to RED.

Change ENT_NHANDLES, 1 ' define one selection handle for the entity.

Query ENT_POINT, 1, X1, Y1, Z1 ' locate the entity’s first point

Change ENT_HANDLE, 1, X1, Y1, Z1 ' set the handle at the first point.

Update


Assignment Statement

PURPOSE:To assign a value to a numeric variable.

SYNTAX:variable = expression

stringvar = expressionlist

EXPLANATION:Variable can be any numeric variable name. Expression can be any valid numeric expression.

Stringvar is any valid string variable name. Expressionlist is one or more string or numeric expressions separated by commas. Numeric expressions can be assigned to a string – they are evaluated and converted to ASCII format. Using more than one expression allows you to concatenate strings.

COMPATIBILITY:All versions

EXAMPLES:

x=123.456

d$=x 'd$ is "123.456"

x = 18

y = 3

z = x + y 'z = 21

x = sin(t) + 3 * j ^ 2

xpos = xpos + 1

z = Sqr(var(2))

xp(j) = xp(k) * 2

a$ = "This is a test"

j = 23

b$ = "the answer is ", j

' b$ is "the answer is 23"

a1$ = "1234"

a2$ = "5678"

a3$ = a1$+a2$ ' a3$ is "12345678"

a4$ = a1$, a2$

' a4$ is "1234 5678". Notice the space
' between the 4 and the 5.


Chapter 1: Macro Language - Statements

In this chapter we list the BASIC-like statements that make the DesignCAD Macro Language so versatile. The statements are listed alphabetically, along with a description and sample code fragments.

BasicCAD Essentials

A Note On Filenames

ALIAS Statement

ANYKEY Statement

Assignment Statement

BREAK-> Statement

CALL Statement

CHAIN Statement

CHANGE Statement

CLEAR Statement

CLEARSTORAGE Statement

CLEARSTORAGE$ Statement

CLOSE Statement

CLS Statement

CMDLINE Statement

COLOR Statement

DIM Statement

DO WHILE and LOOP Statements

END Statement

ENTITY Statement

EXIT DO Statement

EXIT FOR Statement

FOR and NEXT Statements

FORMAT Statement

GET Statement

GETATTR Statement

GETLAYERPROPS Statement

GETSELECT Statement

GETXY Statement

GOSUB and RETURN Statements

GOTO Statement

IF Statement (Group IF)

IF Statement (single line)

INCLUDE Statement

INPUT Statement

INPUT # Statement

LABELS

LAYER Statement

LOCATE Statement

MESSAGE Statement

ON ERROR Statement

OPEN Statement

PARSE Statement

POINTVAL Statement

POPPOINT Statement

PRECISION Statement

PRINT Statement

PRINT # Statement

PUSHPOINT Statement

PUT Statement

PUTATTR Statement

QUERY Statement

REGEN Statement

RESUME Statement

RUN Statement

SETLAYERPROPS Statement

SETPOINT Statement

SETSELECTEDPOINTS Statement

STOP Statement

TAB Statement

UPDATE Statement

UPDATELAYER Statement

WCLOSE Statement

WINDOW Statement


SymbolExplode

>SymbolExplode

{

}

Explodes a symbol into its component pieces.

Compatibility: All versions


SectionCutByLine

>SectionCutByLine

{

<SelectOnly s - which entities to cut
[0 = cut everything, 1 = cut selected]

<SelectAfter a - which entities to select after the cut
[0 = select inside only, 1 = select outside only,
2 = select both, 3 = select nothing]

<Type t - which entities to keep after the cut
[0 = keep inside section, 1 = keep outside section,
2 = keep both]

<Point 1 - a point on the line used as a cut boundary

}

Cuts away a section of the drawing enclosed by the specified line, circle, or curve.

Compatibility: Version 13 and later

Example:

>Circle

{

<Pointxyz 10, 10, 0

<Pointxyz 15, 10, 0

}

>2DBox

{

<Type 1

<Orientation 0

<Pointxyz 0, 8, 0

<Pointxyz 20, 12, 0

}

>SectionCutByLine

{

<SelectOnly 0

<Type 1

<SelectAfter 3

<Pointxyz 0, 8, 0

}


DeSelect

>DeSelect

{

}

Clears the selection set.

Compatibility: Version 14 and higher


OPEN Statement

PURPOSE:To open a file for input or output for the INPUT #, PRINT #, GET, or PUT statements.

SYNTAX:OPEN "A", filenumber, filename

OPEN "I", filenumber, filename

OPEN "O", filenumber, filename

OPEN "R", filenumber, filename, recordlength

EXPLANATION:A file must be opened before it is accessed by the INPUT # or PRINT # statements. To open a file for sequential input, use the "I" parameter before the file name. To open a file for sequential output, use "O." (This is the letter "oh", not the number zero.) You can use "A" to append data to a file – this is like "O", but if the file exists, data will be output to the end of the file.

To open a file for random access (for GET and PUT), use "R." If random access is specified, then the record length must also be specified. This value represents the number of bytes that will be read or written with the GET and PUT statements.

LPT1 can be specified for the file name in order to output to the printer. However, LPT1 can be used only for output, with OPEN "O."

The filenumber can be between one and twenty. No more than twenty files can be opened at one time. (The limit was four in version 12.0 and earlier.) Filename can be any valid Windows file name, including the path.

See Also: INPUT #, PRINT #, GET, PUT

COMPATIBILITY:All versions. Note that the limit on the number of files increased from 4 to 20 in version 13.

EXAMPLES:

Open "o", 1, "outfile"

Input "Enter input file name: ", file$

Open "i", 1, file$

Open "r", k, file$, 80


PUTATTR Statement

PURPOSE:To set the entity type, group status, and layer of an entity.

SYNTAX:PUTATTR entity, type, {,select, laynum, group, red, green, blue, solid}

EXPLANATION:This statement is used to set the entity type, status, layer, or group of an entity. Entity is the entity number – one for the first entity in the drawing, two for the second, etc. The specified entity will be assigned the specified attributes.

Type is the entity type. Possible values are:

1 = Line
2 = Ellipse
3 = 3D Text
4 = Curve
5 = Elliptical Arc
11 = Bezier Curve (4-point)
12 = Bezier Curve (Continuous)
13 = 2D Text
15 = Attribute
16 = Circle, Circular Arc
17 = Hatch
22 = Text Arc
24 = Arrow
26 = Symbol
31 = Plane
32 = Grid Header
33 = Grid Line
34 = Group
68 = Construction Line
70 = Point Mark
71 = Attribute Definition
74 = Dimension, Angle
75 = Dimension
76 = Dimension, Diameter/Radius
77 = Dimension, Arc
78 = Dimension, Radius Progressive
79 = Dimension, Progressive
80 = Dimension, Chamfer
81 = Dimension, Coordinate
90 = Bitmap Image
92 = Double Line
93 = Double Curve
94 = Double Bezier
95 = Double Circle/Arc
96 = Double Elliptical Arc
97 = Double Ellipse
119 = Multiline Text

Select is zero if the entity is not to be selected, and one if the entity is to be selected. Laynum is the layer number to be assigned to the entity. Group is the group ID number if the entity is to become part of that Group, or zero if it is not to be part of a Group. Red, green, and blue define the color for the entity. Solid is the solid ID of the entity; it is zero if the entity is not part of a solid.

Do NOT use "entity" or "layer" as variable names! Both are reserved words.

See Also: ENTITY, GETATTR

COMPATIBILITY:All versions

EXAMPLE:

' Change all entities in layer 6 to layer 12.

For j = 1 To Sys(9) ' Sys(9) is the number of entities in the drawing

Getattr j, type, select, laynum, group, red, green, blue
If laynum = 6 Then laynum = 12
Putattr j, type, select, laynum, group, red, green, blue

Next j


Paste

>Paste

{

<Type t

0 = Changeable scale (based on distance between handles 1 and 2); 1 = Fixed scale (always paste at original size)

<SelectOnly

0 = select the pasted object; 1 = leave the pasted object unselected

<Points: 1 = primary handle, 2-3 = second and third handles

}

Copy objects from the clipboard into the drawing.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>PointSelect

{

<Pointxyz 12, 12, 0

}

>SetHandle

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>Copy

{

}

>Paste

{

<Type 0

<Pointxyz 12, 24, 0

<Pointxyz 40, 24, 0

}


New

>New

{

}

Opens a new drawing file

Compatibility: All versions


TA_Direction Parameter

TA_DIRECTION ParameterQuery and Change Parameters

TA_DIRECTION

Declaration: Alias TA_DIRECTION &H0709

Arguments: One number (integer [-1, 1]) representing the direction of the text along the arc.
Values: -1 = counterclockwise, 1 = clockwise

Accessibility: Query only

Purpose: This parameter allows you to determine whether the text is "inside" or "outside" the arc. Clockwise text is on the outside of the arc, while counterclockwise text is on the inside of the arc.

Query Usage:

Query TA_Direction, tadir

where tadir is a numeric variable.

Compatibility: Version 14 and higher


CutEdge

>CutEdge

{

<Depth d

<Point 1 = edge to cut

}

Chamfers the edge of a 3D solid.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}

>CutEdge

{

<Pointxyz 0, 6, 0

<Depth 4

}

>CutEdge

{

<Depth 3

<Pointxyz 10, 6, 0

}


ApplyLayer

>ApplyLayer

{

}

Moves the selected items to the current layer. The current layer index can be determined from Sys(3), or the current layername from Sys$(93).

Compatibility: All versions


DimArc

>DimArc

{

<Orientation o

text orientation [0 = tangent to arc, 1 = horizontal]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text for tolerance type 2

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size; if 0.0, uses the default text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = arc to be measured, 2 = arrow location

}

Dimensions the length of an arc.

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>Arc3

{

<Pointxyz 0,10,0

<pointxyz 10, 10,0

<Pointxyz 15, 0,0

}

>DimArc

{

<Font "Times New Roman"

<Size 3

<Arrowhead 1

<Arrowsize 1.5

<Precision 3

<ToleranceType 2

<ToleranceLow -0.0005

<ToleranceHigh +0.0003

<Prefix 4

<Suffix 3

<Format 2

<Location 1

<Orientation 1

<Pointxyz 10, 10,0

<Pointxyz 10, 20,0

}


QUERY Statement

PURPOSE:To get a specific bit of information from an entity that has been loaded with the Entity statement.

SYNTAX:QUERY parameter, variable [,variable, variable,…]

EXPLANATION:This statement is used to a specific bit of information about a loaded entity. Some examples of parameters that can be queried are:

ENT_TYPE – obtains the entity type

ENT_COLOR – obtains the entity's RGB color values

ENT_NHANDLES – obtains the number of preset handles on the entity.

ENT_NPOINTS – obtains the number of points in the entity

ENT_POINT – obtains the XYZ values of a given point in the entity.

CA_RADIUS – the radius of the entity, if a circle or arc

CA_CENTER – the center of the entity, if a circle or arc.

T_FONTTYPE – the type of font, if the entity contains a text string

T_FONT – the font of the text, if a text entity.

T_TEXT – the entity's text string, if a text entity.

Available parameters and corresponding values are listed in DCADALIAS.d3i, and described in QUERY and CHANGE Parameters

See Also: CHANGE, GETATTR, PUTATTR, ENTITY

COMPATIBILITY:Version 14 and later

EXAMPLE:

Include "DcadAlias.d3i"

Entity 1

Change ENT_COLOR, 255, 0, 0

Change CA_CENTER, 10, 10, 0

Change CA_RADIUS, 10

Change CA_STARTANGLE, 0

Change CA_SPANANGLE, 180

Change ENT_NHANDLES, 2

Query ENT_POINT, 1, X1, Y1, Z1

Change ENT_HANDLE, 1, 0, 0, 0

Query ENT_POINT, 2, X2, Y2, Z2

X = X2 - X1

Y = Y2 - Y1

Z = Z2 - Z1

Change ENT_HANDLE, 2, X, Y, Z

Update

>RegenerateAll

{

}


QShade

>QShade

{

<ShowLine sl

[0 = no show, 1 = show]

<ShowArrow sa

[0 = no show, 1 = show]

<ShowDim sd

[0 = no show, 1 = show]

<ShowText st

[0 = no show, 1 = show]

}

Quick shade command for entire view.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 10, 5, 10

<Pointrel 10, 10, -10

}

>QShade

{

<ShowLine 0

<ShowArrow 0

<ShowDim 0

<ShowText 0

}


SendCurrentFile

>SendCurrentFile

{

<Type t [0 = drawing, 1 = image] *new in Version 15

}

Sends the active drawing as an email attachment.

Compatibility: All versions. Type parameter only exists in Version 15 and higher.


Patch

>Patch

{

<NPlane n, m

number of divisions across the width and length of the patch

<Points: 1, 2, 3, 4 lines to be patched

}

This command draws a surface grid between any three or four connected lines.

Compatibility: All versions

Example:

>BezierCurve

{

<PointXYZ 0.0000, 0.0000, 0.0000

<PointXYZ 9.5450, 7.4976, 0.0000

<PointXYZ 25.0892, 8.5261, 0.0000

<PointXYZ 31.3900, 17.7556, 0.0000

}

>BezierCurve

{

<PointXYZ 0.0000, 0.0000, 19.6003

<PointXYZ 6.7322, 7.6098, 19.6003

<PointXYZ 25.0892, 8.5261, 27.2730

<PointXYZ 23.9830, 20.7747, 27.2730

}

>Curve

{

<PointXYZ 25.0892, 8.5261, 0.0000

<PointXYZ 24.5787, 11.2713, 19.5198

<PointXYZ 25.0892, 8.5261, 27.2730

<Type 0

}

>Curve

{

<PointXYZ 0.0000, 0.0000, 19.6003

<PointXYZ -3.5712, 0.1884, 7.7175

<PointXYZ 0.0000, 0.0000, 0.0000

<Type 0

}

>Patch

{

<PointXYZ -2.8071, 0.1481, 13.4527

<PointXYZ 12.2845, 3.6014, -0.0000

<PointXYZ 24.5199, 11.5875, 17.1385

<PointXYZ 11.3393, 2.8027, 22.0757

<NPlane 20, 20

}


DoubleLineToWideLine

>DoubleLineToWideLine

{

}

This command converts selected Double Lines to wide lines.

Compatibility: Version 13 and higher

Example:

Sys(346) = 0

>Line

{

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

<Pointxyz 20, 20, 0

<Pointxyz 10, 10, 0

<Pointxyz 10, 10, 0

}

>PointSelect

{

<Pointxyz 10, 10, 0

}

>DoubleLineToWideLine

{

}


Calculator

>Calculator

{

}

Opens the DesignCAD calculator.

Compatibility: All versions


PolygonSubtract

>PolygonSubtract

{

}

Subtracts one or more shapes from another shape.

Compatibility: Version 13 and higher

Example: Subtract one circle from another overlapping circle.

>Circle

{

<Pointxyz 20, 20, 0

<Pointxyz 30, 20, 0

}

>Circle

{

<Pointxyz 35, 20, 0

<Pointxyz 45, 20, 0

}

>PolygonSubtract

{
<Pointxyz 20, 30, 0

<Pointxyz 35, 30, 0

}


AlignObjects

>AlignObjects

{

<Type t [0=left, 1=right, 2=top, 3=bottom,
4=vertical center, 5=horizontal center,
6=front (3D only), 7=back (3D only),
8=axial center (3D only)]

If Type is not specified, the dialog box shows.

}

Aligns the selected objects as specified

Compatibility: Version 13 and higher

Example: Align two objects along their left edges

>2DBox

{

<pointxyz 10, 10, 0

<Pointrel 15, 10, 0

<Type 1' vector box

<Orientation 0' not tilted

}

>Circle

{

<Pointxyz 10, 30, 0

<Pointrel 0, 5, 0

}

>PointSelect

{

<Type 0' new selection

<Pointxyz 10, 10, 0

}

>PointSelect

{
<Type 1' add to selection
<Pointxyz 10, 35, 0

}

>AlignObjects

{

<Type 0' align along left edge

}


Plane

>Plane

{

<Incomplete - (Optional)

<Points: 1, 2, 3,... perimeter of plane

}

This command draws a bounded planar surface.

Compatibility: All versions

Example:

>Plane

{

<Pointxyz 10, 10, 10

<Pointrel 0, 0, 10

<Pointrel 15, 0, 0

<Pointrel 0, 0, 10

<Pointrel 15, 0, 0

<Pointrel 0, 0, -20

}


Units

>Units

{

<Length l

new distance between the specified points

<Points: 1, 2 = distance to measure

}

Defines the distance between any two points, and rescales the entire drawing accordingly.

Special Note:The Units command cannot be "Undone" with the Undo command. Use it with extreme caution.
NEVER set the Units value for a measurable distance to zero - this can destroy your data!
Scale and ScaleOrtho are much better choices for almost every purpose.

Compatibility: All versions

Example: convert a drawing from feet to centimeters

'assumes one drawing unit is currently one foot.

>Line

{

<Pointxyz 10,10, 0

<Pointxyz 20, 10, 0

}

>Dimension

{

<Format 0

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

<Pointxyz 20, 14, 0

<Size 1

}

>FitToWindow

{

}

>Units

{

' set two points 1 inch apart, and set that
' distance to 2.54

<Pointxyz 0, 0, 0

<Pointxyz [1/12], 0, 0

<Length 2.54

}


CLEARSTORAGE Statement

PURPOSE:To erase some or all SYSVAL_ ini files.

SYNTAX:CLEARSTORAGE
CLEARSTORAGE n
CLEARSTORAGE m {, }n

EXPLANATION:This statement is used to erase one or more of the SysVal ini files that store the SysEx() function values.

If the CLEARSTORAGE statement is used alone, all SysVal ini files (SysVal_001 – SysVal_100) will be erased.

If CLEARSTORAGE is followed by single number or expression n, then the single SysVal ini file whose numeric suffix matches n will be erased.

If CLEARSTORAGE is followed by a pair of numbers or expressions m and n, separated by a comma or a space, all SysVal ini files in the range from m to n will be erased.

If three or more arguments are presented to the CLEARSTORAGE statement, the macro will report a syntax error.

COMPATIBILITY:Version 14 and later

EXAMPLE:

' Delete all SYSVAL_xxx.ini files

ClearStorage

' Delete SYSVAL_010.ini only
ClearStorage 10

' Delete a range of SysVal ini files from 5 to 14
x = 5
ClearStorage x, x+9

' or
ClearStorage 5 14


ChangeCodePage

>ChangeCodePage{

<CodePage cp

new code page

<Font font$

the full name of the Windows font, ex. "Times New Roman".
This parameter may be omitted, in which case the same font will be used (if it is available in the selected code page)

<SelectOnly s

0=change all text, 1=only change selected text

}

Changes the code page (character set) of TrueType text. If the selected code page is unavailable on the system, the system default character set will be used to display the text.

Supported code pages:
1250 - Eastern Europe (Poland, Czech Republic, etc.)
1251 - Cyrillic (Russia)
1252 - US, Western European
1253 - Greek
1254 - Turkish
1257 - Baltic (Latvia, Slovenia, etc.)

Compatibility: Version 13 and higher

Example: convert all TrueType text in the drawing to use the Baltic character set

>ChangeCodePage

{

<SelectOnly 0

<CodePage 1257

}


Pan

>Pan

{

<Points: 1 = drag handle, 2 = new location

}

Shifts the view of the drawing.

Compatibility: All versions

Example:

>Pan

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 10

}


GETLAYERPROPS Statement

PURPOSE:To get a layer's default color and linestyle settings, if any.

SYNTAX:GETLAYERPROPS layerindex

EXPLANATION:This statement is used to determine the default settings for a layer. The layer's settings are loaded into Sys() functions 530-542:

530 - Layer uses specific color? (0 = no, 1 = yes)

531 - Layer red (default 0)

532 - Layer green (default 0)

533 - Layer blue (default 0)

534 - Layer uses specific linestyle? (0 = no, 1 = yes)
Note: this is the same as observing the status of the "Assign Linestyle" checkbox in Layer Options – If "checked", the complete linestyle (type, scale, width, filled) is applied to the layer, as indicated by the Sys() function values below.

535 - Linetype (default 0)

536 - Linescale (default 2)

537 - Linewidth in drawing units (default 0)

538 - Layer uses fixed linewidth? (0 = no, 1 = yes)
if 0, uses the width specified by Sys(537);
if 1, uses the linewidth specified by Sys(539)

539 - Fixed linewidth in hundredths of mm (ex. 50 = .5 mm). If the width specified does not match one of the preset values, the actual width will change to the next lowest preset width value (0.00, 0.05mm, 0.09mm, 0.13mm, etc.), so for example 12 would revert to 9, for 0.09mm.

540 - Layer uses filled lines? (0=no, 1 = yes)

541 - Force layer color on all new entities? (0=no, 1 = yes)

542 - Force layer linestyle on all new entities? (0=no, 1 = yes)

LayerIndex is the layer number of the layer whose properties are being loaded.

See Also: SETLAYERPROPS, UPDATELAYER

COMPATIBILITY:Version 14 and later

EXAMPLE:

GetLayerProps 2

Window 12, 50

Print "Sys(530) -- use color?: ", sys(530)

Print "Sys(531) -- red: ", sys(531)

Print "Sys(532) -- green: ", sys(532)

Print "Sys(533) -- blue: ", sys(533)

Print "Sys(534) -- use linestyle?: ", sys(534)

Print "Sys(535) -- linetype:", sys(535)

Print "Sys(536) -- linescale:", sys(536)

Print "Sys(537) -- linewidth: ", sys(537)

Print "Sys(538) -- use fixed width?: ", sys(538)

Print "Sys(539) -- fixed width: ", sys(539)

Print "Sys(540) -- filled lines?: ", sys(540)

Print "Sys(541) -- force layer color?: ", sys(541)

Print "Sys(542) -- force layer linestyle?: ", sys(542)

Anykey

WClose


EA_StartPoint Parameter

EA_STARTPOINT ParameterQuery and Change Parameters

EA_STARTPOINT

Declaration: Alias EA_STARTPOINT &H0407

Arguments: Three floating-point numbers representing the coordinate of the beginning of the elliptical arc.

Accessibility: Query only

Purpose: This parameter allows you to determine the exact starting point of the elliptical arc. This point cannot be changed directly.

Query Usage:

Query EA_StartPoint, xs, ys, zs

where xs, ys, and zs are all numeric variables.

Compatibility: Version 14 and higher


CHAIN Statement

PURPOSE:To transfer control to another DesignCAD macro.

SYNTAX:CHAIN macroname

EXPLANATION:This statement is used to run another DesignCAD macro, leaving all the variables from the current macro intact when the other macro is executed. A string variable or constant can be used for the macro name.

The CHAIN statement causes the new macro (macroname) to replace the current macro in memory. To return to the original macro, you must execute another CHAIN or RUN statement from the new macro. The execution of a macro called by the CHAIN statement always begins at the first line in the called macro.

The RUN statement is similar to the CHAIN statement, but the RUN statement clears all variables before executing the new macro.

Note:You should always specify the macro name complete with its extension.

See Also: RUN, CALL

COMPATIBILITY:All versions

EXAMPLES:

Chain MACNAME$

Chain "TEST1.D3M"


ApplyColor

>ApplyColor

{

}

Applies the current drawing color to the selected items. The current drawing color's Red, Green, and Blue components can be obtained from Sys(300), (301) and (302).

Compatibility: All versions


UserDefinedViewsEditor

>UserDefinedViewsEditor

{

}

Opens the editor for user-defined views

Compatibility: Version 17 and higher


PasswordProtectionManager

>PasswordProtectionManager

{

}

Opens the Password Protection Manager dialog box.

Compatibility: All versions


Parallelogram

>Parallelogram

{

<Type t

[0 = line, 1 = plane]

<Points: 1 = first corner, 2 = second corner, 3 = third corner

}

Draws a parallelogram.

Compatibility: All versions

Example:

>Parallelogram

{

<Color 255, 0, 128

<Pointxyz 0, 0, 0

<Pointxyz 10, 2, 0

<Pointxyz 12, 7, 0

<Type 1

}


String Functions

ASC(a$)- ASCII code for the first character of a$.

a$ = "Test"

y = ASC(a$)

' y = 84

CVS(a$)- Convert the eight-character string a$ to a real number. This is the inverse of MKS$.

ERR$(x) Returns the description of the specified error number.
errnum=Err(1)

Message Err$(errnum)

INSTR(a$, b$)- Returns the location of the first occurrence of string b$ in string a$. Zero is returned if there are no occurrences.

a$ =" This is a test"

b$ = "test"

z = INSTR(a$,b$)

' z = 11

LEN(a$)- Length of string a$.

a$ = "This is a test"

l = len(a$)

' l = 14

VAL(a$)- Numeric value of string a$ (accepts feet-inches or degrees-minutes-seconds). For example:

a$ = "2'4""

n = Val(a$)

' n = 2.3333.

a$ = "60D40M15S"

n = Val(a$).

' n = 60.6708

a$ = "45"

n = Val(a$)

' n = 45.0000

n may now be used for calculations.

Note: To convert a numeric value back into a text string, just use a normal Assignment statement, a$=n. The string will be assigned using the current Precision setting.

CHR$(x)- Returns the character with an ASCII code of x.

x = 84

a$ = CHR$(x)

' a$ = "T"

LEFT$(a$, x)- Returns the leftmost x characters of a$.

a$ = "This is a test"

x = 8

b$ = LEFT$(a$, x)

' b$ = "This is " (note the trailing space)

MID$(a$, x, y)- Returns y characters of a$ beginning at x.

a$ = "This is a test"

x = 4

y = 6

b$ = MID$(a$, x, y)

' b$ = "s is a"

MKS$(x)- Converts x to an eight-character string.

x = 108.45

a$ = MKS$(x) 'convert the number to a string

print "[" + a$ + "]"

anykey

y = CVS(a$)'convert the string back to a number

print y

anykey

RIGHT$(a$, x)- Returns the rightmost x characters of a$.

a$ = "This is a test"

x = 8

b$ = RIGHT$(a$, x)

' b$ = "s a test"

STRING$(x, a$)- Returns a string of x copies of a$.

a$ ="HELP! " ' (note trailing space)

x = 3

b$ = STRING$(3, a$)

' b$ = "HELP! HELP! HELP! " (note trailing space)


SelectSlant

>SelectSlant

{

<Type t
Axis on which the selected object is to be skewed

[0 = x, 1 = y, 2 = z, 3 = free]

<Angle a
skew angle [0 to 360]

<Point 1 – reference point

<Point 2 – new position for reference point

}

Slants the selected entities along the X, Y, or Z axis, or a free direction.

Compatibility: All versions

Example:

>Sphere

{

<Pointxyz 10, 10, 0

<Pointxyz 10, 0, 0

}

>PointSelect

{

<Pointxyz 10, 0, 0

}

>SelectScale

{

<Scale 2.0, 1.25, 3.0

}


Regenerate

>Regenerate

{

}

Redraw every entity in the active view.

Compatibility: All versions


EA_EndAngle Parameter

EA_ENDANGLE ParameterQuery and Change Parameters

EA_ENDANGLE

Declaration: Alias EA_ENDANGLE &H0405

Arguments: One floating-point number representing the ending angle of the ellipse or elliptical arc, relative to the first axis.

Accessibility: Query only

Purpose: This parameter allows you to determine the ending angle of the elliptical arc. The End Angle cannot be modified directly, but will be changed if you change the Start Angle or Span Angle

Query Usage:

Query EA_EndAngle, eend

where eend is a numeric variable

Compatibility: Version 14 and higher


CA_EndAngle Parameter

CA_ENDANGLE ParameterQuery and Change Parameters

CA_ENDANGLE

Declaration: Alias CA_ENDANGLE &H0304

Arguments: One floating-point number for the circle/arc's ending angle

Accessibility: Query only

Purpose: This parameter allows you to query the circle's ending angle. The ending angle cannot be modified directly, but it is automatically changed if you modify the start angle or the span angle.

Query Usage:

Query CA_EndAngle, cea
where cea is a numeric variable

Compatibility: Version 14 and higher


ShowToolbox

>ShowToolbox

{

<Toolboxname "name"

Displayed name of toolbox under View | Options

<Visible v

[0 = show the toolbox, 1 = hide the toolbox]

}

Shows or hides the named custom toolbox.

Compatibility: All versions


COLOR Statement

PURPOSE:Set the text color in a text window.

SYNTAX:COLOR foreground {, background}

EXPLANATION:This statement is used to set the color of text in a text window.

Foreground is the foreground color for the text, and background is the background color. The colors can range from zero to 19. These numbers correspond to the standard Windows palette, not to DesignCAD's palette.

The COLOR statement affects only the text displayed with PRINT statements after the COLOR statement is executed. The text color remains set at the specified color until the next COLOR statement is executed. COLOR will also affect the background color of the entire window if you follow it with a CLS statement.

COMPATIBILITY:All versions

EXAMPLE:

Precision 0' print as integers

Window 20, 30 ' open a window 20 lines by 30 chars

Color 0, 1 ' white text on black

Cls

For i = 0 To 19' loop to change the background color

Color 0,i' foreground 0, background i

Print "this is a test of color", i

Next i

Anykey


SectionCut

>SectionCut

{

}

Same as CutOff above.

Compatibility: All versions


OffScreenBitmap

>OffScreenBitmap

{

}

Toggles the OffscreenBitmap option.

Compatibility: All versions


BezierCurve

>BezierCurve

{

<Incomplete -

This parameter allows the user to set more points.

<Points: 1 = start, 2 = tangent, 3 = next point, 4 = tangent, ...

}

Draws a Bezier curve.

Compatibility: All versions

Example:

>SetStartPoint

{

}

>BezierCurve

{

<Color 255, 0, 128

<Layer 4

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 20, 0

<Pointxyz 20, 20, 0

}

>BezierCurve

{

<Color 255, 0, 255

<Layer 4

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 20, 0

<Pointxyz 30, 20, 0

}


DimensionDistanceOnly

>DimensionDistanceOnly

{

<Orientation o

Text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

Number of digits past the decimal in the dimension text

<Format f

Text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

Text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix "j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Axis y

[1 = horizontal, 2 = vertical]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1, 2 = distance to measure, 3 = text location

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>DimensionDistanceOnly

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

<Pointxyz 10, 15, 0

}


AttribDef

>AttribDef

{

<Tag tag$ -- the attribute definition's identifier

<Prompt pmt$ -- prompt to ask for the attribute's value

<Text t$ -- the default value of the attribute

<Style st -- the text style

[0 = normal, 1 = bold, 2 = italic, 3 = bold italic]

<Justification j

[0 = left, 1 = center, 2 = right]

<Size s

text size

<Angle a

default text angle

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Type ft -- Font type

[0= truetype font, 1=vector font]

<Visible i -- text visibility

[0= false (text is hidden), 1=true (text is visible)]

<Fix f -- Fixed Text flag

[0= false (text can be changed), 1= true (text can't be changed)]

<WaitForOK w -- Show Dialog and wait for user OK

[0= don't wait, 1=wait]
If enough parameters are not specified, the dialog box shows anyway

<Point for location

}

Creates an attribute definition, which can be included in a block.

Compatibility: Version 13 and higher

Example:

>AttribDef

{

<PointXYZ 3.8427,14.1597,0.0000

<Tag "TEST_ATTRIBUTE"

<Prompt "Please enter the data"

<Text "This is the default string"

<Style 0 ' normal text

<Justification 2 ' right justification

<Size 2.1250

<Angle 17.1000

<VectorFont "Simplex2w"

<FontType 1 ' vector font

<Visible 1 ' text visible

<Fix 1 ' changeable text

<WaitForOk 0}
}


GETXY Statement

PURPOSE:To get the X, Y, Z coordinates of the current cursor position

SYNTAX:GETXY variable, variable, variable

EXPLANATION:This statement can be used to assign the X, Y, Z coordinates of the current cursor position to three variables. It is frequently used to provide a reference location for the rest of the macro.

Note: This statement was previously documented without commas separating the variables. It often works either way, but we recommend using the commas for consistency with other statements. In some cases, the commas may be required for proper operation.

COMPATIBILITY:All versions

EXAMPLE:

Getxy x1, y1, z1

>Line

{

For j = 0 To 360 Step 45

x = x1 + Cos(j) * 10

y = y1 - Sin(j) * 10

<Pointxyz [x, y, z1]

Next j

}


CA_StartPoint Parameter

CA_STARTPOINT ParameterQuery and Change Parameters

CA_STARTPOINT

Declaration: Alias CA_STARTPOINT &H0307

Arguments: Three floating-point numbers for the coordinate of the starting point of the arc or circle.

Accessibility: Query only

Purpose: This parameter allows you to determine the starting coordinate of the circle or arc. The distance from the center to the starting point is the same as the circle's radius, and the angle of the segment from the center to the starting point determines the arc's start angle.

Query Usage:

Query CA_StartPoint, sx, sy, sz

where sx, sy, and sz are numeric variables

Compatibility: Version 14 and higher


Combine

>Combine

{

}

Combines the selected lines into a single line.

Compatibility: All versions


PolygonSelection

>PolygonSelection

{

<Points for the selection polygon

}

Selects entities bounded by a polygonal fence.

Compatibility: All versions

Example: Select some entities inside a polygon

>Circle

{

<Pointxyz 20, 20, 0

<Pointxyz 30, 20, 0

}

>Circle

{

<Pointxyz 35, 20, 0

<Pointxyz 45, 20, 0

}

>PolygonSelection

{
<Pointxyz 5, 5, 0

<Pointxyz 50, 5, 0

<Pointxyz 50, 35, 0

<Pointxyz 5, 35, 0

}


MoveLeft

>MoveLeft

{

}

Rotates the camera to the left.

Compatibility: All versions


PolygonEdge

>PolygonEdge

{

<NSide s

number of sides

<Type t

[0 = line, 2 = plane]

<Points: 1 = vertex, 2 = next vertex, 3 = plane reference

}

Draws a polygon from two neighboring corners.

Compatibility: All versions

Example:

>PolygonEdge

{

<NSide 5

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 5, 0

}


POINTVAL Statement

PURPOSE:To assign the coordinates of one of the points that has been set (either by the user in response to a SETPOINT statement, or by the ENTITY statement) to three variables.

SYNTAX:POINTVAL xval, yval, zval, expression

EXPLANATION:xval, yval, and zval must be variables. They will be assigned the X, Y, and Z coordinates of the point that has been set in DesignCAD. The "expression" determines which point will be assigned to the variables. The number of points currently set can be determined in the system function Sys(1). An error will occur if expression is greater than the number of points set in Sys(1).

Note: This statement was previously documented without commas separating the variables. It often works either way, but the commas are recommended for consistency with other statements, and in some cases may be required.

See Also: ENTITY, SETPOINT, SetPoints

COMPATIBILITY:All versions

EXAMPLE:

' get all points into jx, jy, jz

For j = 1 To Sys(1)

Pointval jx(j), jy(j), jz(j), j

Next j


T_Size Parameter

T_SIZE ParameterQuery and Change Parameters

T_SIZE

Declaration: Alias T_SIZE &H0502

Arguments: One floating-point number representing the height of the text in drawing units.

Accessibility: Query/Change

Purpose: This parameter allows you to easily determine and change the text entity's text size. When changing the text size, the text is re-scaled around the insertion point.

Query Usage:

Query T_SIZE, tsize

Where tsize is a numeric variable

Change Usage:

Change T_Size, tsize

Where tsize can be a numeric variable or expression

Compatibility: Version 14 and higher


DoubleLineConvert

>DoubleLineConvert

{

<Alignment n

[0=Left, 1=Center, 2=Right]

<AutoTrim a

[0=No, 1=Yes]

<Cap c

[0=None, 1=Cap Beginning, 2=Cap End, 3=Cap Both]

<Fill f

[0=No, 1=Yes]

<Width w

<Point - a single point specifying the entity to be converted.

}

This command converts an ordinary line, circle, arc, or curve into its double line equivalent, using the parameters provided.

Compatibility: All versions

Example:

w = Sys(370) ' width

c = Sys(371) ' capstyle

t = Sys(372) ' autotrim

a = Sys(373) ' alignment

f = Sys(374) ' fill

>DoubleLineConvert

{

<Alignment [a]

<Autotrim [t]

<Width [w]

<Cap [c]

<Fill [f]

' set a point on the entity

<Pointxyz 10, 10, 0

}


Midpoint2

>MidPoint2

{

<Point 1

<Point 2

}

Moves the cursor to a point midway between points 1 and 2.

Compatibility: Version 13 and higher


Ent_Material Parameter

ENT_MATERIAL ParameterQuery and Change Parameters

ENT_MATERIAL

Declaration: Alias ENT_MATERIAL &H0111

Arguments: One number (integer) representing the material's index in the material table

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's material property.

Query Usage:

Query Ent_Material, emat

where emat is a numeric variable

Change Usage:

Change Ent_Material, emat

where emat is a numeric variable or expression

Compatibility: Version 14 and higher


DuplicateToLayer

>DuplicateToLayer

{

<Layer n -- Destination layer

}

This command copies the selected objects to a single specified layer. If more than one layer is specified, only the last one listed is used as the destination.

Compatibility: Version 13 and higher

Example: Copy the current selection to layer 7.

>DuplicateToLayer

{

<Layer 7

}


Hatch

>Hatch

{

<Scale s

pattern scale

<Angle a

pattern angle

<Type t

hatch pattern: 0 = ANGLE, 1 = ANSI31, 2 = ANSI32, etc.
Since there may be custom hatch patterns in the drawing, this parameter is unreliable from system to system. Instead, your new macros should use the new Name parameter instead.

<Name Pattern$

hatch pattern name: "ANGLE", "HEX", "WIN_SOLID", etc.
This parameter is now preferred over the Type parameter.

<Points: 1, 2, 3,... perimeter of hatch area

}

This command inserts a hatched area into the drawing.

Compatibility: All versions

Example:

If NOT Sys(344) Then

>2DMode

{

}

End If

>Hatch

{

<Color 255, 0, 128

<Layer 3

<Scale 1.0

<Angle 0

<Name "HONEY"

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 20, 20

<Pointxyz 0, 20, 0

}


Ent_Layer Parameter

ENT_LAYER ParameterQuery and Change Parameters

ENT_LAYER

Declaration: Alias ENT_LAYER &H0102

Arguments: One number (integer, [0, 1000]) representing the layer number.

Accessibility: Query/Change

Purpose: This parameter allows you to determine and/or change the entity's layer number. The Query result is the same as Sys(93).

Query Usage:

Query Ent_Layer, elayer

where elayer is a numeric variable to represent the entity's layer.

Change Usage

Change Ent_Layer, elayer

where elayer can be a numeric variable or simple expression (no parentheses).

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i"

Entity 1

Query Ent_Layer, elayer

If elayer > 100 and elayer < 199 Then

Change Ent_Layer, 199

Update 'ALWAYS Update the entity when done with Change.

End If

End


BREAK-> Statement

PURPOSE:To assist in debugging macros by temporarily stopping the execution of a DesignCAD macro and displaying the values of one or more variables.

SYNTAX:BREAK-> formatstring$, variable1 [, variable2, variable3…]

EXPLANATION:This statement is used to pause the execution of a macro and optionally display the value of one or more variables at that point in time.

The BREAK-> statement is only executed when the macro is in debug mode (i.e. when Sys(800) has been set to 1 or 2)

To simply pause the macro and step through it, use a simple BREAK-> statement with no arguments. As long as Sys(800) is set to 1 or 2, the macro will pause at the break point and display the following prompt in the Debug window:

-> BREAK

-> F5: Continue, F8: Next Statement, F9: Remove Breakpoint, Esc: Stop Program

The macro can then be stepped through using F5 and F8, or the break point can be removed (but only from the copy of the macro that is stored in memory – the original source file is not affected).

The BREAK-> statement can also be used to display the value of one or more variables using a format string. The string can consist of any text, including placeholders for variables to be displayed. After the format string come the names of the variables to be displayed, in the order of their placeholders. "%d" is used to indicate a numeric variable, and "%s" is used to specify a string variable.

Simple examples of format strings and variables:

"The values of x and y are: (%d, %d)", x, y
"Current drawing material: %s", Sys$(91)
"This layer is named: %s", layname$
"The drawing %s contains %d drawing entities", fname$, entcount

See Also: FORMAT

COMPATIBILITY:Version 15 and later

EXAMPLE:

Sys(800) = 1

Precision 0

Break->

For i = 1 To 10

b$ = "I had", i, "eggs for breakfast"

Break-> "i = %d, b$ = %s", i, b$

Next i

Sys(800) = 0

End


Fillet

>Fillet

{

<Type t

[0 = normal fillet, 1 = keep original lines]

<Radius r

<Points: 1 = 1st line to fillet, 2 = 2nd line to fillet

}

This command rounds the intersection of two lines.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 0, 0, 0

<Pointxyz 20, 0, 0

<Pointxyz 20, 20, 0

}

>Fillet

{

<Type 0

<Radius 2

<Pointxyz 10, 0, 0

<Pointxyz 20, 10, 0

}


SymbolLoad

>SymbolLoad

{

<Filename "symbol.ext"

symbol to be loaded

<Scale s

[0 = changeable scale, 1 = original scale]

<Type t

[0 = not selected after merge, 1 = selected after merge]

<Reference r

[0=embedded, 1=loaded by reference]

<LoadAsBlock b (Version 13 and higher)

[0=load as symbol, 1=load as block]

<Points: 1,2,3 = handle placement

}

Loads an external drawing as a symbol.
To merge the contents of another drawing (as if you had activated the "explode symbol" option in the dialog box) use the Merge command instead of SymbolLoad.

Note: As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Compatibility: All versions; the LoadAsBlock parameter is only present in Version 13 and higher

Example:

name$ = "*\symbol\window.dcd"

>SymbolLoad

{

<Layer 1

<Filename [name$]

<Pointxyz 10, 3, 25.25

<Pointxyz 14, 3, 25.25

<Scale 1

}


ParallelByDistance

>ParallelByDistance

{

<Distance d

distance of parallel line from original line

<SelectOnly i

[0 = parallel any entity, 1 = parallel only selected entities]

<Points: 1 = original line, 2 = direction of parallel line

}

Draws a new line parallel to an existing line, at a specified distance.

Compatibility: All versions

Example:

>Circle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

}

>ParallelByDistance

{

<Color 255, 0, 128

<Distance 5

<Pointxyz 10, 0, 0

<Pointxyz 11, 0, 0

}


WmfIn

>WmfIn

{

<Filename "filename.wmf"

}

Imports a WMF file into the current drawing.

Compatibility: All versions

Example:

>WmfIn

{

<Filename "*\test.wmf"

<Layer 12

}


RedrawAll

>RedrawAll

{

}

Refreshes the screen image of all views.

Compatibility: All versions


Interfere

>Interfere

{

<Points: 1, 2 = solids to check

}

This command checks for interference (overlap) between two solids.

Result returned in Sys(657)

Compatibility: All versions

Example:

>Sphere

{

<Pointxyz 0, 0, 0

<Pointxyz 12, 0, 0

}

>Sphere

{

<Pointxyz 23, 0, 0

<Pointxyz 23, 12, 0

}

>Interfere

{

<Pointxyz 0, 12, 0

<Pointxyz 23, 12, 0

}


EA_Axis2 Parameter

EA_AXIS2 ParameterQuery and Change Parameters

EA_AXIS2

Declaration: Alias EA_AXIS1 &H040A

Arguments: Three floating-point numbers representing the coordinate of the end of the second axis (not necessarily the shortest axis).

Accessibility: Query only

Purpose: This parameter allows you to determine the endpoint of the second axis of the elliptical arc. To change this value, you must change the second radius with EA_RADIUS2.

Query Usage:

Query EA_Axis2, x2, y2, z2

where x2, y2, and z2 are all numeric variables.

Compatibility: Version 14 and higher


CLEARSTORAGE$ Statement

PURPOSE:To erase some or all SYSSTR_ ini files.

SYNTAX:CLEARSTORAGE$
CLEARSTORAGE$ n
CLEARSTORAGE$ m {, }n

EXPLANATION:This statement is used to erase one or more of the SYSSTR ini files that store the SysEx$() function values.

If the CLEARSTORAGE$ statement is used alone, all SYSSTR ini files (SysStr_001 – SysStr_100) will be erased.

If CLEARSTORAGE$ is followed by single number or expression n, then the single SysStr ini file whose numeric suffix matches n will be erased.

If CLEARSTORAGE$ is followed by a pair of numbers or expressions m and n, separated by a comma or a space, all SysStr ini files in the range from m to n will be erased. If n <= m, no files will be erased.

If three or more arguments are presented to the CLEARSTORAGE$ statement, the macro will report a syntax error.

COMPATIBILITY:Version 14 and later

EXAMPLE:

' Delete all SYSSTR_xxx.ini files

ClearStorage$

' Delete SYSSTR_010.ini only
ClearStorage$ 10

' Delete a range of SysStr ini files from 5 to 14
x = 5
ClearStorage$ x, x+9

' or

ClearStorage$ 5 14


PolygonCenter

>PolygonCenter

{

<Orientation o

[0 = vertex, 1 = midpoint of side]

<NSide s

number of sides

<Type t

[0 = line, 2 = plane]

<Points: 1 = center, 2 = radius, 3 = plane reference

}

Draws a polygon from the center to a point on it's perimeter.

Compatibility: All versions

Example: Draw two polygons, one just inside a circle, the other just enclosing the same circle.

rad = 10

Input "How many sides for the polygon", sides

angle1 = 360/(2*sides)

>SetStartPoint

{

}

>Circle

{

<Pointxyz 0, 0, 0

<Pointpolar [rad, 0, 0]

<Pointpolar [rad, 90, 0]

}

>PolygonCenter

{

<Orientation 1

<Pointxyz 0, 0, 0

<Pointxyz [rad, 0, 0]

<NSide [sides]

}

>PolygonCenter

{

<Orientation 0

<Pointxyz 0, 0, 0

<Pointpolar [rad, angle1, 0]

<NSide [sides]

}


EA_Center Parameter

EA_CENTER ParameterQuery and Change Parameters

EA_CENTER

Declaration: Alias EA_CENTER &H0401

Arguments: Three floating-point numbers for the coordinate of the ellipse's center

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the center location of an ellipse or elliptical arc. Changing the center will move the entire ellipse - the span angle, start angle, end angle, and radii remain the same.

Query Usage:

Query EA_Center, cx, cy, cz

where cx, cy, and cz are numeric variables

Change Usage:

Change EA_Center, cx, cy, cz

where cx, cy, and cz are numeric variables or expressions

Compatibility: Version 14 and higher


PlaneSubtract

>PlaneSubtract

{

<Points: 1 = plane to be subtracted, 2 = plane to be modified

}

This command subtracts plane 1 from plane 2.

Compatibility: All versions

Example:

>Plane

{

<Pointxyz 10, 30, 0

<Pointrel 0, 20, 0

<Pointrel 20, 0, 0

<Pointrel 0, -20, 0

}

>Plane

{

<Pointxyz 0, 0, 0

<Pointrel 10, 0, 0

<Pointrel 0, 20, 0

<Pointrel 30, 0, 0

<pointrel 0, 40, 0

<Pointrel -40, 0, 0

}

>PlaneSubtract

{

<Pointxyz 10, 30, 0

<Pointxyz 0, 0, 0

}


CL_InsertionPoint Parameter

CL_INSERTIONPOINT ParameterQuery and Change Parameters

CL_INSERTIONPOINT

Declaration: Alias CL_INSERTIONPOINT &H0B02

Arguments: Three floating-point numbers for the coordinate of the construction line's insertion point

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the starting location of a construction line. Changing the insertion point will move the entire construction line - the direction remains the same.

Query Usage:

Query CL_InsertionPoint, cx, cy, cz

where cx, cy, and cz are numeric variables

Change Usage:

Change CL_InsertionPoint, cx, cy, cz

where cx, cy, and cz are numeric variables or expressions

Compatibility: Version 14 and higher


CascadeWindows

>CascadeWindows

{

}

Cascades all the drawing view windows.

Compatibility: All versions


MaterialEdit

>MaterialEdit

{

}

Opens the Material Options dialog box.

Compatibility: All versions


ArrangeEntitiesByID

>ArrangeEntitiesByID

{

}

Sorts all entities so that they display in the order of their internal entity IDs (the 64-bit numbers exposed through OLE Automation --- not the same as the entity IDs returned in BasicCAD).
This is likely to change all entity IDs reported by BasicCAD!

Compatibility: Version 17.1 and higher


Circle

>Circle

{

<Type t

[0 = circle, 1 = vector circle, 2 = plane]

<Points: 1 = center, 2 = radius, 3 = plane reference (optional)

}

Draws a circle centered at the first point, with a radius determined by the second point

Compatibility: All versions

Example: Draw a circle parallel to the YZ Plane.

>SetStartPoint

{

}

>Circle

{

<Pointxyz 0, 0, 0

<Pointxyz 0, 10, 0

<Pointxyz 0, 10, 10

}


GOTO Statement

PURPOSE:To branch to another statement.

SYNTAX:GOTO label

EXPLANATION:This statement is used to transfer macro execution to another statement out of the normal sequence of execution. "Label" can be any valid DesignCAD macro label. GOTO can skip forward or backward in the macro.

See Also: GOSUB

COMPATIBILITY:All versions

EXAMPLE:

retry:

Input "enter a number less than 20: ", x

If x >= 20 Then Goto retry ' loops until x < 20


MaterialToolBox

>MaterialToolbox

{

}

Toggles the visibility of the Material Toolbox

Compatibility: All versions


GroupDefine

>GroupDefine

{

}

Defines the selected objects as a group

Compatibility: All versions


SelectLayer

>SelectLayer{

<Layer n

The layer number to be selected. There can be multiple Layer parameters in the command to select more than one layer

<Type t

[0 (default) - selects only the listed layers. All other items de-selected.

1 - Adds the listed layers to the current selection set.

-1 - Removes the selected layers from the selection set.]

}

The SelectLayer command allows the programmer to select or deselect multiple layers.

Note: This command will overwrite the editable and visible flags for any listed layers. In other words, if Layer 3 is invisible or non-editable, selecting it with SelectLayer will change Layer 3 to be both visible and editable. Pay attention to what you're doing...

Compatibility: All versions

Example:

>SelectLayer

{

<Layer 1

<Layer 5

<Layer 11

<Type 0 ' default; just here for clarity

}

' oops...I didn't want layer 11 after all...

>SelectLayer

{

<Layer 11

<Type -1

}


QUERY and CHANGE Parameters

Query and Change offer the ability to examine and change many kinds of information about an entity that has been selected with the Entity statement. Parameters are categorized by the type of entity they affect. Here is the current list of entity parameters that can be queried and/or changed. Default aliases for these parameters are declared in dcadalias.d3i.

Common Entity Parameters – the following parameters are common to most entities:

ENT_TYPE

ENT_LAYER

ENT_LAYERNAME

ENT_COLOR

ENT_LINETYPE

ENT_LINETYPENAME

ENT_LINETYPESCALE

ENT_LINEWIDTH

ENT_LINEFILL

ENT_LINEWEIGHT

ENT_FIXEDWIDTH

ENT_SELECTED

ENT_NPTS

ENT_POINT

ENT_MINBOUND

ENT_MAXBOUND

ENT_MATERIAL

ENT_MATERIALNAME

ENT_NHANDLES

ENT_GROUPINDEX

ENT_SOLIDINDEX

ENT_COLORBYLAYER

ENT_LINESTYLEBYLAYER

Double Line Entity Parameters – the following parameters are specific to double line entities.

DoubleLine entity type numbers are:

92 – Double Line

93 – Double Curve

94 – Double Bezier

95 – Double Circle/Arc

96 – Double Elliptical Arc

97 – Double Ellipse

DL_TRIM

DL_WIDTH

DL_CAPS

DL_FILL

DL_ALIGN

DL_HATCH

DL_HATCHNAME

DL_HATCHSCALE

DL_HATCHANGLE

Circle/Arc Entity Parameters – the following parameters are specific to circles and arcs.

Circle/Arc entity type numbers are:

16 – Circle/Circular Arc

95 – Double Circle/Arc

CA_CENTER

CA_RADIUS

CA_STARTANGLE

CA_ENDANGLE

CA_SPANANGLE

CA_DIRECTION

CA_STARTPOINT

CA_ENDPOINT

Ellipse/Elliptical Arc Entity Parameters – the following parameters are specific to ellipses and elliptical arc.:

Ellipse/Elliptical Arc entity type numbers are:

2 – Ellipse

7 – Elliptical Arc

96 – Double Elliptical Arc

97 – Double Ellipse

EA_CENTER
EA_RADIUS1

EA_RADIUS2

EA_STARTANGLE

EA_ENDANGLE

EA_SPANANGLE

EA_STARTPOINT

EA_ENDPOINT

EA_AXIS1

EA_AXIS2

Text Entity Parameters – the following parameters are specific to text entities.

Text entity type numbers are:

3 – 3D Text

13 – 2D Text

15 – Attribute

22 – Text Arc

71 – Attribute Definition

T_INSERTIONPOINT

T_SIZE

T_JUSTIFICATION

T_BOLD

T_ITALIC

T_ANGLE

T_FONTTYPE

T_FONT

T_2DTEXT

T_TEXT

Attribute Definition Entity Parameters – the following parameters are specific to attribute definition entities.

Attribute Definition entity type numbers are:

71 – Attribute Definition

A_VISIBLE

A_TAG

A_PROMPT

A_CONSTANT

A_VALUE

Text Arc Entity Parameters – the following parameters are specific to text arc entities.

Text Arc entity type numbers are:

22 – Text Arc

TA_CENTER

TA_RADIUS

TA_STARTANGLE

TA_ENDANGLE

TA_SPANANGLE

TA_STARTPOINT

TA_ENDPOINT

TA_VSCALE

TA_DIRECTION

Hatch Entity Parameters – the following parameters are specific to hatch entities.

Hatch entity type numbers are:

17 – Hatch

H_PATTERN

H_PATTERNNAME

H_SCALE

H_ANGLE

H_TYPE

Arrow Entity Parameters – the following parameters are specific to arrow entities.

Arrow entity type numbers are:

25 – Arrow

AW_TYPE

AW_SCALE

AW_SIZE

AW_DOUBLE

Dimension Entity Parameters – the following parameters are specific to dimension entities.

Dimension entity type numbers are:

74 – Angle Dimension

75 – Linear Dimension

76 – Diameter/Radius Dimension

77 – Arc Dimension

78 – Progressive Radial Dimension

79 – Progressive Linear Dimension

80 – Chamfer Dimension

81 – Coordinate Dimension

D_ARROWTYPE

D_ARROWSCALE

D_ARROWSIZE

D_TEXTSIZE

D_FONTTYPE

D_FONT

D_PRECISION

D_FIXEDTEXT

D_TRUNCATEZEROS

D_TEXTBOLD

D_TEXTITALIC

D_TEXTFORMAT

D_TEXTLOCATION

Construction Line Entity Parameters – the following parameters are specific to construction line entities.

Construction Line entity type numbers are:

68 – Construction Line

CL_RAY

CL_INSERTIONPOINT

CL_DIRECTION

Point Mark Entity Parameters – the following parameters are specific to point mark entities.

Point Mark entity type numbers are:

70 – Point Mark

PM_TYPE

PM_SIZE

PM_CENTER

Parameters common to all Bitmap entities begin with BM_ and are in the &H0D00 range.

Bitmap entity type numbers are:

90 – Bitmap

BM_INSERTIONPOINT

BM_NAME

BM_TYPE

BM_WIDTH

BM_HEIGHT

BM_ANGLE

Parameters common to all Symbol entities begin with SY_ and are in the &H0E00 range.

Symbol entity type numbers are:

26 – Symbol (this type includes both blocks and symbols. Check the SY_TYPE parameter to see which one it is.)

SY_INSERTIONPOINT

SY_NAME

SY_TYPE

SY_XSCALE

SY_YSCALE

SY_ZSCALE

SY_ATTDEFCOUNT

SY_ATTDEFTAG

SY_ATTDEFPROMPT

SY_ATTDEFVALUE

SY_ATTDEFCONSTANT

SY_ATTRIBUTECOUNT

SY_ATTRIBUTE


D_ArrowType Parameter

D_ARROWTYPE ParameterQuery and Change Parameters

D_ARROWTYPE

Declaration: Alias D_ARROWTYPE &H0A01

Arguments: A numeric value (integer [0 - 13]) indicating the dimension arrowhead type.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to determine or change a dimension entity's arrowhead type.

Query Usage:

Query D_ArrowType, artype

where artype is a numeric variable.

Change Usage:

Change D_ArrowType, artype

where artype can be a numeric variable or expression.

Compatibility: Version 14 and higher


LayerCopy

>LayerCopy

{

<LayerFrom n1

<LayerFrom n2

<LayerFrom n3

<LayerFrom n...layers to be copied from

<LayerTo -- destination layer

}

This command duplicates the contents of one or more layers to another layer.

Compatibility: All versions

Example: Copy layers 1, 10, and 24 to layer 37.

For i = 1 To 30

>Box

{

<Layer [i]

<Color [8*i, 255 - 8*i, (128 + 8*1)\ 256]

<Pointxyz [5 * i, 0, 0]

<Pointxyz [5 * i + 4, 4, 4]

}

Next i

>LayerCopy

{

<LayerFrom 1

<LayerFrom 10

<LayerFrom 24

<LayerTo 37

}


SY_AttDefPrompt Parameter

SY_ATTDEFPROMPT ParameterQuery and Change Parameters

SY_ATTDEFPROMPT

Declaration: Alias SY_ATTDEFPROMPT &H0E09

Arguments: An integer for the index of the desired Attribute Definition in this block, and a string to hold the Prompt string of the indexed Attribute Definition.

Accessibility: Query only

Purpose: This parameter allows the programmer to extract the Prompt string from a specific Attribute Definition in a block.

Query Usage:

Query SY_AttDefPrompt, adindex, adprompt$

where adindex is a numeric variable and adprompt$ is a string variable

Compatibility: Version 14 and higher


Workplane

>Workplane

{

<Points: 1 = workplane origin,
2 = point on plane's positive x axis,
3 = point on plane's positive y axis

<Name workplanename$ -- the name of this working plane

<Text description$ -- a text description of the working plane. You may embed "\r\n" in the string to wrap text to the next line in the dialog box.

}

Defines a custom working plane (or User Coordinate System). As soon as the workplane is defined, the coordinate system is transferred to the plane's coordinate system. The new coordinate system remains in effect until the UnWorkplane command is issued.

Compatibility: All versions. The Name and Text parameters only exist for Version 13 and higher.

Example:

>Box

{

<Color 0, 0, 0

<Pointxyz 0, 0, 0

<Pointxyz 20, 20, 20

}

>Slice

{

<Pointxyz 10, 20, 0

<Pointxyz 20, 20, 10

<Pointxyz 20, 10, 0

<Pointxyz 20, 20, 0

}

>Workplane

{

<Pointxyz 10, 20, 0

<Pointxyz 20, 20, 10

<Pointxyz 5, 30, 5

<Name "CornerUCS"

<Text "UCS along sliced corner"

}

>Line

{

<Color 255, 0, 0

<Pointxyz 5, 5, 0

<Pointrel 10, 0, 0

<Pointrel 0, 10, 0

<Pointrel 0, 0, 10

}

>Unworkplane

{

}

>Line

{

<Color 0, 0, 255

<Pointxyz 5, 5, 0

<Pointrel 10, 0, 0

<Pointrel 0, 10, 0

<Pointrel 0, 0, 10

}


New Sys Functions

New and Enhanced Sys Functions

10 – Current units of measurement for printing [1 = inches, 25.4 = mm, 2.54 = cm, 0.0254 = m, 0.0000254 = km, 0.08333333 = feet, 0.0000157828282828282 = mi]
(new values added for feet, km, and miles in Version 15; see also Sys(1114))

14 – Sets the Display Grid type * New in 16
[0=Ortho, 1=Isometric, 2=Polar]

16 – Enable/Disable Use Plot Range Box * New in 15
[0=Disable, 1=Enable]
If enabled, draws a rectangle around the plot boundary when exporting HPGL files. If disabled, no border is plotted.

19 – Sets the minor Display Grid spacing along X (or Angular spacing for Polar grid) * New in 16

20 – Sets the minor Display Grid spacing along Y(or Radial spacing for Polar grid) * New in 16

51 – Display Arcs as Vectors * New in 14
[0 = Disable, 1 = Enable] If this is set to zero, arcs are drawn using Windows API functions exclusively. The default setting is 1, whereby arcs are displayed as vector approximations in order to prevent display anomalies where an arc joins the end of a line.

52 – Sets the major Display Grid divisions along X (or Angular spacing for Polar grid) * New in 16

53 – Sets the major Display Grid divisions along Y (or Radial spacing for Polar grid) * New in 16

54 – Sets the Display Grid style * New in 16
[0=lines, 1=dots, 2=crosses]

55 – Sets the Display Grid Angle (in degrees) for isometric display grids * New in 16
[0 – 360]

72 – Graphics Acceleration Setting for Hidden Line Removal* New in 15
[0=off (default), 1=on]

81 - SetPoint behavior * New in 14
[0=clear buffer (default), 1 = append points to buffer]
Normally, when you run the SetPoint statement, it clears any previous points from the point buffer. If Sys(81) is set to 1, you can run multiple SetPoint statements to accumulate more and more points.

100 – Line Fill Spacing for HPGL Export * New in 15
Controls the spacing between line fill pen strokes. Distance in plotter units.

112 - Depth of Nested Folders in Symbol Library window * New in 15.1
Sets the number levels of nested folders under the symbol library search path. Default value of 1, which only shows a tab for the target path and any folders immediately beneath it that contain drawing files. Higher values will show tabs for increasingly deeper folder levels. Once this value is changed, if you have already opened the Symbol Library command you may have to manually browse to a different folder and then back again in order to update the Symbol Library display.

139 – Sets/Clears the "Trim Picked Segments Only" options in Trim commands * New in 17
[0 = off, 1 = on]
Version 17 offers a new option in the Trim commands: Trim Picked Segments Only. This option affects whether or not segments beyond the selected segment are also trimmed away.

140 – Sets/Clears the "Grid Smoothly Degrade" checkbox in Grid Options * New in 17
[0 = off, 1 = on]
If this is set to 1, the display grid will smoothly reduce the number of visible grid lines as you zoom out. If it is set to 0, the grid will become invisible if you zoom out too far to display every grid division.

269 - Number of Arc Segments * New in 16
This function how many segments to create when an arc, ellipse, or circle is created as a plane or line.
Note 1: this only affects initial creation – it does not affect conversion to plane or vector after the object is created.
Note 2: This represents the total number of segments for the new entity – 20-degree arcs and full circles will have the SAME NUMBER OF SEGMENTS. For example, if it is set to 20, a circle drawn with the "create as line" option will have 20 segments, as will a 20-degree arc created with the "Save as line" option.

270 – Display Entities by Layer Order [0 disables, 1 enables] * New in 16
CHANGED IN 17.1 -- Display by Layer Order flag removed. Added instead:
AutoName Entities when Created [0 disables, 1 enables]

271 – Layer List Filter Mode* New in 16
[ 0 = Active Layers Only, 1 = Named Layers Only, 2 = Active Or Named Layers Only, 3 = All Layers, 4 = Layer Groups Only]

272 – Layer List Sort Mode* New in 16
[ 0 = by index, 1 = by status, 2 = by name, 3 = by content]

273 – Number of Multiline Styles in the current document (Read_Only)* New in 16

274 – Number of Layer Groups in the current document (Read_Only)* New in 16

275 – Visibility of Symbol Layers controlled by Symbol Host Layer * New in 17.1
[0 = no, 1 = yes]
If this is set to 1, you can not hide individual layers inside symbols; the entire symbol is hidden or shown based on the visibility of its host layer.
When this is set to 0, you may hide or show entities inside the symbol by hiding or showing their original layers.

279 – MultiLine Mode Status * New in 16
[0 = off, 1 = on]
If MultiLine Mode Status is on, all new lines will be drawn as multilines.

280 – Current Layer Group Number * New in 17

281 – Current Layer Group Status * New in 17
[0 = invisible, not editable,
2 = visible, not editable
4 = visible and editable]

282 – Select Invisible Attributes * New in 17.1
[0 = off, 1 = on]
If on, allows selection of hidden attributes on visible editable layers (thus emulating attribute selection behavior in Version 13 and earlier)
If off, only visible attributes on editable layers can be selected.

283 – Opaque Texture Maps * New in 17.2
[0 = off, 1 = on]
If this flag is on, texture maps completely obscure the wireframe color of the texture-mapped object. If it is off, the color of the texture map blends with the wireframe color fo the object. This affects both accelerated and native shading modes.

309 – Major Grid Color (Red value) * New in 16
[0 – 255]

310 – Major Grid Color (Green value) * New in 16
[0 – 255]

311 – Major Grid Color (Blue value) * New in 16
[0 – 255]

375 – Current MultiLine Style index * New in 16

376 – Minor Display Grid Color (Red value) * New in 16
[0 – 255]

377 – Minor Display Grid Color (Green value) * New in 16
[0 – 255]

378 – Minor Display Grid Color (Blue value) * New in 16
[0 – 255]

445 – Arrowhead size (non-dimension arrows) * New in 16

530 - Layer uses specific color (0/1) * New in 14
(don't set this unless you've already set 531, 532, and 533)

531 - layer red (default 0) * New in 14

532 - layer green (default 0) * New in 14

533 - layer blue (default 0) * New in 14

534 - layer uses specific linestyle (0/1) * New in 14

535 - linetype (default 0) * New in 14

536 - linescale (default 2) * New in 14

537 - unit-based linewidth (default 0) * New in 14

538 - layer uses fixed linewidth (0/1) * New in 14
if 0, use the width specified by Sys(537);
if 1, use the linewidth specified by Sys(539)

539 - fixed linewidth in hundredths of mm (ex. 50 = .5 mm). * New in 14
If the width specified does not match one of the preset values, the actual width will change to the next lowest preset width value (0.00, 0.05mm, 0.09mm, 0.13mm, etc.), so for example 12 would revert to 9, for 0.09mm.

540 - layer uses filled lines * New in 14

541 - enforce layer color settings on all new entities * New in 14

542 - enforce layer linestyle settings on all new entities * New in 14

550 - Default Fixed Lineweight (in 1/100ths of a millimeter) * New in 14
[1=visible, 2 = hidden]
This function indicates the current default linewidth if fixed lineweight is active (and no layer settings override the default setting).

551 - Fill fixed-weight lines (applies to on-screen display only) * New in 14
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be filled on-screen.

552 - Display Fixed-weight lines onscreen * New in 14
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be displayed at their fixed width on-screen.

553 - Print Fixed-weight lines * New in 14
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be printed at their set fixed width. If both Sys(553) and a print-option pen weight are specified, then the print-option width will be the minimum lineweight printed.

554 - Scale factor for fixed-weight lines (per-session only, not stored in the drawing) * New in 14
This function allows you to scale the fixed-weight lines if desired when printing to different sizes than usual. For example, if you normally print a D-size plot, and need to do a letter-sized test print, you can scale the fixed-weight lines down to avoid losing details due to the fixed line width.

555 - Attribute Definition behavior when exploding blocks * New in 14
[1=explode to attribute (uses the text contents, not the tag name)
2=leave as attribute definition]
This function allows you to control what happens to attribute definitions when a block is exploded.

1035 – Reconstruct grids after solid operations [0=no, 1=yes] *New in Version 15
By default, DesignCAD will attempt to combine adjacent facets from a cut grid entity into one or more new grids. By turning this flag off, all facets of a cut grid will be converted to planes.

1036 -- selectable invisible attributes? [0=no, 1 = yes] *New in Version 15
If this is set to 1, SelectAll will select both visible and hidden attributes on visible layers.

Sys(1100) – (1130) are all new to Version 15

1100 – Current Units of Measurement
[0 = none, 1 = inches, 2 = feet, 3 = miles, 4 = mm, 5 = cm, 6 = m, 7 = km]

1101 – Default Units of Measurement for new drawings [0 = none, 1 = inches, etc.]

1102 – Default Units of Measurement for unitless drawings [0 = none, 1 = inches, etc.]

1103 – Interruptible Snap Mode [0 = off, 1 = on]

1104 – Running Snap Mode [0 = off, 1 = on]
Which snaps are on during Running Snap Mode is determined by Sys(1105) – (1109)

1105 – Running Gravity Snap [0 = disabled, 1 = enabled]

1106 – Running Line Snap [0 = disabled, 1 = enabled]

1107 – Running Midpoint Snap [0 = disabled, 1 = enabled]

1108 – Running Intersect-1 Snap [0 = disabled, 1 = enabled]

1109 – Running Tangent Snap [0 = disabled, 1 = enabled]

1110 – Current Toolbars Visibility [0 = off, 1 = on]

Reflects the current status of Show All Toolbars command

1111 – Snap to Hatch points [0 = disabled, 1 = enabled]

1112 – File Lock [0 = unlocked, 1 = locked by another instance of DesignCAD]

1113 – Drawing Handles Visible[0 = no, 1 = yes]

1114 – Printing Base Units [1 = inches, 2 = feet, 3 = mi, 4 = mm, 5 = cm, 6 = m, 7 = km]
(See also Sys(10))

1115 – Explode Symbols/Blocks at Top-Level only
[0 = no (explodes recursively) 1 = yes (retains sub-blocks or symbols)]

1116 – PresetPoint Mode [0 = off, 1 = on]

1117 – Skip font data when saving DC2/DC3 ASCII files. [0 = off, 1 = on]

1118 – Ortho tolerance angle (Default value 10 degrees)
This setting controls the maximum deviation from horizontal/vertical axes that the Ortho command will convert to horizontal or vertical.

1119 – Truncate trailing zeros in dimensions? [0 = no, 1 = yes]

1120 – Truncate trailing zeroes in angular dimension? [0=no, 1=yes]

1121 – Truncate trailing zeroes in arc dimensions? [0=no, 1=yes]

1122 – Truncate Trailing zeroes in chamfer dimensions? [0=no, 1=yes]

1123 – Truncate trailing zeros in diameter dimensions? [0=no, 1=yes]

1124 – Truncate trailing zeros in radius dimensions? [0=no, 1=yes]

1125 – Truncate trailing zeros in coordinate dimensions? [0=no, 1=yes]

1126 – Truncate trailing zeros in progressive dimensions? [0=no, 1=yes]

1127 – Truncate trailing zeros in progressive radius dimensions? [0=no, 1=yes]

1128 – Truncate trailing zeros in distance-only dimensions? [0=no, 1=yes]

1129 – Truncate trailing zeros in baseline dimensions? [0=no, 1=yes]

1130 - – Truncate trailing zeros in extended dimensions? [0=no, 1=yes]


Ent_GroupIndex Parameter

ENT_GROUPINDEX ParameterQuery and Change Parameters

ENT_GROUPINDEX

Declaration: Alias ENT_GROUPINDEX &H0115

Arguments: One number (integer) for the entity's group index

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's group association.

Query Usage:

Query Ent_GroupIndex, egroup

where egroup is a numeric variable

Change Usage:

Change Ent_GroupIndex, egroup

where egroup is a numeric expression or variable

Compatibility: Version 14 and higher


Arc2

>Arc2

{

<Type t

[0 = arc, 1 = line]

<Radius r

radius of the arc

<Points: 1 = start, 2 = end, 3 = plane reference (optional)

}

Draws an arc of specified radius, in a counterclockwise direction, between the given starting point and ending point, with an optional third point to specify the arc's planar orientation.

Note: The arc cannot span more than 180°, and is always drawn counterclockwise from point 1 to point 2.

Compatibility: All versions

Example: Draw a 180° arc with radius 10, lying in the xz plane, with the base oriented along the X axis and the top pointing toward positive Z.

>Arc2

{

<type 0

<radius 10.0

<pointxyz 10, 0, 0

<pointxyz -10, 0, 0

<pointxyz 0, 0, 10

}


Arc3

>Arc3

{

<Type t

[0 = arc, 1 = line]

<Points: 1 = start, 2 = point on arc, 3 = end

}

Draws an arc that starts at the first point, passes through the second point, and ends at the third point.

Compatibility: All versions

Example: Draw a dashed arc that fits snugly around an equilateral triangle.

'step 1: Draw the triangle

>Line

{

<Color 255, 0, 0

<pointxyz 0, 0, 0

<pointpolar 20, 0, 0

<pointpolar 20, 120, 0

<pointpolar 20, 240, 0

}

'step 2: Draw the arc

>Arc3

{

<Color 0, 0, 255

<Linestyle 1, 1.5, 0

<pointxyz 20, 0, 0

<pointpolar 20, 120, 0

<pointpolar 20, 240, 0

<Type 0

}


Arc4

Arc4

{

<Type t

[0 = arc, 1 = line]

<Radius r [-1 (and any value <= 0) = off, any positive value used as fixed radius for the arc] (The Radius parameter is new to Version 15. Newer macros should make it a point to explicitly specify this value – otherwise the macro's behavior may be altered depending on what the user last specified manually in the dialog box when using this command)

<Points: 1 = center, 2 = start, 3 = end

The arc is drawn counterclockwise from point 2 to point 3.

}

Draws an arc from the given center point and starting point, which spans an angle defined by the third point.

Note: If the Radius pararameter is specified as a positive non-zero value, the arc is drawn with that fixed radius; otherwise the radius of the arc is determined by the distance of point 2 from point 1. Point 3 specifies the span angle; the arc will terminate at an imaginary line passing through points 1 and 3.

Compatibility: All versions. The Radius parameter exists only in V15 and later.

Example:

>Arc4

{

<Linestyle 0, 1, 0

<Pointxyz 0, 0, 0

<Pointxyz 0, 10, 0

<Radius 0 'turns off fixed-radius option

Message "Set a third point for the arc."

<Incomplete

}


Arc5

>Arc5

{

<Type t

[0 = arc, 1 = line]

<Points: 1 = start, 2 = end, 3 = radius

}

Draws an arc with the given starting point and ending point, with the center defined by the third point.

Compatibility: All versions

Example:

>Arc5

{

<Linestyle 0, 1, 0

<Pointxyz 10, -10, 0

<Pointxyz -10, -10, 0

<Pointxyz 0, 10, 0

}


Arc6

>Arc6

{

<type t

[0=arc, 1=line]

<radius r

<length l

<Points: 1,2=line tangent to beginning of arc, 3=direction

}

Draws an arc tangent to the direction given by points one and two.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 12, 15, 0

<Pointxyz 25, 14, 0

}

Input "radius? ", rad

Input "Arc length? ", l

>Arc6

{

<Radius [rad]

<Length [l]

<Type 0

<Pointxyz 12, 15, 0

<Pointxyz 25, 14, 0

<Pointxyz 27, 18, 0

}


Perimeter

>Perimeter

{

<Silent [0 = no, 1 = yes] – show/hide the result dialog box (V17.1)

<Points: points around the perimeter to be measured

}

This command measures the length of the line represented by the set points. The result is returned in Sys(658).

Compatibility: Version 17 and higher

Example:

>Perimeter

{

<Pointxyz 15, 10, 0

<Pointxyz 25, 15, 0

<Pointxyz 15, 15, 0

<Pointxyz 15, 10, 0

<Silent 1

}

Precision 4

Message "The perimeter is: ", Sys(658)


Area

>Area

{

<Points: 1 = start, 2 = second point, etc. around perimeter

}

Measures the area bounded by a sequence of points.

The Area result is returned in Sys(655). To avoid displaying the dialog box, use the Area() function instead.

Compatibility: All versions

Example: Illustrate the difference between the Area() function and the Area command.

' first, draw a 10 x 10 2D box; area = 100, perimeter = 40.

>2DBox

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 10, 0

<Type = 1

<Orientation = 0

}

' next, select the box, and find its entity id

>Pointselect

{

<Pointxyz 10, 10, 0

}

If Sys(80) = 1 Then

Getselect 1, id

Else

Print "Box was not selected..."

Anykey

Stop

EndIf

' now, use the Area(n) function

Print "The Area of the box is ", Area(id)

Anykey

' Here we use the Entity statement to place all the points in memory so we can retrieve them with pointval and store them into an array. We will need to set each point in the box to measure the area.

Entity id

k = Sys(99)

Dim x(k), y(k), z(k)

For j = 1 To k

Pointval x(j) y(j) z(j) j

Next j

Sys(80) = 0

Sys(1) = 0

'now, use the Area command.

>Area

{

'set each point in the box

For j = 1 To k

<Pointxyz [x(j), y(j), z(j)]

Next j

}


DeleteLayerGroup

>DeleteLayerGroup

{

<LayerGroupIndex gi

}

Deletes the specified layer group. No entities are deleted; only the layer grouping is deleted.

Compatibility: Version 17 and higher


H_Type Parameter

H_TYPE ParameterQuery and Change Parameters

H_TYPE

Declaration: Alias H_TYPE &H0805

Arguments: An numeric value (integer [0,1]) indicating whether the hatch pattern is a vector fill or a raster fill.
Values: 0 = native (vector), 1 = windows (raster).

Accessibility: Query Only

Purpose: This parameter is used to indicate whether the current entity's hatch pattern is a vector pattern or a raster pattern. Raster patterns cannot be scaled.

Query Usage:

Query H_Type, htype

where htype is a numeric variable

Compatibility: Version 14 and higher


HatchFill

>HatchFill

{

<Scale s

pattern scale

<Angle a

pattern angle

<Type t

hatch pattern: 0 = ANGLE, 1 = ANSI31, 2 = ANSI32, etc.
Since there may be custom hatch patterns in the drawing, this parameter is unreliable from system to system. Instead, your new macros should use the new Name parameter instead.

<Name Pattern$

hatch pattern name: "ANGLE", "HEX", "WIN_SOLID", etc.
This parameter is now preferred over the Type parameter.

<UseScreenArea bUse (new to Version 16)

If set to 1, the hatch fill will be limited to the visible screen area. If set to zero, the hatch fill will only be restricted by object boundaries, and may extend beyond the visible screen area..

<Aperture ap (new to Version 17.1)

specifies the maximum gap distance (in pixels) that the command will ignore when determining the hatch boundary. The default value is typically zero, but in some cases may need to be increased to avoid "flooding". This value need not be a whole number.

<Point inside area to be filled

}

This command fills an enclosed region with a hatch pattern.

Note:This command will only work in 2D Mode.

Compatibility: All versions. UseScreenArea parameter is only available in Version 16 and higher. Aperture parameter is only available in Version 17.1 and higher.

Example:

If NOT Sys(344) Then

>2DMode

{

}

End If

>2DBox

{

<Type 1

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

}

>HatchFill

{

<Name "Brass"

<Angle 30

<Scale 0.75

<Pointxyz 10, 5, 0

}


ApplyLineStyle

>ApplyLineStyle

{

<ApplyLineScale

if present applies Line Scale setting

<ApplyLineType

if present applies LineType. Also applied by default if no parameters present.

<ApplyFill

if present applies Fill Wide Lines setting

<ApplyWidth

if present applies Line Width

}

Applies the specified current line style settings to the selected objects. For backwards compatibility, if no parameters are specified, only the LineType is applied. Double Line entities are unaffected.

Note that the parameters for this command require no arguments (i.e. no "true" or "false" or numeric settings). If the parameter is present, that setting is applied to the selected items.

The current Line Type can be obtained from Sys(4), Line Scale from Sys(5), Line Width from Sys(6), and Fill status from Sys(24).

Compatibility: All versions

Example: Apply the current LineType and Scale to the selected lines.

>ApplyLineStyle

{

<ApplyLineType

<ApplyLineScale

}


CoordinateBar

>CoordinateBar

{

}

Toggles the visibility of the Coordinate Bar.

Compatibility: All versions


LoadToolbox

>LoadToolbox

{

<Filename "filename.dct"

}

Load a custom toolbox from a dct file.

Note: You can use an asterisk in front of the filename as a shortcut for the path to the DesignCAD directory. The DCT file format is described later in this documentation.

Compatibility: All versions

Example:

>LoadToolbox

{

<Filename "*\mytoolbox.dct"

}


PresetPointMode

>PresetPointMode

{

}

Toggles Preset Point Mode off and on. You can determine if Preset Point Mode is currently active by testing Sys(1116).

Compatibility: Version 15(?) and higher

Example: Turn on PresetPointMode if not active

If (Not Sys(1116)) Then

>PresetPointMode

{

}

End If


DL_HatchScale Parameter

DL_HATCHSCALE ParameterQuery and Change Parameters

DL_HATCHSCALE

Declaration: Alias DL_HATCHSCALE &H0208

Arguments: One number (floating-point) representing the hatch pattern scale used by the entity's fill pattern

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the scale used by the doubleline entity's fill pattern.

Query Usage:

Query DL_HATCHSCALE, edlhatchscale

where edlhatchscale is a numeric variable

Change Usage:

Change DL_HATCHSCALE, edlhatchscale

where edlhatchscale is a numeric variable or expression

Compatibility: Version 14 and higher


SectionTrim

>SectionTrim

{

<Point 1 -- first corner of trim rectangle

<Point 2 -- opposite corner of trim rectangle

<SelectOnly [so] 0 = trim everything, 1 = trim selected entities only

<TrimArea [inside] 0 = trim away everything OUTSIDE the rectangle, 1 = trim everything INSIDE the rectangle

}

Deletes either the inside or outside of a rectangular section of the drawing or selected entities.

Note: In version 17 and later, SectionDeleteCut and CutoffDel are automatically mapped to the SectionTrim command. (Version 17.1 also automatically sets the <TrimArea parameter to 1 for these two commands. Version 17.0 simply uses the most recent setting of the TrimArea parameter for CutoffDel and SectionDeleteCut.)

Compatibility: Version 17 and higher.


PRINT # Statement

PURPOSE:To output data to a disk file.

SYNTAX:PRINT #file, { list of expressions }

EXPLANATION:The PRINT # statement is used to output numeric and/or string expressions to a disk file. It is identical to the PRINT statement, except the data is output to disk rather than the screen. File is the file number that was used in the OPEN statement.

The file must have been opened using the OPEN statement before this statement is executed. Numeric expressions are output in ASCII format. If no expressions are used with a PRINT # statement, a blank line is output.
(The previous sentence should be true, but it is currently not working that way. To output a blank line, you must currently use the following syntax:
Print #1, ""
This behavior appears to have been broken for several versions now; it is currently under review.) FIXED IN 17.1
A carriage return and line feed are output after each PRINT # statement - unless the statement ends with a semicolon, in which case the next PRINT # statement will begin at the end of the previous line.

The PRINT # statement can be used to output to a local parallel-port printer by opening the file "LPT1" with the OPEN statement. (This may not be possible for all versions of Windows, however.)

See Also: OPEN, PUT

COMPATIBILITY:All versions

EXAMPLE:

Open "o", 1, "fileone.txt"

Open "o", 2, "filetwo.txt"

Print #1, j, " is the current value."

Print #2, "x = ", x

j = 2

Print #j, x, y, z

Print #1,

Print #1, "abcd"; 'note the ending semicolon

Print #1, "efgh"

' "abcdefgh" will be printed to the file


SY_AttDefTag Parameter

SY_ATTDEFTAG ParameterQuery and Change Parameters

SY_ATTDEFTAG

Declaration: Alias SY_ATTDEFTAG &H0E08

Arguments: An integer for the index of the desired Attribute Definition in this block, and a string to hold the Tag value of the indexed Attribute Definition.

Accessibility: Query only

Purpose: This parameter allows the programmer to extract the Tag string from a specific Attribute Definition in a block.

Query Usage:

Query SY_AttDefTag, adindex, adtag$

where adindex is a numeric variable and adtag$ is a string variable

Compatibility: Version 14 and higher


BM_Angle Parameter

BM_ANGLE ParameterQuery and Change Parameters

BM_ANGLE

Declaration: Alias BM_ANGLE &H0D06

Arguments: A floating-point number representing the rotation angle of the image.

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine the image's rotation angle in the viewing plane.

Query Usage:

Query BM_Angle, bmangle

where bmangle is a numeric variable

Compatibility: Version 14 and higher

Example:

' assumes a bitmap has already been loaded and selected

Include "*\dcadalias.d3i"

GetSelect 1, i

Entity i

Query BM_Name, bmname$

Query BM_InsertionPoint, bmx, bmy, bmz

Query BM_Type, bmtype

Query BM_Width, bmwidth

Query BM_Height, bmheight

Query BM_Angle, bmangle

fmt$ = "Name: %s; Type: %d; Width: %f; height: %f; angle: %f"

Format msg$, fmt$, bmname$, bmtype, bmwidth, bmheight, bmangle

Message msg$

End


3DSelectMode

>3DSelectMode

{

}

Note: This command forces the program into 3D Selection Mode.

Compatibility: All versions


SliceBySurface

>SliceBySurface

{

<Points: 1 = object to be sliced, 2 = cutting surface (order of points can be reversed)

}

Slice an object along a cutting surface. The cutting surface must extend beyond the edges of the object to be sliced.

Compatibility: All versions

Example:

If (Sys(344)) Then

>2DMode

{

}

End If

>Cylinder

{

<Pointxyz 0, -10, 0

<Pointxyz 5, -10, 0

<Pointxyz 5, 10, 0

}

>Plane

{

<Pointxyz -6.0, 0, -6.0

<Pointxyz 6.0, 0, -6.0

<Pointxyz 6.0, 0, 6.0

<Pointxyz -6.0, 0, 6.0

}

>SliceBySurface

{

<Pointxyz 5, -10, 0

<Pointxyz 6.0, 0, 6.0

}

>PointSelect

{

<Pointxyz 5, 10, 0

}

>SetHandle

{

<Pointxyz 5, 10, 0

}

>Move

{

<Pointxyz 5, 15, 0

}


Copy

>Copy

{

}

Copies the selected items to the clipboard.

Compatibility: All versions

Example:

>Box

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>PointSelect

{

<Pointxyz 12, 12, 0

}

>SetHandle

{

<Pointxyz 12, 12, 0

<Pointxyz 36, 24, 0

}

>Copy

{

}

>Paste

{

<Type 0

<Pointxyz 12, 24, 0

<Pointxyz 40, 24, 0

}


Line

>Line

{

<Incomplete - (optional)

}

This command draws a line.

Compatibility: All versions

Example: Draw a "+" shape in the xz plane.

>Line

{

<Pointxyz 0, 0, 0

<Pointpolar 10, 0, 2

<Pointpolar 10, 90, 2

<Pointpolar 10, 0, 2

<Pointpolar 10, -90, 2

<Pointpolar 10, 0, 2

<Pointpolar 10, -90, 2

<Pointpolar 10, 180, 2

<Pointpolar 10, -90, 2

<Pointpolar 10, 180, 2

<Pointpolar 10, 90, 2

<Pointpolar 10, 180, 2

<Pointpolar 10, 90, 2

}


DimAngle

>DimAngle

{

<Type t

[0 = single dimension entity, 1 = exploded dimension]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<Size s

dimension text size - if 0.0, uses default text size

<Gap g

distance between measured points and bottom of leader lines

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot d

distance between arrow tips and top of leader lines

<Orientation o

text orientation [0 = tangent to arc, 1 = horizontal]

<Precision p

number of digits past the decimal in the dimension text

<Format f

angular text format [0 = degrees, 1 = grads, 2 = radians, 3 = DMS]

<Location k

location of text [0 = outside arrows, 1 = inside arrows]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text (only affects tolerance type 2)

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Prefix i$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Suffix j$

dimension suffix ["0" = none, "1" = custom1, etc.]

<Text fixed$

If present, sets the fixed dimension text

<Points: 1 = center, 2 = start angle, 3 = end angle, 4 = arrow location

}

Draws an angle dimension.

Compatibility: All versions

Example:

>DimAngle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 7, 7, 0

<Pointxyz 10, 12, 0

<Arrowhead 1

<Arrowsize 1

<Size 1

<Orientation 1

<Prefix "0"

<Suffix "0"

<Tolerancetype 0

<Location 0

}


PointSelectMode

>PointSelectMode

{

}

Toggles Point Select Mode status.

Note: You can check the value of Sys(345) to determine if Point Select Mode is currently active.

Compatibility: All versions

Example: Make sure PointSelectMode is active.

If NOT(Sys(345)) Then

>PointSelectMode

{

}

End If


CloseAll

>CloseAll

{

<SaveChanges s

[0 = no, 1 = yes]
if SaveChanges is set to 0, all documents will close quietly without prompting you to save any changes. If SaveChanges is set to 1, any documents that have unsaved changes will prompt you to save them.

}

Closes all currently open drawings.

Note: After running this command, your macro will effectively end, since macros require at least one open document to function.

Compatibility: Version 15 and higher

Example:

>Sphere

{

<Orientation 2

<Pointxyz 10, 10, 0

<Pointxyz 20, 10, 0

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>CircularArray

{

<Angle 1800

<Axis 1

<Ncopy 26

<Offset 120

<Pointxyz -5, 0, 0

}

>CloseAll

{

<SaveChanges 1

}


SolidAdd

>SolidAdd

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1, 2 = solids to be added

}

Adds two solids together.

Compatibility: All versions

Example:

>Cone

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 20, 0

}

>Sphere

{

<Pointxyz 0, 20, 0

<pointxyz 0, 25, 0

}

>SolidAdd

{

<Pointxyz 5, 0, 0

<pointxyz 0, 25, 0

}


LoadPSTemplate

>LoadPSTemplate

{

<Filename "filename.tps"

}

Note: As with the DxfIn command, you may use an asterisk in front of the filename for a shortcut to the DesignCAD directory, such as "*\PSTemplate\MyPaperTemplate.tps".

Loads paperspace template (*.tps) files, and activates Paperspace Mode if it is not already active.

Compatibility: All versions

Example:

>LoadPSTemplate

{

<Filename "*\MyTemplate.tps"

}


LoadWorkplane

>LoadWorkplane

{

<Name WpName$

}

Loads the named custom workplane. If no such name exists, the command has no effect.

Compatibility: Version 13 and higher


H_Pattern Parameter

H_PATTERN ParameterQuery and Change Parameters

H_PATTERN

Declaration: Alias H_PATTERN &H0801

Arguments: One integer value representing the hatch pattern index.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the hatch pattern used by a hatch entity.

Query Usage:

Query H_Pattern, hpat

where hpat is a numeric variable.

Change Usage:

Change H_Pattern, hpat

where hpat is a numeric variable or expression.

Compatibility: Version 14 and higher


INPUT # Statement

PURPOSE:To read a line from a disk file and assign it to a variable.

SYNTAX:INPUT # file, variablelist

EXPLANATION:This statement is used to read a line from a disk file and assign it to a numeric variable or to a string variable. The INPUT # statement reads an entire line from the disk file. File is the file number that was used in the OPEN statement. Variablelist is a set of one or more variables separated by commas. The variables can be string or numeric variables.

When this statement is executed, a line from the file is read and a value is assigned to each variable. If the line from the file has fewer values than there are variables, the leftover variables are not modified.

String values in the file should be enclosed in quotes if there are multiple values on a line. If an entire line from the file is to be read into a single string variable, use a single string variable with the INPUT # statement.

Values read can be any valid macro language expressions – they do not have to be simple constants.

The file must have been opened using the OPEN statement before the INPUT # statement is executed. The macro function EOF(filenumber) can be used to determine whether the end-of-file has been reached.

See Also: INPUT, OPEN, CLOSE

COMPATIBILITY:All versions

EXAMPLES:

For j = 1 To 20

Input #1, jx(j), jy(j)

Next

Input #1, name$

Open "i", 2, "testfile"

Do While Eof(1) = 0

Input #2, a$

Print a$

Loop


Undo

>Undo

{

}

Undo the result of the last command.

Compatibility: All versions

Example:

>Line

{

<Pointxyz 25, 0, 0

<Pointxyz 25, 10, 0

<Pointxyz 30, 10, 0

}

>FitToWindow

{

}

Message "About to undo the line"

>Undo

{

}

Message "About to redo the line"

>Redo

{

}


MovePoints

>MovePoints

{

<Points: 1=any reference location, 2 = offset distance from point 1

}

This command moves all selected points in to a new location. You must be in Preset Point Mode with some points selected in order to use this command. This command is equivalent to the GroupPointsMove command.

Compatibility: Version 15 and higher

Example:

Retry:

Message "Select an object on the screen"

SetPoint "Set a point on an object... ", 1

PointVal x, y, z, 1

>PointSelect

{

<Pointxyz [x, y, z]

}

If Sys(80) < 1 Then Goto Retry

If Not Sys(345) Then

>PointSelectMode

{

}

End If

Message "Now select some points on the object"

Retry2:

Sys(41) = 2 ' rubberband box for user points

Setpoint "Set two points for a selection box", 2

If Sys(1) < 2 Then Goto Retry2

>DragSelect

{

Pointval x y z 1 ' get the first point the user set

<Pointxyz [x, y, z]

Pointval x y z 2 ' get the second point the user set

<Pointxyz [x, y, z]

}

SetSelectedPoints

If Sys(1) < 1 Then

Message "No points selected. Try again."

Goto Retry2

End If

Message "Moving the selected points..."

Pointval x y z 1 ' get the first selected point

'>GroupPointsMove

>MovePoints

{

<Pointxyz 0, 0, 0' [x, y, z]

<PointRel 5, 5, 0

}


DL_HatchAngle Parameter

DL_HATCHANGLE ParameterQuery and Change Parameters

DL_HATCHANGLE

Declaration: Alias DL_HATCHANGLE &H0209

Arguments: One number (floating-point) representing the angle used by the entity's fill pattern

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's fill pattern angle.

Query Usage:

Query DL_HATCHANGLE, edlhatchangle

where edlhatchangle is a numeric variable

Change Usage

Change DL_HATCHANGLE, edlhatchangle

where edlhatchangle is a numeric variable or expression

Compatibility: Version 14 and higher


DwgIn

DwgIn

{

<Filename "drawingname.ext"

<ExplodeBlocks ex

[0 = no, 1 = yes]
This parameter controls whether blocks in the imported drawing are retained as blocks or are exploded into individual entities.

<SkipHatch sh

[0=no, 1=yes]
This parameter offers the option to bypass hatch entities in the imported drawing.

<UseVectorFont uv

[0=no, 1=yes]
If set to 1, all text will be imported to use the current vector font. If set to 0, all text is imported using the current TrueType font.

}

This command imports a DWG file.

Note: For a convenient shortcut to specify the path to DesignCAD itself, use an asterisk "*". For example, if DesignCAD is installed in C:\Program Files\DesignCAD 97, and your file MYDWG.DWG is in the DWG subdirectory underneath DesignCAD, you can specify the filename as "*DWG\MYDWG.DWG" or "*\DWG\MYDWG.DWG."

Compatibility: All versions

Example:

' load a dwg file that is in DesignCAD's directory

>DwgIn

{

<Filename "*\MyDwg.dwg"

}

' load a dwg file from the DWG subdirectory right beneath DesignCAD

>DwgIn

{

<Filename "*\DWG\MyOther.dwg"
<ExplodeBlocks 1

<SkipHatch 0
<UseVectorFont 1

}


D_Font Parameter

D_FONT ParameterQuery and Change Parameters

D_FONT

Declaration: Alias D_FONT &H0A06

Arguments: A string representing the name of the font used by this dimension.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the font used to display the dimension. Changing the font name may also change the D_FontType parameter, if for example you switch from a TrueType font to a vector font. To specify a vector font, be sure to use the font's filename (i.e. use "Simplex2_Win.vfn", not "Simplex 2 for Windows").

Query Usage:

Query D_Font, dont$

where dfont$ is a string variable.

Change Usage:

Change D_Font, dfont$

where dfont$ can be a string variable or expression.

Compatibility: Version 14 and higher


OriginalSize

>OriginalSize

{

}

Restores the drawing to its original zoom factor and location.

Compatibility: All versions


DL_Align Parameter

DL_ALIGN ParameterQuery and Change Parameters

DL_ALIGN

Declaration: Alias DL_ALIGN &H0205

Arguments: One numer (integer [0, 1, 2]) that represents the doubleline entity's alignment

Values: 0 = centered, 1 = left, 2 = right

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the entity's alignment.

Query Usage:

Query DL_ALIGN, edlalign

where edlalign is a numeric variable

Change Usage:

Change DL_ALIGN, edlalign

where edlalign is a numeric variable or expression that evaluates to 1, 2, or 3

Compatibility: Version 14 and higher


Ent_LineFill Parameter

ENT_LINEFILL ParameterQuery and Change Parameters

ENT_LINEFILL

Declaration: Alias ENT_LINEFILL &H0109

Arguments: One number (integer [0, 1]) indicating if the line is filled or not

Values: 0 = unfilled, 1 = filled

Accessibility: Query/Change

Purpose: This parameter allows you to read or change the entity's linefill setting.

Query Usage:

Query Ent_LineFill, elfilled

where elfilled is a numeric variable

Change Usage:

Change Ent_LineFill, elfilled

where elfilled is a numeric variable or expression

Compatibility: Version 14 and higher


Stretch

>Stretch

{

<2Drange r

[0=no, 1=yes]

<SelectOnly s

[0=n0, 1=yes]

<Points: 1-2 = area/volume to stretch, 3 = start point, 4 = end point

}

Stretch one or more objects.

Compatibility: All versions

Example:

>2DBox

{

<Pointxyz -20, -20, 0

<Pointxyz 20, 10, 0

}

>PointSelect

{

<Pointxyz -20, -20, 0

}

>Stretch

{

<SelectOnly 1

<2DRange 1

<Pointxyz 15, -26, 0

<Pointxyz 25, 15, 0

<Pointxyz 20, 10, 0

<Pointxyz 25, 10, 0

}


SelectOrtho

>SelectOrtho

{

}

Same as Orthoabove

Compatibility: All versions


New Sys$ Functions

0 – Commandline parameters. *New in 14
This function contains any extra information that was on the command line after the macro name, or was passed by the CMDLINE statement to a RUN or CALL statement. For example, if you run mymacro.d3m by typing "mymacro.d3m 1, 10, 100" at the commandline, when the macro checks Sys$(0) it will find the string "1, 10, 100"

43 – The default symbol library path *New in 15

105 – DesignCAD version number *New in 14(?)

300 - Entity Name. *New in 16
This function contains the name of the ENTITY statement.

301 – Layer Group Name. *New in 17
This function contains the name of the current layer group.


BreakLine

>BreakLine

{

}

Break a multi-segment line into individual line segments.

Compatibility: All versions

Example: Draw a 2D box, then break it into individual sides.

>2DBox

{

<Type 1

<Pointxyz 0, 0, 0

<Pointxyz 20, 30, 0

}

>PointSelect

{

<Type 0

<Pointxyz 10, 0, 0

}

>BreakLine

{

}

Message "The box is now broken into segments."

>PointSelect

{

<Type 0

<Pointxyz 10, 0, 0

}

Print "Press a key"

anykey

>PointSelect

{

<Type 0

<Pointxyz 20, 15, 0

}

Print "Press a key"

anykey

>PointSelect

{

<Type 0

<Pointxyz 10, 30, 0

}

Print "Press a key"

anykey

>PointSelect

{

<Type 0

<Pointxyz 0, 15, 0

}


GETSELECT Statement

PURPOSE:To get the entity number of one of the currently selected entities.

SYNTAX:GETSELECT expression, variable

EXPLANATION:This statement can be used to retrieve entity numbers of selected items so these items can be investigated with the ENTITY statement, if desired. Information about the entities can also be retrieved with GETATTR and changed with PUTATTR. "Expression" is a number, variable, or mathematical expression evaluating to an integer which determines which of the selected entities you want the entity number for; "variable" is the name of the variable you want to store the entity number in.

GETSELECT will ignore any selection status changes made by the PUTATTR statement. Entities must have been selected by the DesignCAD Select command, either earlier in the macro or before you ran the macro.

See Also: ENTITY, GETATTR, PUTATTR

COMPATIBILITY:Version 9 (DesignCAD 97) and later

EXAMPLE:

' This example assumes you have already selected

' several items before running the macro

Dim ent(10) 'Create an array for ten entity numbers

' Make sure no more than ten items get processed

maxsel= Sys(80)

If maxsel > 10 Then maxsel = 10

Window 10, 40

For j = 1 To maxsel

Getselect j, ent(j) 'get info for selected items

Print "Picked item ",j, " is entity ", ent(j)

Next j'go to the next item

Anykey


RUN Statement

PURPOSE:To transfer control to another macro or to a DOS or Windows program.

SYNTAX:RUN programname$ {, Status}

EXPLANATION:The Run statement can be used to run another DesignCAD macro or an external program from within your macro. The following status values can be used with the RUN statement:

0 – resume the macro immediately (default)

1 – halt the macro until the focus returns to DesignCAD (This will occur even if the other program is still running! All it takes is a click on the DesignCAD window, or an Alt+Tab to switch focus to DesignCAD.)

2 – halt the macro until the OLE Automation program issues a ResumeBasicCAD command. This option should only be used when specifying a DesignCAD-based OLE Automation program in the RUN statement.

Running another DesignCAD macro with the RUN statement

When this statement is used to run another DesignCAD macro, all the variables from the current macro are cleared when the other macro is executed. A string variable or constant can be used for the macro name.

The RUN statement causes the new macro (programname$) to replace the current macro in memory. To return to the original macro, you must execute another RUN or CHAIN statement from the new macro. The execution of a macro called by the RUN statement always begins at the first line in the called macro.

You should always specify the extension in the filename of the macro to be run. To use an encrypted BasicCAD program, specify the extension .BSX. (DesignCAD includes a utility program Encrypt.exe, which allows you to encrypt your macros so that others can use them, but can't read your code.)

The CHAIN statement is similar to the RUN statement, but the CHAIN statement leaves all variables intact when the new macro is executed. In other words, if x has the value of 10.125 in macro1.d3m, x is still 10.125 at the start of macro2.d3m if you CHAIN from macro1 to macro2.

Running an EXE program with the RUN statement

To run an external program from within a macro, just specify the program name with the RUN statement. For example:

run "notepad.exe c:\test.dat", 1

This command will run the notepad editor and automatically load the file TEST.DAT if it exists. The macro will continue as soon as the focus is returned to DesignCAD (whether or not notepad is closed).

With the RUN statement, you can run both DOS and Windows applications.

Running a BAT file with the RUN statement

To run a DOS batch file from within a macro, you must run COMMAND.COM to interpret the batch file. It is usually best to use the /C command-line switch for command.com, which forces the DOS window to close when the batch file is done. For example:

run "command.com /c myscript.bat"

or, for Windows NT/2000/XP:

run "cmd.exe /c myscript.bat"

Using the new CmdLine statement to pass command line parameters to a macro or program

You may also pass commandline parameters through the Commandline statement. Repeating the above example for Windows NT/2000/XP:

Cmdline "/c myscript.bat"

' Now open a command prompt and run the above commands

Run "cmd.exe"

See also: CHAIN, CALL, CMDLINE

COMPATIBILITY:All versions

EXAMPLE:

Run pgmname$

Run "test1"

Run "edit.com myfile.bsc", 1

Message "Finished Editing"

Run "*\MyOleProgram.exe", 2

' won't resume until the OLE program
' executes the ResumeBasicCAD method
Message "Back in the macro again"

CmdLine "1, 10, 0" ' set the commandline for the run statement
Run "LineFromHere.d3m"


Chapter 3: Macro Language - DesignCAD Commands and Parameters

Parameters to Set Points

DesignCAD Macro Commands


SelectModeChange

>SelectModeChange

{

}

Toggles between 2D Selection Mode and 3D Selection Mode.

Compatibility: All versions


PolygonXOr

>PolygonXOr

{

}

Deletes the area common to two shapes.

Compatibility: Version 13 and higher

Example: Cut away the overlap between two circles.

>Circle

{

<Pointxyz 20, 20, 0

<Pointxyz 30, 20, 0

}

>Circle

{

<Pointxyz 35, 20, 0

<Pointxyz 45, 20, 0

}

>PolygonXOr

{
<Pointxyz 20, 30, 0

<Pointxyz 35, 30, 0

}


Hemisphere

>Hemisphere

{

<Orientation o

[0 = vertex, 1 = midpoint of side, 2 = pole]

<NLatitude

number of sides around equator

<NLongitude

number of sides from pole to equator

<Points: 1 = center, 2 = radius, 3 = direction

}

This command draws a hemisphere.

Compatibility: All versions

Example:

If Sys(344) Then

>2DMode

{

}

End If

>Hemisphere

{

<Color 0, 255, 128

<Layer 7

<Orientation 2

<Latitude 12

<Longitude 6

<Pointxyz 12, 12, 0

<Pointxyz 24, 15, 0

<Pointxyz 32, 18, 15

}


Exit

>Exit

{

}

This closes DesignCAD.

Compatibility: All versions


SY_AttDefConstant Parameter

SY_ATTDEFCONSTANT ParameterQuery and Change Parameters

SY_ATTDEFCONSTANT

Declaration: Alias SY_ATTDEFCONSTANT &H0E0B

Arguments: Two integers. The first is the index of the desired Attribute Definition in the block, and the second (integer [0, 1]) indicates whether the Attribute Definition has a constant or changeable Value string.

Values: 0 = changeable, 1 = constant

Accessibility: Query Only

Purpose: This parameter allows the programmer to determine whether the Value string of the specified Attribute Definition can be changed..

Query Usage:

Query SY_AttDefConstant, adconst

where adconst is a numeric variable

Compatibility: Version 14 and higher


PlotSort

>PlotSort

{

}

This command enables/disables the “Optimize plot by color sorting” option in the Print dialog box. In this mode DesignCAD sends the drawing to a plotter one color at a time.

Compatibility: Version 14(?) and later

Example:

>PlotSort

{

}


Erase

>Erase

{

}

This command erases all selected objects. It is identical to SelectDelete below.

Compatibility: All versions


ID_SHOW_EDGE

>ID_SHOW_EDGE

{

}

This command shows all hidden edges. Since a user-friendly name for the command such as "ShowHiddenEdges" was inadvertently omitted from Macrocmd.ini, this uglier name is used instead. It still works fine.

Compatibility: All versions


Hexadecimal Notation

New for version 14

DesignCAD now allows you to use hexadecimal values in your macros. The hexadecimal value must be preceded by an ampersand and a capital H (&H)

Examples:

Hex1 = &H0001
Hex16 = &H0010
If v >= &H0100 Then v = &H00FF

Hexadecimal values are numbers that are in base 16, instead of base 10. The Hexadecimal digits are 0-9 and A-F, where A = decimal 10 and F = decimal 15. Just as each digit in decimal number represents a multiple of a power of 10, a digit in a hexadecimal number represents a multiple of a power of 16.

Thus, the decimal number 123 means:

3*10^0 + 2*10^1 + 1*10^2, or 3 + 20 + 100.

The hexadecimal number &H123 means:

3*16^0 + 2*16^1 + 1*16^2, or 3 + 32 + 256, which in decimal notation is 291.

The hex number &H2FC means:

12*16^0 + 15*16^1 + 2*16^2, or 12 + 240 + 512, or decimal 764.


CL_Direction Parameter

CL_DIRECTION ParameterQuery and Change Parameters

CL_DIRECTION

Declaration: Alias CL_DIRECTION &H0B03

Arguments: Three floating-point numbers for the direction of the construction line relative to the insertion point. The values of the arguments are relative offsets from the insertion point.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the direction of a construction line.

Query Usage:

Query CL_Direction, dx, dy, dz

where dx, dy, and dz are numeric variables

Change Usage:

Change CL_InsertionPoint, dx, dy, dz

where dx, dy, and dz are numeric variables or expressions

Compatibility: Version 14 and higher


ShowDrawingHandles

>ShowDrawingHandles

{

}

Toggles the visibility of the drawing handles (if any) for the drawing. (

Compatibility: Version 15 and higher


Macro Command

2

2DBox

2DMode

2DSelectMode

3

3DSelectMode

A

AboutDesignCAD

Acquire

AddLayerToGroup

AlignObjects

AngleDistance

ApplyArrowSize

ApplyColor

ApplyDoubleLineStyle

ApplyFixedText

ApplyLayer

ApplyLineFill

ApplyLineStyle

ApplyLineWidth

ApplyMaterial

ApplyTextSize

Arc

Arc2

Arc3

Arc4

Arc5

Arc6

Area

ArrangeIcons

ArrangeEntitiesByID

ArrangeEntitiesByLayerOrder

Array

Arrow

AttribDef

AttribNormalDisplay

Attribute

AutoDimension

B

Balloon

BatchConvert

BatchPrint

BezierCurve

BlockDefine

BlockInsert

Box

BreakLine

C

Calculator

CascadeWindows

CenterOfGravity

Chamfer

ChangeCodePage

ChangePSTemplateProperties

Circle

Circle2

Circle3

Circle4

CircleTan2Lines

CircleTan3Lines

CircleTanLine

CircularArray

ClearDrawingHandle

Close

CloseAll

ColorToolBox

Combine

ComplementArc

Cone

ConstructionLine

ContourLine

ConvertText

ConvertToMultiline

CoordinateBar

Copy

CopyBitmap

CreateLayerGroup

Crosshair

CrossSection

CursorOptions

Curve

CurveToLine

CustomColor

Cut

CutCorner

CutEdge

CutLine

Cutoff

CutoffDel *deprecated – See SectionTrim

CutPlane

Cylinder

D

DCADTile

DecVDis

DeleteCurrentLayout

DeleteLayerFromGroup

DeleteLayerGroup

DeletePoints

DeleteWorkplane

DeSelect

DimAngle

DimArc

DimBase

DimCenterPoint

DimChamfer

DimCoordinate

DimDiameter

Dimension

DimensionDistanceOnly

DimExtend

DimProgress

DimRadius

DimRadProgress

DoEntitySelection

Door

DoubleLineBar

DoubleLineConvert

DoubleLineMode

DoubleLineToPlane

DoubleLineToWideLine

DragCopy

DragMove

DragMoveSelectedPoints

DragSelect

DrawingHandle

DrawingInfo

DrawSymbolAsBox

Duplicate

DuplicateToLayer

DwgIn

DwgOut

DxfIn

DxfOut

E

Ellipse

Ellipsoid

EllipticalArc

EllipticalArc2

EntitySelect

Erase

EraseLast

ErasePresetPoint

Exit

Explode

ExportPlotFile

Extend

ExtendByDistance

Extrude

ExtrudeAlongCurve

F

FileBackup

Fillet

FilletCorner

FilletEdge

FillWideLine

FitToAllWindow

FitToWindow

G

GetEntity

Gravity

GridOptions

GroupDefine

GroupExplode

GroupPointsMove

H

Hammer

Hatch

HatchFill

HatchLine

HatchOptions

HatchPosition

HelpIndex

HelpUsing

Hemisphere

HiddenEdge

HiddenEdgeBySection

Hide

HideCommand

HideRestoreToolbars

HideSec

HpglIn

I

ID_SHOW_EDGE

ID_ZOOM_SELECTION

IgesIn

IgesOut

IncVDis

InfoBox

Interfere

Intersect-1

Intersect-2

J

Join

L

LayerCopy

LayerOptions

LayerSave

Light

Line

LineAngle

LineDistance

LinePlane

LineSnap

LineStyleToolBox

LineToCurve

LoadBMP

LoadCustomKeys

LoadCustomMenu

LoadPSTemplate

LoadToolbox

LoadWorkplane

LockX

LockY

LockZ

M

MainToolBox

MakePlane

MaterialEdit

MaterialList

MaterialToolBox

Merge

Midpoint

Midpoint2

Mirror

Move

MoveCursor

MoveDown

MoveLeft

MoveRight

MoveToBack

MoveToBackOf

MoveToFront

MoveToFrontOf

MoveUp

MultilineMode

MultiLineStyleEditor

N

New

NewWindow

O

ObjectRepeat

OffScreenBitmap

Open

Options

Origin

OriginalSize

Ortho

OrthoLine

OrthoMode

P

Pan

PaperSpaceConfiguration

PaperSpaceMode

Parallel

ParallelByDistance

Parallelogram

PasswordProtectionManager

Paste

Patch

Perimeter

PerpendicularFrom

PerpendicularPlane

PerpendicularTo

Plane

Planesnap

PlaneSubtract

PlotSort

PointMark

PointMove

PointSelect

PointSelectMode

PolygonAdd

PolygonCenter

PolygonEdge

PolygonIntersect

PolygonSelection

PolygonSubtract

PolygonXOr

PresetPoint

PresetPointMode

Print

PrintCurrentView

PrintNow

PSViewerBox

Pullout

PurgeBlocks

Pyramid

Q

QShade

QShadeSec

QuarterCircle

Quit

R

RecursiveGroupExplode

Redo

Redraw

RedrawAll

Regenerate

RegenerateAll

RemoveDrawingHandles

RemoveToolbox

ResizingNodes

RestoreDCADTile

RestoreDefaultMenu

ReversePoints

RoundBox

RoundCylinder

Rotate

Ruler

RunX

S

Save

SaveAs

SaveAsSymbol

SaveBMP

SaveCopy

SaveCurrentView

SaveCustomKeys

SaveCustomMenu

SavePSTemplate

SaveSelected

ScrollBar

SectionCopy

SectionCut

SectionCutByLine

SectionDeleteCut

SectionTrim

Segment

SelectAddPoint

SelectAll

SelectDelete

SelectDuplicate

SelectDuplicateToLayer

SelectEverything

SelectImageSource

SelectionFilter

SelectLayer

SelectMirror

SelectMode

SelectModeChange

SelectMove

SelectOrtho

SelectPrevious

SelectScale

SelectScaleOrtho

SelectSlant

SemiCircle

SendAllFiles

SendCurrentFile

SetColor

SetDcadTile

SetDimensionOptions

SetDrawingHandle

SetGridCenter

SetHandle

SetPoints

SetPrintOptions

SetShadeStyle

SetStartPoint

SetView

SetViewerPoints

ShadeCommand

ShadeSection

ShadeView

ShowAttributes

ShowConstructionLines

ShowDrawingHandles

ShowGrid

ShowHide

ShowSymbolHandles

ShowToolbox

Sketch

Slice

SliceBySurface

SmoothLine

SmoothLine2

SmoothOff

SmoothOn

SmoothSetting

SnapGrid

SnapPreviewMode

SnapSize

SnapToolBox

SolidAdd

SolidDefine

SolidExplode

SolidIntersect

SolidSegregate

SolidSubtract

SolidXOr

Sphere

Split

Split2

StatusBar

Stretch

SurfaceArea

SurfaceConnect

SurfaceIntersection

Sweep

SymbolExplode

SymbolLoad

T

TangentBetween

TangentFrom

TangentTo

Text

Text2D

Text3D

TextArc

TextBlock

TextOutlineFill

TickMark

TileH

TileV

ToolBar

Torus

TruncatedCone

Trim1

Trim2

Trim3

TrimDouble

TrimMultiLines

TruncatedCone

Tube

U

Undo

Units

UnitsOfMeasurement

UnWorkplane

UserDefinedViewsEditor

V

VectorConvert

ViewChange

ViewerLeft

ViewerRight

ViewRead

ViewRedo

ViewSave

ViewToolBox

Volume

VPlane

VrmlOut

W

Wall

Weld

Window

WmfIn

WmfOut

Workplane

X

XyzIn

Z

Zoom

ZoomIn

ZoomOut

ZoomPrevious

ZoomWindow


BasicCAD Essentials

The DesignCAD macro language is not case sensitive; i.e. using the variable name ThisVariable or THISVARIABLE makes no difference.

Line numbers are not used in BasicCAD. A label can be used as the object of a GOTO or GOSUB statement.

A line of code may not exceed 255 characters in length (including white space).

You may break up long lines of code by using the line continuation character " _ " before continuing a command on the next line of text. However, these lines still may not exceed 255 characters in overall length. (The white space between the beginning of a continued line and the first character in the line does not count toward the overall length.)

Examples:

longStr$ = shortStr$ + Mid$(otherStr$, _

start_char, _

end_char)

If ((x > 21 AND y < 15) _

OR (z = 12 AND y = 19) _

OR (Len(otherStr$) > 50) ) Then

gosub SomeRoutine:

End If

BasicCAD recognizes only two data types – Numeric and String. The Numeric data type is actually a 64-bit real or floating-point type (identified in some programming languages as a double). The String data type contains a sequence of up to 255 characters or bytes.

Macro variable names and labels can be up to twenty characters in length. (DesignCAD 3000 and earlier only allowed up to eight characters for variable names and labels.)

Variable names and labels can consist of numbers and letters and underscores, but they must always begin with a non-numeric character. String variables must end with a dollar sign ($). Any of the following are valid macro variable names:

J

TestVal

name$

BaselineLength

var_with_underscore

There are several words which BasicCAD reserves for its own use. These words should not be used as variable names; accidentally using a keyword as a variable name can cause unexpected behavior. All BasicCAD keywords are listed in the Macro Language Keywords topic.

Any of the following are valid numeric constants:

45

45.4

2E3'(This is 2 * 10 ^ 3, or 2000)

Numeric expressions can contain the following operators:
+, -, *, /, \, MOD, and ^.

+ and – perform the everyday operations of addition and subtraction.

* The asterisk is used to perform multiplication. For example, 2*5 = 10.

/ The forward slash operator performs regular floating-point division. For example, 9/4 evaluates to 2.25.

\ The backslash operator performs integer division – that is, of the result of the division is not an integer value, it is truncated to the next-lowest integer value. For example, while 9\4 evaluates to 2.

MOD The MOD operator performs modular arithmetic -- it finds the remainder of a division operation. For example, 9 MOD 4 evaluates to 1.

^ The caret operator performs exponentiation – that is, x^y is x raised to the power y. For example, 2^3 evaluates to 8. Note: the number being raised to a power must be not be a negative number, or the operation will result in an error.
** Note: Version 17.1 and higher do allow x to be a negative number, so long as y is an integer.
So (-2)^3 is allowed, but (-2)^2.5 gives an error.

Parentheses are also allowed. Expressions are generally evaluated left to right, but some operations take a higher precedence than others, and expressions inside parentheses are evaluated before any surrounding operators are applied. The following are valid numeric expressions:

A * B + 4

A \ B + 4

A MOD 4

4 ^ 2'( = 16)

2 + 4 * 5'( = 40) multiplication trumps addition

2 * 4 + 5'( = 13)

2 * (4 + 5)'( = 18) expressions in parentheses go first

2 * 3 ^ 2'( = 18) exponentiation trumps multiplication

SQRT(4) + 4'(functions can be used in expressions)

As with most programming languages, the operator precedence is:

1. ^ ' exponentiation

2. *, /, \, MOD' multiplication, division, modulus

3. +, -' addition and subtraction

String constants can be anything enclosed in quotes (" "):

"This is a string"

"4 * 8 is a string, if it is in quotes"

To embed quotation marks in a string, double up on the quotatin marks:

"This is a ""string with quotation marks"" embedded"

String variables and constants cannot contain more than 255 characters.

Logical expressions are expressions that evaluate to true or false. They are frequently used in DO and IF statements. Valid logical expressions can include relational operators (<, >, <>, =, <=, >=) and logical operators (AND, OR, NOT). As with most programming languages, the operator precedence is:

1. <, >, <>, =, <=, >=

2. NOT

3. AND

4. OR

Of course,

'<' is "Less than",

'>' is "Greater than,

'<>' is "Not Equal",

'=' is "Equal",

'<=' is "Less than or equal to",

and

'>=' is "Greater than or equal to".

Parentheses can be used in logical expressions. Let us assume we have a variable B that has the value 5. Some examples of logical expressions are:

(assuming B is equal to 5)

NOT B < 5 OR B = 7 'true

NOT B < 5 AND B = 5 'true

B <= 5 OR B > 5 AND B = 5 'false; AND has precedence
'over OR

(B <= 5 OR B > 5) AND B = 5 'true

It is a very good idea to put comments in your macro programs. Comments are placed after an apostrophe (') anywhere on the line:

Print J 'A comment can go here.

'A comment can also be on a line by itself.

Comments may also be placed in the same line as DesignCAD macro commands or parameters:

>PolygonEdge 'YOU MAY PUT COMMENTS HERE

{

<Color 255,0,0'AND HERE

' A comment-only line is acceptable anywhere

<PointXYZ 10, 10, 0

<PointXYZ 15, 15, 0

}

DesignCAD macro commands and parameters are easily distinguished from macro language statements. All DesignCAD macro commands have a ">" at the beginning of the line, while all macro parameters have a "<" at the beginning of the line.


ZoomPrevious

>ZoomPrevious

{

}

Revert to the previous zoom setting.

Compatibility: All versions


SYS Function

The SYS function represents many different DesignCAD system variables. SYS(1), for example, is the number of points set, and SYS(3) is the current layer. A list of the available SYS variables and their valid ranges follows:

0 - Error checking (enable/disable) [0 = Off, 1 = On]
The error checking function is enabled by default. This setting is only effective during the current macro.

1 - Number of points currently in the point buffer after being set by SETPOINT or ENTITY or SETSELECTEDPOINTS. Mostly read-only, but you can clear the point buffer by setting it to zero.

2 - OpenGL shading mode for the currently active view window
[0 = wireframe, 1 = hiddenline, 2 = flatshade, 3 = smoothshade, 4 = quickhiddenline]

3 - Current layer index [0-1000]

4 - Current line type [0-12]
[0 = solid, 1 = dashed, 2 = hidden, 3 = center, 4 = phantom, 5 = dotted, 6 = dashdot,
7 = border, 8 = divide, 9 = special-1, 10 = special-2, 11 = speciall-3, 12 = special-4]
Numbers above 12 can be used but will refer to custom line types which may vary from user to user or even drawing to drawing.

5 - Current line type scale [0<=x<=10e6]

6 - Current line width [0 <=x<=10e6]

7 - Current distance precision displayed in the coordinate bar and in dialog boxes. [-7<=x<=15]

8 - Current angular precision displayed in the coordinate bar and in dialog boxes. [-7<=x<=15]

9 - Number of entities in the drawing [read_only]

10 - Units of measurement for printing
[1 = inches, 25.4 = mm, 2.54 = cm, 0.0254 = m, 0.0000254 = km, 0.08333333 = feet, 0.0000157828282828282 = mi].
The values for km, feet, and miles are new as of version 15. See also Sys(1114).

11 - Printing scale (drawing units per unit of paper) [0<=x<=10e6]
Proper interpretation of this value will require that you know both the drawing's units of measurement and the print units of measurement. For example, if your drawing is in inches, but your paper is measured in centimeters, a print scale of 1.0 will have a different meaning than if the paper was measured in inches.
You may set this value to zero to force the print to fit to the page.

12 - Default text size [0<=x<=10e6]

13 - Default text angle [-36<=x<=360]

14 - 2D Mode display grid type
[0 = Ortho, 1 = Isometric, 2 = Polar (v. 16 and higher)]
[0 = grid, 1 = tickmarks, 2 = dots (v. 15 and earlier)]

15 - Display grid enable/disable [0 = off, 1 = on]

16 – Enable/Disable Use Plot Range Box (Version 15)
[0=Disable, 1=Enable]
If enabled, draws a rectangle around the plot boundary when exporting HPGL files. If disabled, no border is plotted.

17 - Snap grid on or off [0 = off, 1 = on]

18 - Plot point optimization [0=unchanged, 1=optimized (default)]
This function determines whether the Export Plot File command rearranges points in adjacent entities to minimize pen movement. (Version 13)

19 – Minor Display Grid spacing along x (or angular spacing for polar grid) (v. 16 and higher)
Display grid size (distance between grid lines) (v. 15 and earlier)

20 – Minor Display Grid spacing along y (or radial spacing for polar grid) (V. 16 and higher)
Snap grid size (Version 15 and earlier)

21 - Attribute display mode
[0 = Don't display attributes, 1 = Display Visible Attributes Only,
2 = Display All Attributes]
This function applies only to attribute entities, not attribute definition entities. To control the visibility of attribute definitions, use Sys(62).
By default, attributes are assumed to be visible, so old macro code which used only the 0 and 1 values for this function will still behave much as before. That behavior will only change if you create new attribute entities with the "invisible" option checked.

22 - Save parameters with drawing, enable/disable [0 = off, 1 = on]

23 - Mathematical or geographical angles [0 = Mathematical, 1 = Geographical]
Mathematical angles are measured counterclockwise from the positive X axis, while geographical angles are measured clockwise from the positive Y axis.

24 - Fill wide lines enable/disable [0 = off, 1 = on]

25 = WMF output scale (metafile units per drawing unit).
One metafile unit is about 1/576 of in inch. A value of zero creates a WMF file of 5 inch width or height (5 inches along longest side). Note that the 5-inch size does not include the border margin -- that's just the output size of the drawing data. Given a default margin of 1/8 inch, the overall width or height of the output file (with Sys(25) = 0) will be 5.25 inches.
The default value of Sys(25) is 80.

26 - Edit current layer only [0 = off, 1 = on]
Note that this function has the opposite behavior of the "Enable Multilayer Editing" check box in Layer Options – when Sys(26) is zero, the multilayer editing box is checked.

27 - Beep on point set [0 = off, 1 = on]. Uses the "default" system sound. For best results, use a very short wav file - if you set points faster than the sound file can play, some beeps will be skipped (but the points will still be set).

28 - Update coordinates in Digitizer Tracing Mode [0 = off, 1=on].
Default is off; when in Digitizer Tracing Mode, the coordinate bar will only update when the pointing device (mouse or digitizer puck/pen) stops moving. Since in tracing mode the user normally is looking at the drawing he is digitizing rather than at the screen, this usually presents no problem.

If Sys(28) is turned on, then the coordinate bar will continuously update as the pointing device is moved on the tablet. With some digitizers, the on-screen cursor is not able to keep up as the pointer is moved across the tablet, resulting a slow-motion replay on screen of the motion performed on the tablet. This also sometimes causes points to be dropped if the user sets points too quickly.

30 - Large cursor step size [0<=x<=10e6]

31 - Small cursor step size [0<=x<=10e6]

32 - Drawing unit size [0<=x<=10e6]

Note: Sys(32) is used internally by DesignCAD as scale factor for certain operations. Change it only with extreme caution. Careless use can destroy a drawing's data. Especially avoid very small numbers (such as zero) and very large ones (such as one million).

33 - Font Type [0 = TrueType, 1 = Vector]

34 - Selection flag [read_only: 1 = entities selected, 0 = nothing selected]

35 - Default number of sides for polygons [3-100]

36 - Silent mode (0=normal operation, 1=silent mode, 2=extra-silent mode)

In silent mode, the screen does not automatically show the points you set, or update the drawing screen as frequently. This mode is used for greater speed when your macro has complete control of the program and you are not expecting user input.
Silent mode 2 completely suppresses view regeneration and drawing command dialog boxes when you draw entities.

Note: After performing any drawing operations in Silent Mode 2, you will need to manually regenerate the screen after setting Silent Mode back to zero.
Note: You should always return silent mode to zero when your macro exits. Failure to do so may result in improper manual operation of DesignCAD.

37 - Cursor step consistent with Screen or Drawing
[1 = Screen, 2 =Drawing]

38 - Text mirror enable/disable [0 = off, 1 = on] 3D Text Only.

If you mirror a piece of text with this setting turned on, the mirrored text is drawn backwards.

39 - Point mark type [1 = cross, 2 = box, 3 = circle, 4 = circle+box, 5 = filled dot]

40 - Crosshair enable/disable [0 = off, 1 = on]

41 - Rubberband type

0=none,

1=line,

2=2D-Box,

3=3D-Box,

4=Curve,

5=Bezier Curve,

6=Circle (center-radius),

7=Circle(diameter points),
8=Circle(3-point),

9=Arc(center-start-end),

10=Arc(3-point),

11=Ellipse,

12=Elliptical Arc,

13=Plane,

14=OrthoLine,

15=Cylinder,

16=Cone,

17=Truncated Cone,

18=Sphere,

19=Hemisphere,

20=Torus,

21=Tube,

22=RoundBox,
23=Angled 2D-Box

24=Elliptical Arc(center, axis1, axis2, start angle, end angle)

25=Arc(beginning, end, center)

26=Parallelogram

This sets the type of rubberband-line that is displayed as points are set by the program or during SetPoint.

42 - Parallel-2 offset distance [0<=x<=10e6]

43 - Dimension text spacing [0<=x<=2] Default is 1.0. Sets the gap between dimension text and arrows.

44 - Default Print Corner (for non-centered printing)

[0=Upper Left, 1=Lower Left, 2=Upper Right, 3=Lower Right]

45 - Output WMF size (inches) along longest size (width or height).
This Sys function overrides the current setting of Sys(25). Setting this value to zero restores the normal function of Sys(25).

46 - Margin for WMF output (inches). Default value is 1/8 inch.

47 - AutoRender in Paperspace Mode.
This function controls whether ViewFrames with OpenGL shading are automatically rendered when you enter Paperspace mode. If set to 0, the viewframes are not autorendered, and you must use the preview button to see the rendered result. If set to 1, the views are autorendered -- which may take some time on a complex drawing.

48 - Realtime Snap Preview. [0=off, 1=on].
Controls the snap preview cursor for snap modes. On very busy drawings, the snap preview can sometimes slow down the mouse movement, so we provided a means to turn it off.

49 - Disable Cursor Movement -- [0=off, 1=on] (Version 13)
When this flag is on it prevents the cursor from following the points which the macro sets in drawing commands. This can often speed up drawing operations

50 - Cursor Lock behavior in 2D mode
[0=new behavior - Shift forces Ortho Mode from the last point set
1=old behavior - Shift locks horizontal movement from the last cursor position, and Ctrl locks vertical movement from the last cursor position.]

51 – Display Arcs as Vectors (Version 14)
[0 = Disable, 1 = Enable] If this is set to zero, arcs are drawn using Windows API functions exclusively. The default setting is 1, whereby arcs are displayed as vector approximations in order to prevent display anomalies where an arc joins the end of a line.

52 – Sets the major Display Grid divisions along X (or Angular spacing for Polar grid) (V. 16)

53 – Sets the major Display Grid divisions along Y (or Radial spacing for Polar grid) (V. 16)

54 – Sets the Display Grid style (V. 16)
[0=lines, 1=dots, 2=crosses]

55 – Sets the Display Grid Angle (in degrees) for isometric display grids (V. 16)
[0 – 360]

60 - Tick mark segments [0<=x<=10e6]

61 - Tick mark segment division [0<=x<=10e6]

62 - Attribute Definition display mode (V. 13)
[0 = Don't display, 1 = Display only visible attribute definitions,
2 = Display all attribute definitions]
This function applies only to attribute definition entities, not attribute entities. To control the visibility of attribute entities, use Sys(21).

69 - Combine line segments after Fillet or Chamfer (V. 13)
[0=off, 1=on (default)]
Normally, when you fillet or chamfer two polylines, DesignCAD re-combines the segments on either side of the fillet. If Sys(69) is set to zero, then DesignCAD will leave the filleted/chamfered segments broken away from the other parts of the polylines.

70 - Old-style Fillet command behavior (V. 13)
[0=off (default), 1=on]
Normally, when you fillet two lines, DesignCAD changes their layer and linestyle properties, as well as that of the fillet arc, to match the first line clicked. If Sys(70) is set to 1, then DesignCAD emulates the old-style behavior, which only matched the fillet arc to the first line; the second line retains its original style and layer. Note that this setting always defaults back to zero when DesignCAD starts.

71 - Currently active view number

72 – Graphics Acceleration Setting for Hidden Line Removal (V. 15)
[0=off (default), 1=on]

80 - Number of entities currently selected [0-65000]
If any grid entities are selected, this number does not include grid lines, only the grid headers. Not affected by PUTATTR. Sys(80) can be set to zero to clear the current selection set (nothing is selected). Zero is the ONLY value that can be written to this Sys() function.

81 - SetPoint behavior * (V. 14)
[0=clear buffer (default), 1 = append points to buffer]
Normally, when you run the SetPoint statement, it clears any previous points from the point buffer. If Sys(81) is set to 1, you can run multiple SetPoint statements to accumulate more and more points.

Functions 90 - 99 are properties of an entity just selected with the Entity statement. They are all read_only values.

90 - Entity type

91 - Entity line type
Note: For Entity type 34 (Group Entities) Sys(91) indicates the group entity's Internal Group Number – that is, the group number that will be shown for all entities that are contained in this group. The group entity itself may also be contained inside another group, which is indicated by Sys(94) just as for all other entity types.

93 - Entity layer

94 - Group number

95 - Solid number

96 - Selection status of entity [0 = not selected, 1 = selected]

97 - Line type scale

98 - Line thickness

99 - Number of points in the entity, or number of grid lines for a grid header entity (entity type 32). For a Group entity (entity type 34) it represents the number of entities contained in the group (including any nested Group entities).

100 – Line Fill Spacing for HPGL Export * (V. 15)
Controls the spacing between line fill pen strokes. Distance in plotter units.

101 - Dimension text format (same as Sys(424) - changing one changes the other)

[0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches]

102 - Static dimensioning enable/disable [0 = off, 1 = on]

Static dimensions are drawn as individual arrows, lines and text. However, when you first draw a static dimension, all the pieces still form a group, which will need to be exploded if you want to edit an individual piece.

104 - Dimension arrowhead style [1-12]

106 - Dimension precision [-7<=x<=15]

110 - Coordinate system [-1 = left-hand, 1 = right-hand]

111 - Symbol Explode Layer Control Flag (V. 13)
This function allows the programmer to control the destination layer(s) for exploded symbols. This setting is NOT "sticky" and only applies to the document which was open when it was set. Possible values:

0 -- default behavior. A symbol's entities get exploded onto their original layers. Entities that were defined on layer 0 of the symbol (or on layer 0 of any symbols within the exploded symbol) move to the layer on which the symbol was placed.

1 -- flatten symbol layers. All of the symbol's entities get exploded to the layer on which the symbol was placed.

2 -- nested layer 0. As default behavior, except for entities that were on layer 0. Any entities that were on layer 0 of an included symbol move to the layer on which the included symbol was loaded in it's host symbol or drawing.

3 -- mostly flattened. Mostly like case 1, except that layer 0 entities are treated as in case 2.

Example: Symbol A contains a red line drawn in layer 0, and a black box on layer 1.
Symbol B contains Symbol A on layer 7, a blue circle on layer 9, and a green star on Layer 0.
Now you include Symbol B on layer 12 of your drawing, and explode it.
If Sys(111) = 0, the black box stays on layer 1, the blue circle stays on layer 9, and a red line and green star move to layer 12.
If Sys(111) = 1, all four entities move to layer 12.
If Sys(111) = 2, the black box stays on layer 1, the red line moves to layer 7, the green star moves to layer 12, and the blue circle stays on layer 9.
If Sys(111) = 3, the red line moves to layer 7, the black box moves to layer 12, the green star moves to layer 12, and the blue circle moves to layer 12.

112 - Depth of Nested Folders in Symbol Library window (V 15.1)
Sets the number levels of nested folders under the symbol library search path. Default value of 1, which only shows a tab for the target path and any folders immediately beneath it that contain drawing files. Higher values will show tabs for increasingly deeper folder levels. Once this value is changed, if you have already opened the Symbol Library command you may have to manually browse to a different folder and then back again in order to update the Symbol Library display.

120 - Minimum X value in the drawing [read_only]

121 - Minimum Y value in the drawing [read_only]

122 - Maximum X value in the drawing [read_only]

123 - Maximum Y value in the drawing [read_only]

124 - Minimum Z value in the drawing [read_only]

125 - Maximum Z value in the drawing [read_only]

130 - Input window left boundary pixel location (-10000 to center)

131 - Input window top boundary pixel location (-10000 to center)

132 - Output window left boundary pixel location (-10000 to center)

133 - Output window top boundary pixel location (-10000 to center)

134 - Printer top margin [varies with media]

135 - Printer bottom margin [varies with media]

136 - Printer left margin [varies with media]

137 - Printer right margin [varies with media]

139 – Sets/Clears the "Trim Picked Segments Only" options in Trim commands (V. 17)
[0 = off, 1 = on]
Version 17 offers a new option in the Trim commands: Trim Picked Segments Only. This option affects whether or not segments beyond the selected segment are also trimmed away.

140 – Sets/Clears the "Grid Smoothly Degrade" checkbox in Grid Options (V. 17)
[0 = off, 1 = on]
If this is set to 1, the display grid will smoothly reduce the number of visible grid lines as you zoom out. If it is set to 0, the grid will become invisible if you zoom out too far to display every grid division.

150 - Coordinate bar angle display mode

[0 = degrees, 1 = grads, 2 = radians, 3 = degrees-minutes-seconds, 4 = bearings]

151 - Coordinate bar distance display mode

[1 = decimal, 2 = fractions, 3 = feet + fractional inches]

152 - Scale mode for retrieving/copying drawings [1 = fixed, 2 = changeable]

160 - Printed height of drawing [read_only]

161 - Printed width of drawing [read_only]

162 - Print drawing centered [0=no, 1=yes]

163 - Print drawing fit to paper [0=no, 1=yes]

164 - Consider all drawing objects when printing [0=no, 1=yes]

165 - Print panel mark style [0=none, 1=corners, 2=outline box]

166 - Print panel numbers [0=no, 1=yes]

167 - Print output style

[0=wireframe, 1=quickshade, 2=smoothshade, 3=hidden, 4=hidden (plotter), 5=hidden (scan-line)]

168 - Printed panel rows [read_only]

169 - Printed panel columns [read_only]

170 - Print selected objects only [0=no, 1=yes]

190 - Selection Handle 1 X value [-10e6<=x<=10e6]

191 - Selection Handle 1 Y value [-10e6<=x<=10e6]

192 - Selection Handle 2 X value [-10e6<=x<=10e6]

193 - Selection Handle 2 Y value [-10e6<=x<=10e6]

194 - Selection Handle 3 X value [-10e6<=x<=10e6]

195 - Selection Handle 3 Y value [-10e6<=x<=10e6]

196 - Selection Minimum X [-10e6<=x<=10e6]

197 - Selection Minimum Y [-10e6<=x<=10e6]

198 - Selection Maximum X [-10e6<=x<=10e6]

199 - Selection Maximum Y [-10e6<=x<=10e6]

200 - Selection Minimum Z [-10e6<=x<=10e6]

201 - Selection Maximum Z [-10e6<=x<=10e6]

202 - Selection Handle 1 Z value [-10e6<=x<=10e6]

203 - Selection Handle 2 Z value [-10e6<=x<=10e6]

204 - Selection Handle 3 Z value [-10e6<=x<=10e6]

205 - View rotation about X axis

206 - View rotation about Y axis

207 - View rotation about Z axis

208 - View distance

209 - Projection mode [0 = perspective, 1 = parallel]

210 - The number of view windows in the active drawing

211 - The currently active view window in the active drawing

212 - The number of drawings currently open [read_only]

213 - The currently active drawing

219 - Layer Toolbox visibility [0=off, 1=on]

220 - Toolbar visibility [0=off, 1=on]

221 - Main Toolbox visibility [0=off, 1=on]

222 - Snap Toolbox visibility [0=off, 1=on]

223 - Status Bar visibility [0=off, 1=on]

224 - Coordinate bar visibility [0=off, 1=on]

225 - Viewing Toolbox visibility [0=off, 1=on]

226 - Color Toolbox visibility [0=off, 1=on]

227 - Material Toolbox visibility [0=off, 1=on]

228 - Line Style Toolbox visibility [0=off, 1=on]

229 - Ruler visibility [0=off, 1=on]

230 - Scrollbar visibility [0=off, 1=on]

231 - Info Box visibility [0=off, 1=on]

232 - Double Line Toolbox visibility [0=off, 1 = on]

233 - Toolbox Icon style

[0=small color, 1=large color, 2=small b/w, 3=large b/w]

240 - Drag as box [0=drag image, 1=drag outline box]

241 - Save preview bitmap with drawing [0=no, 1=yes]

242 - Select object when created [0=no, 1=yes]

243 - This flag is no longer supported. Used to be Shade when Created

244 - Old-style command dialog bar [0=no, 1=yes]

245 - Show Tooltips [0=no, 1=yes]

246 - Draw text as outline [0=no, 1=yes]

247 - Group arrays when created [0=no, 1=yes]

248 - Use offscreen bitmap [0=no, 1=yes]

249 - 2D mode working plane [0=xy, 1=zy, 2=xz]

250 - AutoSave status [0=off, 1=on]

251 - AutoSave time interval (minutes)

252 - Display Grid extent

253 - 3D Display Grid Plane [0=zy, 1=xz, 2=xy]

254 - Draw text in current color [0=no, 1=yes]

255 - Draw text in current layer [0=no, 1=yes]

256 - Default text layer

257 - Text justification [0=left, 1=center, 2=right]

258 - Text style [0=normal, 1=bold, 2=italic, 3=bold italic]

259 - Text arc vertical scale

261 - Draw attributes in current color

262 - Draw attributes in current layer

263 - Default attribute layer

269 - Number of Arc Segments (V. 16)
This function how many segments to create when an arc, ellipse, or circle is created as a plane or line.
Note 1: this only affects entity creation – it does not affect conversion to plane or vector after the object is created.
Note 2: This represents the total number of segments for the new entity – 20-degree arcs and full circles will have the SAME NUMBER OF SEGMENTS. For example, if it is set to 20, a circle drawn with the "create as line" option will have 20 segments, as will a 20-degree arc created with the "Save as line" option.

270 – Display Entities by Layer Order [0 disables, 1 enables] (V. 16)
Changed in 17.1. Display Entities by Layer Order flag removed. Added instead:
AutoName Entities When Created [0 disables, 1 enables] (V 17.1)

271 – Layer List Filter Mode (V. 16
[ 0 = Active Layers Only, 1 = Named Layers Only, 2 = Active Or Named Layers Only, 3 = All Layers, 4 = Layer Groups Only]

272 – Layer List Sort Mode (V. 16)
[ 0 = by index, 1 = by status, 2 = by name, 3 = by content]

273 – Number of Multiline Styles in the current document (Read_Only) (V. 16)

274 – Number of Layer Groups in the current document (Read_Only) (V. 16)

275 – Visibility of Symbol Layers controlled by Symbol Host Layer (V. 17.1)
[0 = no, 1 = yes]
If this is set to 1, you can not hide individual layers inside symbols; the entire symbol is hidden or shown based on the visibility of its host layer.
When this is set to 0, you may hide or show entities inside the symbol by hiding or showing their original layers.

279 – MultiLine Mode Status (V. 16)
[0 = off, 1 = on]
If MultiLine Mode Status is on, all new lines will be drawn as multilines.

280 – Current Layer Group Number (V. 17)
[0 = off, 1 = on]
If MultiLine Mode Status is on, all new lines will be drawn as multilines.

281 – Current Layer Group Status (V. 17)
[0 = invisible, not editable,
2 = visible, not editable
4 = visible and editable]

282 – Select Invisible Attributes (V. 17.1)
[0=off, 1 = on]
If Select Invisible Attributes is on, the user is able to select hidden attributes that are on visible, editable layers (emulating DesignCAD behavior from Version 13 and earlier). If it is off, only attributes that are visible (and on editable layers) can be selected.

283 – Opaque Texture Maps (V. 17.2)
[0=off, 1=on]
If Opaque Texture Maps is off, the wirefram color blends with the colors of the texture map (like a photographic slide projected onto a colored screen). If it is off, the texture map hides the wireframe color of the shaded object, showing only the colors of the texture map.

Functions 290 - 299 are properties of an entity just selected with the Entity statement.

290 - Current Entity color, Red value [0-255]

291 - Current Entity color, Green value [0-255]

292 - Current Entity color, Blue value [0-255]

293 - Current Entity Double Line Cap Style [read_only]
[0=none, 1=beginning, 2=end, 3=both

294 - Current Entity Double Line AutoTrim mode [read_only]
[0=off, 1 = on]

295 - Current Entity Double Line Alignment [read_only]
[0=Left, 1 = Center, 2 = Right]

296 - Entity Symbol Type (Read-only) (V. 13)
[0=not a symbol, 1=symbol by reference, 2=embedded symbol,
3 = block]
This function indicates the symbol type of the current entity selected by the ENTITY statement.

297 - Entity Construction Line Type (Read-only) (V. 13)0
[0=not a construction line, 1=ray, 2=construction line]
This function indicates the construction line type of the current entity selected by the ENTITY statement.

298 - Entity Attribute Definition Text Type (Read-only) (V. 13)
[0=not an attribute definition, 1=fixed text, 2=changeable text]
This function indicates the text type of the current Attribute Definition entity selected by the ENTITY statement.

299 - Entity Attribute Definition Visibility (V. 13)
[0=not an attribute definition, 1=visible, 2=hidden]
This function indicates the visibility of the current Attribute Definition entity selected by the ENTITY statement.
Note: The Attribute Definition Display Mode flag (Sys(62)) must be set to 1 or 2 for ANY attribute definitions to be visible.

300 - Current drawing color, Red value [0-255]

301 - Current drawing color, Green value [0-255]

302 - Current drawing color, Blue value [0-255]

306 - Rubber-band color, Red value [0-255]

307 - Rubber-band color, Green value [0-255]

308 - Rubber-band color, Blue value [0-255]

309 – Major Grid color, Red Value [0-255] (V. 16)
Display Grid color, Red value [0-255] (V. 15 and earlier)

310 – Major Grid Color (Red Value) [0 – 255] (V. 16)
Display Grid color, Green value [0-255] (V. 15 and earlier)

311 – Major Grid Color, Blue value [0-255] (V. 16)
Display Grid color, Blue value [0-255] (V. 15 and earlier)

312 - Point color, Red value [0-255]

313 - Point color, Green value [0-255]

314 - Point color, Blue value [0-255]

315 - Selection color, Red value [0-255]

316 - Selection color, Green value [0-255]

317 - Selection color, Blue value [0-255]

318 - Dimension color, Red value [0-255]

319 - Dimension color, Green value [0-255]

320 - Dimension color, Blue value [0-255]

321 - Background color, Red value [0-255]

322 - Background color, Green value [0-255]

323 - Background color, Blue value [0-255]

324 - Selection rubberband color, Red value [0-255]

325 - Selection rubberband color, Green value [0-255]

326 - Selection rubberband color, Blue value [0-255]

327 - Entity point color (point select mode), Red value [0-255]

328 - Entity point color, Green value [0-255]

329 - Entity point color, Blue value [0-255]

331 - Cursor color, Red value [0-255]

332 - Cursor color, Green value [0-255]

333 - Cursor color, Blue value [0-255]

334 - 3D cursor X color, Red value [0-255]

335 - 3D cursor X color, Green value [0-255]

336 - 3D cursor X color, Blue value [0-255]

337 - 3D cursor Y color, Red value [0-255]

338 - 3D cursor Y color, Green value [0-255]

339 - 3D cursor Y color, Blue value [0-255]

340 - 3D cursor Z color, Red value [0-255]

341 - 3D cursor Z color, Green value [0-255]

342 - 3D cursor Z color, Blue value [0-255]

343 - Smooth solids when shading [0 = off, 1 = on]

344 - 2D Drafting Mode status [0 = off, 1 = on] read_only

345 - Point Select Mode Status [0 = off, 1 = on] read_only

346 - Double Line Mode Status [0=off, 1 = on]

347 - Ortho Mode [0=off, 1 = on]

348 - Number of material textures in drawing [read_only]

349 - Current material texture

350 - Current material color, Red value [0-255]

351 - Current material color, Green value [0-255]

352 - Current material color, Blue value [0-255]

353 - Default text color, Red value [0-255]

354 - Default text color, Green value [0-255]

355 - Default text color, Blue value [0-255]

356 - Default attribute color, Red value [0-255]

357 - Default attribute color, Green value [0-255]

358 - Default attribute color, Blue value [0-255]

359 - Default dimension color, Red value [0-255]

360 - Default dimension color, Green value [0-255]

361 - Default dimension color, Blue value [0-255]

370 - Default Double Line width

371 - Default Double Line Cap Style
[0 = none, 1 = Begin, 2 = Both, 3 = End]

372 - Default AutoTrim status [0 = off, 1 = on]

373 - Default Double Line Alignment [0 = left, 1 = center, 2 = right]

374 - Default Double Line Fill status [0 = off, 1 = on]

375 – Current MultiLine Style index

376 – Minor Display Grid Color (Red value) (V. 16)
[0 – 255]

377 – Minor Display Grid Color (Green value) (V. 16)
[0 – 255]

378 – Minor Display Grid Color (Blue value) (V. 16)
[0 – 255]

390 - Number of attribute definitions in the block entity (V. 13)

391 - Index of current attribute definition in the current block entity (V. 13)
(0 to clear, or if none selected)

392 - Indexed attribute definition type (in current block) (V. 13)
[1=fixed, 2=changeable]

393 - Indexed attribute definition visibility (in current block) (V. 13)
[1=visible, 2=hidden]

401 - Angular dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

402 - Linear dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

403 - Radius dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

404 - Diameter dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

405 - Chamfer dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

406 - Coordinate dimension prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

407 - Angular dimension suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

408 - Linear dimension suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

409 - Radius dimension suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

410 - Diameter dimension suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

411 - Chamfer dimension suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

412 - Coordinate dimension suffix [0-5]

413 - Dimension layer [0-255]

415 - Dimension line position [0 = text and arrows inside lines, 1 = text inside, arrows outside]

416 - Dimension text location

[0 = text aligned between arrows,

1 = text above and between arrows

2 = text below and between arrows

3 = text aligned to right of arrows

4 = text above and right of arrows

5 = text below and right of arrows

6 = text aligned to left of arrows

7 = text above and left of arrows

8 = text below and left of arrows]

417 - Angular text location [0 = above arrows, 1 = below arrows]

418 - Linear text direction

[0 = parallel, 1 = perpendicular, 2 = horizontal, 3 = vertical]

419 - Angular text direction [0 = parallel to center of arc, 1 = horizontal]

421 - Progressive dimension text format

[0 = 123.125, 1 = 123-1/8, 2 = 123' 1.5", 3 = 123' 1-1/2"]

424 - Dimension text format ( identical to Sys(101) - changing one changes the other)

[0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches]

425 - Progressive text direction [0 = along dimension, 1 = horizontal]

428 - Angular dimension text format
[0 = degrees, 1 = grads, 2 = radians, 3 = DMS]

433 - Angular dimension precision [-7<=x<=15]

437 - Link inward arrows [0 = off, 1 = on]

438 - Dimension text size [0<=x<=10e6]

441 - Dimension tolerance text size [0<=x<=10e6]

442 - Overshoot of Dimension extension lines [0<=x<=10e6]

443 - Gap of Dimension extension lines [0<=x<=10e6]

444 - Length of Dimension extension lines [0<=x<=10e6]

445 – Arrowhead size (for non-dimension arrows) * New in 16

446 - Text balloon radius [0<=x<=10e6]

447 - Dimension line offset for baseline dimension [0<=x<=10e6]

450 - Dimension arc prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

451 - Dimension arc suffix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

452 - Dimension arc text location [0 = above, 1 = below]

453 - Pullout text location [0 = inline, 1 = above, 2 = below]

454 - Progressive dimension text location [1 = above, 2 = below]

455 - Dimension chamfer text location [0 = inline, 1 = above, 2 = below]

456 - Dimension arc text orientation [0 = along center of arc, 1 = horizontal]

457 - Pullout text orientation

[0 = parallel to arrow, 1 = perpendicular to arrow, 2 = horizontal, 3 = vertical]

458 - Progressive dimension text orientation

[0 = horizontal, 1 = vertical, 2 = upside down, 3 = vertical reversed]

459 - Dimension chamfer text orientation

[0 = parallel to arrow, 1 = perpendicular, 2 = horizontal, 3 = vertical]

462 - Dimension arrowhead scale [0<=x<=1.0e6]
Length of arrowhead. In older versions (15 and older) this value was relative to text size (i.e. 2.0 gave an arrowhead twice as long as the text height). In version 16 and later, it is the actual size in units (i.e. 2.0 gives an arrowhead 2 units long).

463 - Dimension arc precision [-7<=x<=15]

464 - Dimension chamfer precision [-7<=x<=15

465 - Dimension coordinate precision [-7<=x<=15

466 - Dimension diameter precision [-7<=x<=15

467 - Dimension radius precision [-7<=x<=15

468 - Dimension progressive precision [-7<=x<=15

469 - Dimension radius progressive precision [-7<=x<=15

470 - Prevent user from starting commands while macro is running [0 = off, 1 = on]

Use this function to prevent the user from starting a command while the macro is waiting for the user to set points. It is only effective until the current macro ends.

480 - Prevent entity types from being selected. Use repeated calls to disable more than one entity type. Set to zero to restore normal selection. This function is only effective until the current macro ends.

[0 clears, 1 disables lines, 16 disables circles/arcs, etc. See the PutAttr statement for a list of entity type numbers.]

481 - Prevent drawing commands from accessing point information from objects on hidden layers.

[0 = off, 1 = on]

500 - Dimension Baseline text location

[0 = text aligned between arrows,

1 = text above and between arrows

2 = text below and between arrows

3 = text aligned to right of arrows

4 = text above and right of arrows

5 = text below and right of arrows

6 = text aligned to left of arrows

7 = text above and left of arrows

8 = text below and left of arrows]

501 - Dimension Baseline text format
[0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches]

502 - Dimension Baseline Text Orientation

[0 = parallel, 1 = perpendicular, 2 = horizontal, 3 = vertical]

503 - Dimension Baseline text precision [-7<=x<=15]

504 - Dimension Baseline prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

505 - Dimension Baseline suffix [0-5]

[0 = None, 1 = Custom1, 2 = Custom2, etc.]

510 - Dimension Extended text location

[0 = text aligned between arrows,

1 = text above and between arrows

2 = text below and between arrows

3 = text aligned to right of arrows

4 = text above and right of arrows

5 = text below and right of arrows

6 = text aligned to left of arrows

7 = text above and left of arrows

8 = text below and left of arrows]

511 - Dimension Extended text format

[0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches]

512 - Dimension Extended text orientation

[0 = parallel, 1 = perpendicular, 2 = horizontal, 3 = vertical]

513 - Dimension Extended text precision [-7<=x<=15]

514 - Dimension Extended prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

515 - Dimension Extended suffix [0-5]

[0 = None, 1 = Custom1, 2 = Custom2, etc.]

520 - Dimension Distance text location

[0 = text aligned between arrows,

1 = text above and between arrows

2 = text below and between arrows

3 = text aligned to right of arrows

4 = text above and right of arrows

5 = text below and right of arrows

6 = text aligned to left of arrows

7 = text above and left of arrows

8 = text below and left of arrows]

521 - Dimension Distance text format
[0 = decimal, 1 = fractional, 2 = feet and decimal inches, 3 = feet and fractional inches]

522 - Dimension Distance text orientation

[0 = parallel, 1 = perpendicular, 2 = horizontal, 3 = vertical]

523 - Dimension Distance text precision [-7<=x<=15]

524 - Dimension Distance prefix [0-5]

[0 = None, 1-Custom1, 2=Custom2, etc.]

525 - Dimension Distance suffix [0-5]

[0 = None, 1 = Custom1, 2 = Custom2, etc.]

530 - Layer uses specific color (0/1) (V. 14)
(don't set this unless you've already set 531, 532, and 533)

531 - layer red (default 0) (V. 14)

532 - layer green (default 0) (V. 14)

533 - layer blue (default 0) (V. 14)

534 - layer uses specific linestyle (0/1) (V. 14)

535 - linetype (default 0) (V. 14)

536 - linescale (default 2) (V. 14)

537 - unit-based linewidth (default 0) (V. 14)

538 - layer uses fixed linewidth (0/1) (V. 14)
if 0, use the width specified by Sys(537);
if 1, use the linewidth specified by Sys(539)

539 - fixed linewidth in hundredths of mm (ex. 50 = .5 mm). (V. 14)
If the width specified does not match one of the preset values, the actual width will change to the next lowest preset width value (0.00, 0.05mm, 0.09mm, 0.13mm, etc.), so for example 12 would revert to 9, for 0.09mm.

540 - layer uses filled lines (V. 14)

541 - enforce layer color settings on all new entities (V. 14)

542 - enforce layer linestyle settings on all new entities * (V. 14)

550 - Default Fixed Lineweight (in 1/100ths of a millimeter) (V. 14)
[1=visible, 2 = hidden]
This function indicates the current default linewidth if fixed lineweight is active (and no layer settings override the default setting).

551 - Fill fixed-weight lines (applies to on-screen display only) (V. 14)
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be filled on-screen.

552 - Display Fixed-weight lines onscreen (V. 14)
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be displayed at their fixed width on-screen.

553 - Print Fixed-weight lines (V. 14)
[0=no, 1 = yes]
This function indicates whether fixed-weight lines will be printed at their set fixed width. If both Sys(553) and a print-option pen weight are specified, then the print-option width will be the minimum lineweight printed.

554 - Scale factor for fixed-weight lines (per-session only, not stored in the drawing) (V. 14)
This function allows you to scale the fixed-weight lines if desired when printing to different sizes than usual. For example, if you normally print a D-size plot, and need to do a letter-sized test print, you can scale the fixed-weight lines down to avoid losing details due to the fixed line width.

555 - Attribute Definition behavior when exploding blocks (V. 14)
[1=explode to attribute (uses the text contents, not the tag name)
2=leave as attribute definition]
This function allows you to control what happens to attribute definitions when a block is exploded.

600 - Minimum X-value of the current display area [-10e6<=x<=10e6]

601 - Maximum X-value of the current display area [-10e6<=x<=10e6]

602 - Minimum Y-value of the current display area [-10e6<=x<=10e6]

603 - Maximum Y-value of the current display area [-10e6<=x<=10e6]

650 - Distance value returned by AngleDistance or LineDistance

651 - X-angle value returned by AngleDistance or LineAngle

652 - Y-angle value returned by AngleDistance

653 - Z-angle value returned by AngleDistance

654 - XY-angle value returned by AngleDistance

655 - Area value returned by Area or SurfaceArea or Volume

656 - Volume value returned by Volume command

657 - Interference check result

658 – Perimeter command result (V. 17)
The numeric result of the >Perimeter macro command is stored here.

800 - Macro debug trace mode [0=off, 1=on, 2 = log to file] This function allows you to examine the behavior of all or part of your macro as it executes. The macro will print each line to the debug window as the line is executed. When you set this function's value to 2, DesignCAD will dump the trace results to a log file, appending a .log extension to the macro's name (i.e. "MyMacro.d3m" logs to "MyMacro.d3m.log")

801 - Paperspace Mode [0=off, 1=on]

802 - Number of Paperspace Layouts -- can be set to 0 to delete all existing layouts.

803 - Index of current Paperspace Layout (starts at 1)

804 - Orientation of current Paperspace Layout [0 = Portrait, 1= Landscape]

805 - Paper Width (inches) of current Paperspace Layout

806 - Paper Height (inches) of current Paperspace Layout

807 - Left Margin (inches) of current Paperspace Layout

808 - Right Margin (inches) of current Paperspace Layout

809 - Top Margin (inches) of current Paperspace Layout

810 - Bottom Margin (inches) of current Paperspace Layout

811 - Paper Measurement Units of current Paperspace Layout [1=inches, 25.4=mm, 2.54 = cm, .0254 = m]

996 - Enhanced Esc Key Behavior
[0 (default) -- Esc key behaves normally- if pressed during a drawing command (such as Circle or Line), it terminates that command and offers the chance to end the entire macro. If pressed in the middle of a batch of macro language operations, it ends the macro immediately.

1 (enhanced) -- Esc key opens "do you want to quit?" dialog box. Answer "No" resumes operation without skipping any commands. Answer "Yes" terminates the macro. If Esc is pressed during a drawing command (such as Circle or Line), that command is NOT terminated if the user answers "No"- you must either complete the command or end the entire macro.]

You can turn Sys(996) off and on for different parts of your macro. If you CHAIN to another macro, the current setting of Sys(996) is lost; the new macro assumes default behavior unless there is code that specifically turns on the enhanced mode.

Note:Sys(996) does not interfere in any way with the operation of Sys(999), which is specifically for Input statements.

997 - Save empty files [0=no, 1=yes]

998 - Document changed since last save [0=no, 1=yes]

999 - INPUT Exit condition: 0 for Enter or OK; 1 for Esc or Cancel

1000 - Print By Layer Order [0 = no, 1 = yes]. If off, prints in display order.

1001 - Snap range in pixels. This sets the minimum distance in pixels that the cursor must be from the desired snap location.

1002 - Skip DWG Hatch patterns [0= no, 1 = yes]. If this mode is on, all DWG hatch patterns will be skipped when importing DWG files. Occasionally this may help import an otherwise intractable DWG drawing.

1004 - 2-Point line DWG/DXF export [0=off, 1=on] (V. 13)
This function allows you to turn the option to export lines as 2-point line entities instead of polyline entities. The default setting is off. If turned on, this function will export ALL polylines in the drawing as 2-point Line entities.

1008 - Backup File Save status [0=off, 1=on]. (Read/Write) (V. 13)
This function indicates whether DesignCAD is set to automatically copy the previous version of your drawing to a BAK file when you save it.

1009 - Construction line visibility flag [0=hidden, 1=visible] (Read/Write) (V. 13)
This function indicates whether DesignCAD shows or hides construction line entities.

1010 - DWG Export code page
Supported code pages:
-1 - use the codepage of the active keyboard layout
0 - use the code page in the DesignCAD drawing file
1250 - Eastern Europe (Poland, Czech Republic, etc.)
1251 - Cyrillic (Russia)
1252 - US, Western European
1253 - Greek
1254 - Turkish
1257 - Baltic (Latvia, Slovenia, etc.)

1011 - DWG Import code page
Supported code pages:
-1 - use the codepage of the active keyboard layout
0 - use the code page in the DWG file
1250 - Eastern Europe (Poland, Czech Republic, etc.)
1251 - Cyrillic (Russia)
1252 - US, Western European
1253 - Greek
1254 - Turkish
1257 - Baltic (Latvia, Slovenia, etc.)

1015 - Sticky Handle mode [0=off, 1=on] (R/W) (V. 13)
This function controls whether DesignCAD saves selection handles with the entity or not.

1016 - Synchronize Snap Grid to Display Grid [0=off, 1=on] (R/W) (V. 13)
This function controls whether DesignCAD keeps the display grid and snap grid aligned to the same center. In previous versions the snap grid was always centered on the origin, but the new default behavior is to align them both on the same center. Therefore it is now possible to move the display grid center and have the snap grid shift to match.

1020 - Number of points to average when using SmoothLine (menu command Smooth Line by Point Reduction) (V. 13)

1021 - Sets the smoothing angle to be used by SmoothLine2 (menu command Smooth Line by Angle Detection) (V. 13)

1022 - Smoothed lines convert-to-curves flag [0=leave, 1=convert to curve] (V. 13)

1023 - Enable/Disable SmoothOptions dialog for smooth commands. (V. 13)
[0=hide, 1=show]

1024 - Angle Constraint mode [0=off, 1=on] (R/W) (V. 13)
This function allows the programmer to enable or disable Angle Constraints in a macro.

1027 - Message Box Style for the Message statement (V. 13)
[0=OK (default)
1 = OK/Cancel
2 = Abort/Retry/Ignore
3 = Yes/No/Cancel
4 = Yes/No
5 = Retry/Cancel]
This function allows the programmer to specify the style of MessageBox that appears for the Message statement.

1028 - Return code for the last Message statement (Read-only) (V. 13)
[1=OK
2 = Cancel
3 = Abort
4 = Retry
5 = Ignore
6 = Yes
7 = No]
This function allows the programmer to determine the user's response to a Message statement.

1032 - Plane Snap mode [0 or 1] (R/W) (V. 13)
This function controls the behavior of the Plane Snap command. When set to zero, the plane snap command snaps to the nearest point in the mathematical plane occupied by the nearest surface (but that point may not actually be on the surface).
When set to one, the plane snap command behaves normally, and always snaps to the nearest point on the nearest surface (default).

1033 - Symbol Snap mode [0 or 1] (R/W) (V. 13)
This function controls the behavior of the Snap commands in the vicinity of symbols. When set to zero, the snap commands ignore entities that are embedded in symbols. When set to one (default), the snap commands can snap to points on entities inside symbols.

1035 – Reconstruct grids after solid operations [0=no, 1=yes] (V. 15)
By default, DesignCAD will attempt to combine adjacent facets from a cut grid entity into one or more new grids. By turning this flag off, all facets of a cut grid will be converted to planes.

1036 -- selectable invisible attributes? [0=no, 1 = yes] (V. 15)
If this is set to 1, SelectAll will select both visible and hidden attributes on visible layers.

1100 – Current Units of Measurement (V. 15)
[0 = none, 1 = inches, 2 = feet, 3 = miles, 4 = mm, 5 = cm, 6 = m, 7 = km]

1101 – Default Units of Measurement for new drawings (V. 15)
[0 = none, 1 = inches, etc.]

1102 – Default Units of Measurement for unitless drawings (V. 15)
[0 = none, 1 = inches, etc.]

1103 – Interruptible Snap Mode (V. 15)
[0 = off, 1 = on]

1104 – Running Snap Mode (V. 15)
[0 = off, 1 = on]
Which snaps are on during Running Snap Mode is determined by Sys(1105) – (1109)

1105 – Running Gravity Snap (V. 15)
[0 = disabled, 1 = enabled]

1106 – Running Line Snap (V. 15)
[0 = disabled, 1 = enabled]

1107 – Running Midpoint Snap (V. 15)
[0 = disabled, 1 = enabled]

1108 – Running Intersect-1 Snap (V. 15)
[0 = disabled, 1 = enabled]

1109 – Running Tangent Snap (V. 15)
[0 = disabled, 1 = enabled]

1110 – Current Toolbars Visibility (V. 15)
[0 = off, 1 = on]
Reflects the current status of Show All Toolbars command

1111 – Snap to Hatch points (V. 15)
[0 = disabled, 1 = enabled]

1112 – File Lock (V. 15)
[0 = unlocked, 1 = locked by another instance of DesignCAD]

1113 – Drawing Handles Visible (V. 15)
[0 = no, 1 = yes]

1114 – Printing Base Units (V. 15)
[1 = inches, 2 = feet, 3 = mi, 4 = mm, 5 = cm, 6 = m, 7 = km] See also Sys(10)

1115 – Explode Symbols/Blocks at Top-Level only (V. 15)
[0 = no (explodes recursively) 1 = yes (retains sub-blocks or symbols)]

1116 – PresetPoint Mode (V. 15)
[0 = off, 1 = on]

1117 – Skip font data when saving DC2/DC3 ASCII files. (V. 15)
[0 = off, 1 = on]

1118 – Ortho tolerance angle (Default value 10 degrees) (V. 15)
This setting controls the maximum deviation from horizontal/vertical axes that the Ortho command will convert to horizontal or vertical.

1119 – Truncate trailing zeros in dimensions? (V. 15)
[0 = no, 1 = yes]

1120 – Truncate trailing zeroes in angular dimension? (V. 15)
[0=no, 1=yes]

1121 – Truncate trailing zeroes in arc dimensions? (V. 15)
[0=no, 1=yes]

1122 – Truncate Trailing zeroes in chamfer dimensions? (V. 15)
[0=no, 1=yes]

1123 – Truncate trailing zeros in diameter dimensions? (V. 15)
[0=no, 1=yes]

1124 – Truncate trailing zeros in radius dimensions? (V. 15)
[0=no, 1=yes]

1125 – Truncate trailing zeros in coordinate dimensions? (V. 15)
[0=no, 1=yes]

1126 – Truncate trailing zeros in progressive dimensions? (V. 15)
[0=no, 1=yes]

1127 – Truncate trailing zeros in progressive radius dimensions? (V. 15)
[0=no, 1=yes]

1128 – Truncate trailing zeros in distance-only dimensions? (V. 15)
[0=no, 1=yes]

1129 – Truncate trailing zeros in baseline dimensions? (V. 15)
[0=no, 1=yes]

1130 – Truncate trailing zeros in extended dimensions? (V. 15)
[0=no, 1=yes]

20000 - Owner Validated flag. This is set to 1 if a protected drawing has been accessed with the correct password. The value is zero if the owner has not entered the password during this session, or if the drawing is unprotected.

20001 - Password Protected. [0 if unprotected, non-zero otherwise].

20004 - Export disabled. [1 prevents export to other file formats; 0 allows export (no layer protection in the exported file)]

20007 - Save To Older Format disabled [ 1 prevents the file from being saved to older DesignCAD file formats; 0 allows the file to be saved to older formats (no layer protection in the saved file)]

20008 - Symbol Load/Merge disabled [1 prevents the file from being loaded as a symbol or from being merged into another drawing. 0 allows the drawing to be merged or used as a symbol (no layer protection in the loaded/merged data)]

20011 - Priority Class. [32 = normal, 64 = idle, 128 = high priority, 256 = real-time priority].

To use the SYS function in a macro, use it like you would any other function. For example, the following program segment checks that at least three points have been set:

if Sys(1) < 3 then

setpoint "Set at least three points." 3

end if

The SYS function is different from the other macro functions in that you can assign a value to most SYS variables. In other words, you can use the SYS function on the left side of the equal sign in an Assignment statement. For example, to set the current layer to layer number seven, you could use the following statement:

SYS(3) = 7

This is equivalent to using the macro language statement LAYER(7)=14.

When assigning a SYS function value to a variable however, it is necessary to place the variable on the left side of the equal sign. For example to set the current value for SYS(421) to the new variable v, you could use the following statement:

v = SYS(421)

SYS variables nine (the number of entities in the drawing) and 90-99 (entity characteristics) cannot be modified by assigning a value to the SYS function – they are read-only variables. There are other read-only SYS variables; they are noted as such in the chart above.

When some of the SYS variables are modified, the DesignCAD drawing screen should be regenerated with the REGEN statement or the DesignCAD >Regenerate command (or the >RegenerateAll command to update all views). For example, if you change the view characteristics or the screen colors, the drawing screen must be regenerated for correct operation. The macro language interpreter does NOT check for valid SYS assignments or screen regeneration – if you change the SYS variables, your macro is responsible for all validity checking.

The SYS variables 90-93 can be used together with the ENTITY statement to read the type, line type, and layer of the entity referred to by the last ENTITY statement.


SelectMode

>SelectMode

{

}

Same as PointSelectMode above

Compatibility: All versions


Text2D

>Text2D

{

<Style t

[0 = normal, 1 = bold, 2 = italic, 3 = bold italic]

<Justification j

[0 = left, 1 = center, 2 = right]

<Size s

text size

<Angle a

default text angle (if only one point is set)

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<Text text$

the text contents

<Type t

0=normal text, 1=vector text

<Color r, g, b

<Layer laynum

<NULL

<Incomplete

<Points: 1 = placement, 2 = angle

}

Draws 2D text.

Compatibility: All versions

Example:

t$ = "Let's draw some 2D text now."

Sys(33) = 1 'use vector font

>Text2D

{

<Style 2

<Justification 1

<Size 3

<Font "Simplex_Win"

<Text [t$]

<Angle 0

<Pointxyz 15, 0, 0

}


Text3D

>Text3D

{

<Style t

[0 = normal, 1 = bold, 2 = italic, 3 = bold italic]

<Justification j

[0 = left, 1 = center, 2 = right]

<Size s

text size

<Angle a

default text angle (if only one point is set)

<Font font$

the full name of the Windows font, ex. "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Text text$

the text contents

<Type t

0=normal text, 1=vector text

<Color r, g, b

<Layer laynum

<NULL

<Incomplete

<Points: 1 = placement, 2 = angle and length, 3 = height and direction

}

Draws 3D text.

Compatibility: All versions

Example:

Sys(33) = 0 ' use TrueType font

t$ = "What is this Text3D command, anyway?"

>Text3D

{

<Style 2

<Justification 1

<Size 3

<Font "Times New Roman"

<Text [t$]

<Angle 0

<Pointxyz 15, 0, 0

}


OrthoMode

>OrthoMode

{

}

Toggles OrthoMode off or on.

Compatibility: All versions


END Statement

PURPOSE:To terminate the macro and return to DesignCAD.

SYNTAX:END

EXPLANATION:The END statement can be placed anywhere in the macro. When the End statement is executed, the macro terminates. This statement is the same as the STOP statement.

COMPATIBILITY:All versions

EXAMPLES:

If i >= max Then

End

Else

Print "I less than max"

End If

End


SelectMove

>SelectMove

{

}

Same as Move above

Compatibility: All versions


ViewChange

>ViewChange

{

<Angle ax, ay, az

rotation angles about x, y, and z

<Type t

[0 = perspective, 1 = parallel]

<PRP 0, 0, distance

distance from target

<VRP vx, vy, vz

viewer reference point (camera location)

<Zoomfactor f

}

Change the current view angles and view distance.

Compatibility: All versions

Example:

>Box

{

<Pointxyz -20, -20, -20

<Pointxyz 20, 20, 20

}

>ViewChange

{

<Type 0

<Angle 30, 30, 30

<Zoomfactor 2.00

<VRP 10, 10, 0

<PRP 0, 0, 2000

}


A_Tag Parameter

A_TAG ParameterQuery and Change Parameters

A_TAG

Declaration: Alias A_TAG &H0602

Arguments: A string representing the attribute definition's tag or name

Accessibility: Query/Change

Purpose: This parameter allows you to query and change an attribute definition's tag (the text that is visible when it's not part of a block).

Query Usage:

Query A_Tag, atag$

where atag$ is a string variable

Change Usage:

Change A_Tag, atag$

where atag$ can be a string variable or expression

Compatibility: Version 14 and higher


ApplyMaterial

>ApplyMaterial

{

}

Applies the current material to the selected items. The current material index can be obtained from Sys(349), or the material name from Sys$(91).

Compatibility: All versions


EA_Radius1 Parameter

EA_RADIUS1 ParameterQuery and Change Parameters

EA_RADIUS1

Declaration: Alias EA_RADIUS1 &H0402

Arguments: One floating-point number representing the first radius of the ellipse or elliptical arc (this is not necessarily the longest radius).

Accessibility: Query/Change

Purpose: This parameter allows you to query and change the first radius of the elliptical arc. Changes to the first radius will not change the second radius, but may affect the location of the starting and ending points of the ellipse or elliptical arc, and the endpoint of the first axis.

Query Usage:

Query EA_Radius1, r1

where r1 is a numeric variable

Change Usage:

Change EA_Radius1, r1

where r1 is a numeric variable or expression

Compatibility: Version 14 and higher


MoveToFrontOf

>MoveToFrontOf

{

<Point - item to be directly "behind" the selected items.

}

Moves the selected items to the front of the clicked item in the display list (so they appear to be "in front of" the object referenced by the point).

Compatibility: All versions


Command Line Invocation

Command Line Invocation of Macros and Exes

New for version 14

You can now run macros and executables from the commandline, optionally with command-line parameters, and you don't have to use the "Run" command to do it. You can even omit the extension.

For example: press the spacebar and type "params test.txt".

DesignCAD first determines that there is no internal command named "params". It then looks for a matching macro filename, checking first for file extension BSX, then BSC, then D3M, in that order. If it finds no such macro, it looks for an EXE file. You may of course specify the proper extension to bypass the extra searching.

If params is a macro, the rest of the command line is copied to Sys$(0); it is up to the macro to parse the string into different values as required by its code.

If params is an executable, the rest of the string is passed to that program's command line, and the program can optionally parse the results.

Paths: If no path or extension is specified, DesignCAD will first search for a macro in DesignCAD's default macro directory, then in DesignCAD's home directory; if no macro is found, it will then look for an exe in DesignCAD's default exe directory, then DesignCAD's home directory, then the Windows directory. Of course, you can specify the full path to the macro or program to bypass this search.


LinePlane

>LinePlane

{

<Points: 1 = line, 2 = plane

}

This command moves the cursor to the intersection of a line and a plane.

Note: To place an intersection of a line and a plane for use by a macro command, use the parameter <LinePlane xl, yl, zl, xp, yp, zp. See Parameters to Set Points.

Compatibility: All versions


HideRestoreToolbars

>HideRestoreToolbars

{

}

Toggles the visibility of all currently enabled toolbars at once.

Compatibility: Version 15 and higher


SetShadeStyle

>SetShadeStyle

{

<ShadeStyle s

[0=quick, 1=gouraud, 2=gouraud anti-aliased, 3=phong, 4=phong anti-aliased]

<EnableTransparency t

[0=off, 1=on]

<EnableFog f

[0=off, 1=on]

<FogStyle s

[0=linear, 1=exp, 2=exp2]

<Fogdensity d

fog density as a percentage (ex. 10 = 10%)

<FogStart fs

fog start position relative to drawing depth at the current viewing angle
(ex. 0.2 = 20% into the drawing)

<FogEnd fe

fog ending position (location of 100% density) relative to drawing depth at the current viewing angle (ex. 0.9 = 90% into the drawing)

<FogColor r, g, b

fog color

<EnableBackgroundFog fb

[0=no, 1=yes]

}

Sets the shading style for non-accelerated shading.

Compatibility: Version 14 and higher.


RecursiveGroupExplode

>RecursiveGroupExplode

{

}

Explodes all groups and nested groups that are currently selected. Afterwards the selected entities are not part of any group.

Compatibility: Version 17 and higher


PresetPoint

>PresetPoint

{

<Points: set any points you want using the PointXYZ, PointPolar, and other point-setting macro parameters

}

Stores one or more points in the point buffer, just as if you had used SetPoint to have the user set points..

Compatibility: Version 13 and higher

Example: Draw a line using some existing points that were set in Preset Point Mode, then set some more using PresetPoint and draw a curve through those points.

Enter Preset Point Mode, set a few points, then run this macro. It should draw a line through the points you preset, then draw a curve. After the macro has completed, press "V" or run the Line command. It should draw a horizontal line using the last two points set by the macro.

If Sys(1) < 1 Then
Message "No pre-existing points -- skipping Line command"
Else
>Line
{
<UsePresetPoints
}
End If
' clear the preset points
Sys(1) = 0
>PresetPoint
{
<Pointxyz 10, 0, 0

<PointRel 10, 0, 0
<PointRel 0, 20, 0
<PointRel -10, 0, 0
<PointRel 0, -30, 0
}

' Changed my mind -- I don't like the last point
>ErasePresetPoint
{

}

' Add a new corrected point

>PresetPoint

{

<PointXYZ 10, 0, 0

}
>Curve

{

<UsePresetPoints
' I can still add more points this way...

<Pointxyz 30, 20, 0

}
' clear points again

Sys(1) = 0
' set two points ready for use by presetpoint mode on exit.
>PresetPoint

{

<Pointxyz 10, 10, 0
<Pointxyz 25, 10, 0

}

End


Split

>Split

{

<Center bcenter

[0 = segment not centered, 1 = deleted segment centered on first point]

<Distance d

the length of the segment to be removed

<Cap bopen

[0 = don't cap double lines at the split, 1 – cap double lines]

<SelectOnly bselonly

[0 = allow non-selected lines to be split, 1 = only split selected lines]

<Points: 1 = beginning or center of split, 2 = direction of split from first point (if not centered)

}

Creates a gap of a preset length in a line or double line.

Compatibility: Version 15 and higher


DL_Width Parameter

DL_WIDTH ParameterQuery and Change Parameters

DL_WIDTH

Declaration: Alias DL_WIDTH &H0202

Arguments: One number (floating-point) representing the doubleline entity's width.

Accessibility: Query/Change

Purpose: This parameter allows you to examine or change the width of a doubleline entity.

Query Usage:

Query DL_WIDTH, edlwidth

where edlwidth is a numeric variable to hold the entity's current width

Change Usage:

Change DL_WIDTH, edlwidth

where edlwidth is a numeric variable or expression that specifies the desired new width.

Compatibility: Version 14 and higher


PSViewerBox

>PSViewerBox

{

}

Prompts the user to set points to create paper-space view frame. Only works in Paper Space Mode.

Compatibility: All versions


BM_InsertionPoint Parameter

BM_INSERTIONPOINT ParameterQuery and Change Parameters

BM_INSERTIONPOINT

Declaration: Alias BM_INSERTIONPOINT &H0D01

Arguments: Three floating-point numbers for the x, y, and z component of the lower left corner of the bitmap.

Accessibility: Query/Change

Purpose: Ths parameter allows the programmer to locate or move the insertion point of the bitmap entity.

Query Usage:

Query BM_InsertionPoint, bmx, bmy, bmz

where bmx, bmy, and bmz are numeric variables.

Change Usage:

Change BM_InsertionPoint, bmx, bmy, bmz

where bmx, bmy, and bmz are numeric variables or expressions.

Compatibility: Version 14 and higher


ALIAS Statement

PURPOSE:To replace one string of text in the macro program with another string.

SYNTAX:ALIAS name text-being-aliased

EXPLANATION:The ALIAS statement allows the programmer to create shortcuts for longer or less readable pieces of text in the macro. This useful statement allows you to create new names for Sys() functions, Sys$() functions, frequently used strings of text, or any other short piece of code.

The alias name can be up to twenty characters long, just as normal variable names can be. The text-being-replaced must be short enough that the entire ALIAS statement line does not exceed 255 characters. However, you should always remain aware that the length of a line of code that uses aliases is calculated as if the replacement text were actually there.

When the macro is read into memory, DesignCAD replaces all aliases with the actual text they represent before running the macro. This means that replacing long lines of text with short alias names may get you into trouble if you aren't careful.

Note: Do NOT use a comma to separate name and text-being-aliased, or the comma will become part of the alias.

Alias Abe1 "Four score and seven years ago,"
Alias Abe2 " our fathers brought forth on this"
Alias Abe3 " continent a new nation..."
' Now we use the aliased strings in a statement:
t$ = Abe1 + Abe2 + Abe3
' This line of code, apparently 23 characters long,
' is actually converted to
t$ = "Four score and seven years ago, " + _
" our fathers brought forth on this" + _
" continent a new nation..."
' which is a 109-character line of code. This isn't too
' long for DesignCAD to handle, but you can see how longer ' aliases might have exceeded the maximum line length.
' DesignCAD will warn you if you exceed the 255-character
' line-length limit.

Remember that the ALIAS statement must come before the code that uses the alias. Aliases may be loaded from INCLUDEd files, so long as the INCLUDE statement precedes the first use of the alias.

An aliased identifier cannot be used inside double quotes as part of a string, but it can be appended to the contents of a string using the normal rules for string concatenation.

Aliases are only replaced once, when the macro is first loaded. This means that you cannot redefine aliased strings dynamically while the macro is running.

COMPATIBILITY:Version 13 and later

EXAMPLES:

Alias now Sys$(7) ' current time

currentTime$ = now

Alias wmfSize Sys(45)

wmfSize = 2.5 'set up wmf export to ouput 2.5 inch wmf files

Alias myHero "Albert Einstein "

t$ = myHero, "was a mathematician"


ViewerLeft

>ViewerLeft

{

}

Rotates the camera to the left.

Compatibility: All versions


SaveAs

>SaveAs

{

<SelectOnly ss

[0=save everything, 1=only save selected items]

<Save2D t

[0=no, 1=2D projection, 2=2D with hidden line removal, 3=2D hidden line with automatic cleanup]

<Filename "filename.ext"

}

Saves the current drawing under a new filename.

Note: As with the Merge command and other file-related commands, you can use an asterisk at the beginning of the filename as a shortcut reference to the directory containing the DesignCAD program.

Compatibility: All versions

Example:

>New

{

}

>Sphere

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Color 128, 0, 255

<Layer 3

}

>SaveAs

{

<Filename "*\saveas.dc"

}

>Sphere

{

<Pointxyz 20, 0, 0

<Pointxyz 20, 10, 0

<Color 255, 0, 0

}

>SaveAs

{

<Filename "*\spheres2.dc"

}

>SaveAs

{

<Filename "*\spheres2.dc3"

}

>PointSelect

{

<Pointxyz 20, 10, 0

}

>SaveAs

{

<SelectOnly 1

<Filename "*\spheresel.dc"

}


PaperSpaceConfiguration

>PaperSpaceConfiguration

{

}

Opens the PaperSpace Configuration dialog box.

Compatibility: All versions


TAB Statement

PURPOSE:To move the cursor in a text window to a certain column.

SYNTAX:TAB column

EXPLANATION:This statement moves the cursor to a specified column in the text window. The next PRINT statement will begin at that column.

If the new column is less than the current column, the cursor will move to the next line. The average character width of the current font is used to calculate character columns, since in Windows different characters may have different widths.

Note: The TAB statement is ignored by PRINT # statements.

See Also: PRINT, PRINT #

COMPATIBILITY:All versions

EXAMPLE:

Window 5, 30 ' open a window 5 x 30 chars.
Print "left side"; ' ";" leaves on same line
Tab 20 ' move to column 20
Print "right side" ' print at column 20


Ellipse

>Ellipse

{

<Type t

[0 = normal, 1 = vector, 2 = plane]

<Points: 1 = center, 2 = major axis, 3 = minor axis

}

This command draws an ellipse.

Compatibility: All versions

Example:

n = 4

red = 128

blue = 255

green = 128

>Ellipse

{

<Color [red, blue, green]

<Layer [n]

<Type 0

<Pointxyz 0, 0, 0

<Pointxyz 20, 10, 0

<Pointxyz -10, 5, 0

}


DeleteWorkplane

>DeleteWorkplane

{

<Name WpName$

}

Deletes the named custom workplane. If no such name exists, the command has no effect.

Compatibility: Version 13 and higher


ObjectRepeat

>ObjectRepeat

{

}

Deprecated. Same as Array above. Array is the preferred command.

Compatibility: All versions


TextOutlineFill

>TextOutlineFill

{

}

Toggles between filled and unfilled text.

Compatibility: All versions


CLEAR Statement

PURPOSE:To erase all variables in the macro.

SYNTAX:CLEAR

EXPLANATION:This statement is used to erase and de-allocate all variables in the macro. It can be used to free memory or to re-initialize variables.

COMPATIBILITY:All versions

EXAMPLE:

Clear


EA_Radius2 Parameter

EA_RADIUS2 ParameterQuery and Change Parameters

EA_RADIUS2

Declaration: Alias EA_RADIUS2 &H0403

Arguments: One floating-point number representing the second radius of the ellipse or elliptical arc (this is not necessarily the longest radius).

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the second radius of the elliptical arc. Changes to the second radius will not change the first radius, but may change the location of the starting and ending points of an elliptical arc, and the endpoint of the second axis.

Query Usage:

Query EA_Radius2, r2

where r2 is a numeric variable

Change Usage:

Change EA_Radius2, r2

where r2 is a numeric variable or expression

Compatibility: Version 14 and higher


PolygonAdd

>PolygonAdd

{

}

Adds two or more shapes together to form one continuous shape. The shapes must line in the same plane.

Compatibility: Version 13 and later

Example: Add two circles to form a single shape.

>Circle

{

<Pointxyz 20, 20, 0

<Pointxyz 30, 20, 0

}

>Circle

{

<Pointxyz 35, 20, 0

<Pointxyz 45, 20, 0

}

>PolygonAdd

{
<Pointxyz 20, 30, 0

<Pointxyz 35, 30, 0

}


DO WHILE and LOOP Statements

PURPOSE:To execute a series of instructions in a loop.

SYNTAX:DO WHILE logexpression

.

.

.

LOOP

EXPLANATION:The DO WHILE statement is used to start a loop that will be executed as long as the logical expression "logexpression" is true. When the LOOP statement is encountered, macro execution is transferred back to the DO WHILE statement and the logical expression is checked again. When the expression is false, execution continues at the first line after the LOOP statement.

The logical expression consists of one or more relational expressions separated by AND or OR. A logical expression can also be preceded by NOT.

A relational expression consists of two numeric or string expressions separated by one of the following relational operators: <, <=, =, >=, >, <>.

When using a DO loop, be sure the logical expression will eventually change to false, or the loop will never end.

DO loops can be nested, that is, one DO loop can be placed inside another. DO loops can be nested up to 20 levels deep.

See Also: EXIT DO

COMPATIBILITY:All versions

EXAMPLE:

j = 1

Window 5,8

Do While j < 20

Print j

j = j * 2

Loop

Print "done"

Anykey

'opens a text window

'prints:1.000

'2.000

'4.000

'8.000

'16.000

'done


IF Statement (Group IF)

PURPOSE:To execute a set of macro statements under certain conditions.

SYNTAX:IF logexpression THEN

statements

.

.

{ ELSE

statements

.

. }

END IF

EXPLANATION:"Logexpression" is a logical expression that can be answered True or False. If the expression is true, then the first set of statements (between IF and ELSE) is executed, otherwise the statements between ELSE and END IF are executed. The ELSE section is optional, but the END IF is required.

The logical expression consists of one or more relational expressions separated by AND or OR. A logical expression can also be preceded by NOT.

A relational expression consists of two numeric or string expressions separated by one of the following relational operators: <, <=, =, >=, >, <>.

With the Group IF statement, the IF statement line must end with the word "THEN" (except for comments). In contrast, the single-statement IF must have the conditionally executed statement following the word "THEN" on the same line.

COMPATIBILITY:All versions

EXAMPLES:

If Eof(1) <> 0 Then

Print "end-of-file was encountered."

End' stop the macro

End If

If j > 90 Then

Print "j is too large: ", j

Else

x = sin(j) * l

y = y + 1

End If


Cone

>Cone

{

<Nface m

number of sides for the cone [3-100]

<Orientation o

[0 = point 2 is a vertex, 1 = point 2 is the midpoint of a side]

<Points: 1 = center of base, 2 = radius of base, 3 = height

}

Draws a cone.

Compatibility: All versions

Example: Draw two cones, the first one fitting inside a circle of radius 10, the next one just enclosing a circle of the same radius.

>Circle

{

<Color 0, 255, 0

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 0, 10

}

sides = 6

>Cone

{

<Color 255, 0, 0

' orientation 0 makes the base fit inside a

' given radius

<Orientation 0

<Nface [sides]

<Pointxyz 0, 0, 0

<Pointpolar 10, 0, 2

<Pointrel 0, 10, 0

}

>Cone

{

<Color 0, 0, 255

' orientation 1 makes the base enclose a

' given radius

<Orientation 1

<Pointxyz 0, 0, 0

<Pointpolar 10, [180/sides], 2

<Pointrel 0, 10, 0

}


Balloon

>Balloon

{

<Font font$

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Text content$

text to place in the balloon

<Size 2.0000

balloon radius

<Arrowhead i

arrowhead style [1-12]; if not set, uses Sys(652)

<Arrowsize as

size of arrowhead. In V. 15 and earlier, this value is relative to current default text size (Sys(12)). In V. 16 and higher, it represents the actual size in units.

<Points: 1 = arrowhead, 2-n = body, last = center of balloon

}

Draws a text balloon with an arrow leader.

Compatibility: All versions

Example:

t$ = "12A"

>Balloon

{

<Color 0, 255, 0

<Layer 2

<Font "Arial"

<Text [t$]

<Size 3

<Arrowhead 3

<Arrowsize 1.0

<Pointxyz 20, 10, 0

<Pointxyz 10, 20, 0

<Pointxyz 20, 30, 0

}


Ent_LineWidth Parameter

ENT_LINEWIDTH ParameterQuery and Change Parameters

ENT_LINEWIDTH

Declaration: Alias ENT_LINEWIDTH &H0108

Argumentes: One number (floating-point) representing the line width

Accessibility: Query/Change

Purpose: This parameter allows you to determine or change the entity's line width. Unlike Sys(98), the Query result is in real-world units (i.e. the same value you would see in the Info Box).

Query Usage:

Query Ent_LineWidth, elwidth

where elwidth is a numeric variable

Change Usage:

Change Ent_LineWidth, elwidth

where elwidth is a numeric variable or expression

Compatibility: Version 14 and higher

Example:

Include "dcadalias.d3i" ' this should be placed at the very top of the macro

Entity 1 ' load the first entity's data

Query Ent_LineWidth, elinewidth ' find out the entity's linetype scale

If elinewidth <> 0.25 Then

Change Ent_LineWidth, 0.25

End If

Update 'ALWAYS Update the entity when done with Change

End


HelpIndex

>HelpIndex

{

}

This command opens the Help index.

Compatibility: All versions


SY_AttDefValue Parameter

SY_ATTDEFVALUE ParameterQuery and Change Parameters

SY_ATTDEFVALUE

Declaration: Alias SY_ATTDEFVALUE &H0E0A

Arguments: An integer for the index of the desired Attribute Definition in this block, and a string to hold the Value string of the indexed Attribute Definition.

Accessibility: Query/Change

Purpose: This parameter allows the programmer to extract the Value text contents from a specific Attribute Definition in a block.

Query Usage:

Query SY_AttDefValue, adindex, advalue$

where adindex is a numeric variable and advalue$ is a string variable

Change Usage:

Change SY_AttDefValue, adindex, advalue$

where adindex is a numeric variable or expression and advalue$ is a string variable or expression

Compatibility: Version 14 and higher


T_Justification Parameter

T_JUSTIFICATION ParameterQuery and Change Parameters

T_JUSTIFICATION

Declaration: Alias T_JUSTIFICATION &H0503

Arguments: One number (integer [0, 1, 2]) representing the text justification

Values: 0 = left justification, 1 = center justification, 2 = right justification.

Accessibility: Query/Change

Purpose: This parameter allows you to determine and change the justification of a text entity. When changing the justification, the text shifts position around the insertion point, which does not move.

Query Usage:

Query T_Justification, tjust

where tjust is a numeric variable

Change Usage:

Change T_Justification, tjust

where tjust can be a numeric variable or expression

Compatibility: Version 14 and higher


DimChamfer

>DimChamfer

{

<Orientation o

text orientation [0 = aligned with arrows, 1 = perpendicular, 2 = horizontal, 3 = vertical]

<Precision p

number of digits past the decimal in the dimension text

<Format f

text format [0 = 4.125, 1 = 4-1/8, 2 = 4'1.5", 3 = 4'1-1/2"]

<Location l

text location relative to arrows [0 = inside, 1 = outside]

<ToleranceType tt

[0 = none, 1 = single value, 2 = high/low values]

<ToleranceSize ts

relative size of tolerance text

<ToleranceLow tl

low tolerance value for tolerance type 2

<ToleranceHigh th

high tolerance value for tolerance type 2

<Tolerance tv

tolerance value for tolerance type 1

<Suffix i$

dimension suffix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Prefix j$

dimension prefix ["0" = none, "1" = custom1, "2" = custom2, etc.]

<Font "fontname"

the full name of the Windows font, e.g.: "Times New Roman"

<VectorFont vfont$

the name of the desired vector font, ex. "Simplex_Win"

<FontType ft

the font type [0=TrueType, 1 = Vector]

<Size s

dimension text size

<Type t

[0 = dimension, 1 = exploded dimension]

<Gap g

distance between measured points and leader bottoms

<Length l

length of fixed-length leader lines

<Fix fx

[0 = variable-length leader lines; 1 = for fixed-length]

<OverShoot os

distance between arrow tips and leader tops

<Arrowhead a

arrowhead style; see Arrow command for details

<Arrowsize as

arrowhead size. In Version 15 and earlier, theis is relative to the dimension text size; in V16 and later, it is the actual arrowhead length in units.

<LinePosition lp

[0 = arrows inside leaders, 1 = arrows outside leaders]

<Axis y

[1 = horizontal, 2 = vertical]

<Text fixed$

If present, sets the fixed dimension text

*New parameters added in Version 15

<Multiplier m [-1 (and any value <= 0) = off, any positive value turns it on]

<PrefixText p$

<SuffixText s$

<Points: 1 = chamfer line, 2, 3... = body of dimension

}

Notes:

- <Prefix and <PrefixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <PrefixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

- <Suffix and <SuffixText are mutually exclusive. If both parameters are used in the same command, the one used last will overrule the previous one.

- Once the <SuffixText is used in the command section, it will overrule the drop-down list selection by the user. (However, it will NOT update the text in the list selection)

Compatibility: All versions. Multiplier, PrefixText, and SuffixText parameters only exist in Version 15 and higher.

Example:

>Line

{

<Pointxyz 0, 0 ,0

<Pointxyz 25, 0, 0

<Pointxyz 25, 25, 0

}

>Chamfer

{

<Depth 5

<Pointxyz 0, 0, 0

<Pointxyz 25, 25, 0

}

>DimChamfer

{

<Arrowhead 1

<Arrowsize 1

<Tolerancetype 0

<Size 1

<Pointxyz 22.5, 2.5, 0

<Pointxyz 25, 0, 0

}


CLS Statement

PURPOSE:Clear a text window.

SYNTAX:CLS

EXPLANATION:The CLS statement clears all the text inside the text window. If a text window is not open, this statement has no effect. See the WINDOW statement for more information on text windows.

If you have set the text background color using the COLOR statement, then CLS also set the background color of the entire window to match the current text background color.

COMPATIBILITY:All versions

EXAMPLE:

Window 5, 30 ' open a window 5 lines x 30 chars

Print "press any key to continue..."

Anykey ' wait for key press

Cls ' clear the text window


Macro Limitations

Maximum Program Size: Depends on available memory - up to 30,000 lines. Blank lines and lines containing only comments do not count.

Maximum Array Size: Depends on available memory - up to 200,000 elements (total of all arrays).

Maximum Number of Array Dimensions: 1

Maximum Number of Symbols: 200,000. Symbols include Labels and Variables. Each element of an array counts as one symbol.

Maximum String Size: 255 characters.

Maximum Nesting for Group IF: 30.

Maximum Nesting for FOR-NEXT: 30.

Maximum Nesting for DO-LOOP: 30.

Maximum Nesting for GOSUB: 30.

Maximum Number of Strings: Depends on available memory - up to 30,000 strings.


STOP Statement

PURPOSE:To terminate the macro and return to DesignCAD.

SYNTAX:STOP

EXPLANATION:The STOP statement can be placed anywhere in the macro. When the macro executes the STOP statement, the macro terminates.

A STOP or END statement at the end of the macro is usually optional -- your macro will stop running after it executes the last line of the macro file. However, it is not optional if you have subroutines following the main body of the macro (either directly or through an INCLUDE statement at the end of the file). In such a case, you must provide a STOP or END statement at the end of the main routine, or the subroutines will be run after the main body of your macro should have ended.

The STOP statement behaves exactly the same as the END statement; either one will end your macro.

COMPATIBILITY:All versions

EXAMPLE:

If i > max Then Stop


T_Font Parameter

T_FONT ParameterQuery and Change Parameters

T_FONT

Declaration: Alias T_FONT &H0508

Arguments: A string representing the name of the font in use.

Accessibility: Query/Change

Purpose: This parameter allows you to query or change the font used to display the text.

Query Usage:

Query T_Font, tfont$

where tfont$ is a string variable

Change Usage:

Change T_Font, tfont$

where tfont$ can be a string variable or expression.

Compatibility: Version 14 and higher


SolidIntersect

>SolidIntersect

{

<Incomplete

If this parameter is included, the command will wait for the user to either (a) set enough points to complete the command or (b) end the command by pressing "Enter."

<Points: 1, 2 = solids to be intersected

}

Explodes a solid entity into grids and planes.

Compatibility: All versions

Example:

>Cone

{

<Pointxyz 0, 0, 0

<Pointxyz 5, 0, 0

<Pointxyz 5, 20, 0

}

>Sphere

{

<Pointxyz 0, 20, 0

<pointxyz 0, 25, 0

}

>SolidInt

{

<Pointxyz 5, 0, 0

<pointxyz 0, 25, 0

}


Tube

>Tube

{

<Orientation o

[0 = vertex, 1 = midpoint]

<NFace n

<Points: 1=center, 2=radius1, 3=height(and direction), 4=radius2

}

Draws a cylindrical shell.

Compatibility: All versions

Example:

>Tube

{

<NFace 36

<Orientation 1

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 30, 0

<Pointxyz 11, 30, 0

}


RoundCylinder

>RoundCylinder

{

<NFace n1, n2, n3

n1 = number of facets around the cylinder body
n2 = number of facets for the first end's fillet
n3 = number of facets for the second end's fillet

<Radius r1, r2

r1 = radius of first end fillet
r2 = radius of second end fillet

<Orientation o [0 = point2 on vertex, 1 = point 2 on middle of edge] (currently not implemented)

<Points: 1=center, 2=radius, 3=height

}

Draws a cylinder with rounded ends.

Compatibility: Version 15 and later

Example:

>RoundCylinder

{

<NFace 20, 8, 8

<Radius 0.5, 1

<Pointxyz 0, 0, 0

<Pointxyz 6, 0, 0

<Pointxyz 6, 16, 0

}


RestoreDCADTile

>RestoreDCADTile

{

}

Restores the default DesignCAD Tile settings.

Compatibility: All versions


PerpendicularPlane

>PerpendicularPlane

{

<Width w

length of a side of the perpendicular plane

<Points: 1 = line, 2 = intersection of plane and line

}

This command draws a rectangular plane of specified width perpendicular to a given line and point.

Compatibility: All versions

Example:

>Circle

{

<Pointxyz 0, 0, 0

<Pointxyz 10, 0, 0

<Pointxyz 10, 0, 10

}

>PerpendicularPlane

{

<Width 1

<Pointxyz 10, 0, 0

<Pointxyz 10, 0, 0

}

>PerpendicularPlane

{

<Pointpolar 10, 45, 2

<Pointrel 0, 0, 0

}

>PerpendicularPlane

{

<Pointpolar 10, 135, 2

<Pointrel 0, 0, 0

}


T_Bold Parameter

T_BOLD ParameterQuery and Change Parameters

T_BOLD

Declaration: Alias T_BOLD &H0504

Arguments: One number (integer [0, 1]) representing whether the text is bold or normal.

Values: 0=normal, 1=bold

Accessibility: Query/Change

Purpose: This parameter allows you to determine if a text entity is bold or not. (Bold only applies to TrueType fonts, not Vector fonts)

Query Usage:

Query T_Bold, tbold

where tbold is a numeric variable.

Change Usage:

Change T_Bold, tbold

where tbold can be a numeric variable or expression.

Compatibility: Version 14 and higher


PRINT Statement

PURPOSE:To output data to the screen.

SYNTAX:PRINT {list of expressions}

EXPLANATION:The PRINT statement is used to output numeric and/or string expressions to the DesignCAD screen. It is identical to the PRINT # statement, except the data is output to the screen rather than to disk.

The PRINT statement output is normally displayed in the DesignCAD Status Bar; thus, only one line of output can be displayed at a time, unless a text window is open. If more than one line is to be output to the Status Bar, the PRINT statements can be separated by ANYKEY statements. This requires the user to press a key before the next line is displayed.

If a text window is open (see the WINDOW statement), the PRINT statement will be displayed in the window. The LOCATE and TAB statements can be used to position the output for the window.

The PRINT statement can be terminated with a semicolon (";") to leave the cursor at the end of the line of a text window. The next PRINT statement will begin at that location.

The MESSAGE statement is similar to the PRINT statement, but the MESSAGE statement opens a dialog box for the message. The user must press the OK button to continue after the message is displayed.

See Also: WINDOW, PRECISION

COMPATIBILITY:All versions

EXAMPLES:

Print j, " is the current value."

Print "x: ", x, " Press any key to continue"

Anykey

Print "y: ", y

Window 5, 20

Print "abcd";

Print "efgh"' "abcdefgh" will be printed


ViewSave

>ViewSave

{

<Filename "filename.dcv"

}

Saves a screen configuration file.

Compatibility: All versions


PaperSpaceMode

>PaperSpaceMode

{

<Filename "filename.tps"

}

Toggles DesignCAD into or out of Paper Space Mode. The Filename parameter optional, but if given opens paperspace mode and loads the given template file without showing a dialog box.

Compatibility: All versions


MoveDown

>MoveDown

{

}

Rotates the camera below the object.

Compatibility: All versions


PARSE Statement

PURPOSE:To extract values from a specially-formatted string and store them in variables.

SYNTAX:PARSE in$, fmt$, var1 [, var2, var3, …]

EXPLANATION:The PARSE statement allows the user to read data from specially-formatted strings into variables. This can be especially useful for retrieving values from a command line.
in$ is the string to be parsed. It can be a string variable or an expression. fmt$ is a string specifying the number, types, and ordering of the variables to be extracted from the input string.
var1, var2, etc. are the names of the variables to be initialized from the input string.

By default, all values are assumed to be space-delimited, but the format-specifier can explicitly define the delimiters for a specific variable. A delimiter is required any time a string variable to be read contains, or might contain, spaces or other punctuation. Without such a delimiter, the %s format specifier stops reading after the first empty space it encounters. Almost any character can be used for a string delimiter – the choice of the best character will depend on the situation.

The Parse statement is not intended to parse English grammar, but rather to parse formatted data, where there is a clear distinction between the data and its delimiters.

Format Specifiers:
%s – string
%x – a hexadecimal value
%o – an octal value
%u – and unsigned decimal value
%d – a signed decimal valuel\
%f – a floating-point value
%n, %e, %g – alternates for %f

Sample format string:

fmt1$ = "%n %d ^%s^"

This string implies two numbers, each separated by spaces, followed by a string enclosed in carets. The following input string would match the format string correctly:

str1$ = "12 37 ^This is a delimited string^"

whereas this string would not:

str2$ = "12, 27, ^This is a delimited string^"

The commas in the second string prevent it from matching the format string, and attempting to parse it with str1$ would result in a syntax error. However a slightly changed format string will correctly parse str2$:

fmt2$ = "%n, %d, ^%s^"

See Also: FORMAT

COMPATIBILITY:Version 14 and later

EXAMPLES:

Parse "24.5 12 37 <a delimited string>", "%f %d %n <%s>", x, y, z, a$

form$ = "x: %.2f" + Chr$(13) + "y: %4d" + Chr$(13) + "z: %f" + _
Chr$(13) + "a$: %s"
Format out$, form$, x, y, z, a$

Message out$

'Problem Example:

form$ = "%s (%s) %s"

s$ = "String with(delimited data)in parentheses"

Parse s$, form$, front$, data$, back$

Message "front$: ", front$ 'just displays "String "

Message "data$: ", data$ ' displays "delimited data" as expected

Message "back$: ", back$ ' just displays "in"

end

'The first and third string above only caught one word apiece because they encountered whitespace with no other delimiters.

'Another Problem Example:

form$ = "%s(%s)%s"

s$ = "String with(delimited data)in parentheses"

Parse s$, form$, front$, data$, back$

Message "front$: ", front$ 'now displays "String with" as expected

Message "data$: ", data$ ' displays "delimited data" as expected

Message "back$: ", back$ ' just displays "in"

end

'The third string above only caught the first word of "in parentheses" because it encountered a space, and no other delimiter was specified.

'Corrected Example:

form$ = "%s(%s)%s." ' Note the final period in the format string.

s$ = "String with(delimited data)in parentheses."

Parse s$, form$, front$, data$, back$

Message "front$: ", front$ 'displays "String with" as expected

Message "data$: ", data$ ' displays "delimited data" as expected

Message "back$: ", back$ ' now displays "in parentheses"

end

'This time third string caught both words of "in parentheses" because it had a delimeter (the period) to mark the end of the string.