Chapter 2 -- Constants
This chapter describes the constants that are built into DCAL. They are pre-declared and can be used by your programs.
NOTE: The values of these constants may change in future releases of DCAL and DataCAD; therefore, your programs should never depend on the actual value that these constants represent.
These operation constants are used and returned by file handling procedures:
This error is returned when an attempt is made to access a file which cannot be accessed, such as attempting to write to a read only file.
If this error occurs, please notify Technical Support.
If this error occurs, please notify Technical Support.
An attempt was made to access a file using an improper file variable. Usually, this indicates an uninitialized file variable.
An attempt was made to open too many files at once. Some operating systems restrict the number of files that can be opened at one time. For MS-DOS, you can set this number in the config.sys file with the files= statement.
An attempt was made to open a file that could not be found.
The file routines return this constant when they are successful.
A pathname was specified which does not exist.
This constant specifies that a file is open for reading only.
This constant specifies a file that is open for both reading and writing.
This constant specifies a file that is open for writing only.
DataCAD defines a number of built-in pathnames, which you can access with the routines getpath and setpath. These routines take an integer constant which has one of the following values:
The path where DataCAD looks when loading a character set. Changing this has no affect on any previously-loaded character sets.
This is the path from which DataCAD loads default files, such as the default angles, scales, and distances.
This path indicates where driver files are loaded from. This path is not used once DataCAD is running.
The path where DataCAD looks for drawing files.
This is the index of the path where DataCAD reads and writes dxf files.
reports;This is the path where DataCAD looks for form files when executing the reports command.
pathlyr is the index of the path where DataCAD loads and stores layer files.
pathmcr is the index of the path where DataCAD looks when loading a new macro for execution. Changing this has no affect on an executing macro.
This determines where DataCAD sends text output files, such as output from the report command.
pathsup is the index of the path where DataCAD looks for support files, such as message and label files. Do not change this pathname while DataCAD is running.
pathswp is the path where DataCAD keeps virtual memory swap files. This may be changed while DataCAD is running without disturbing existing virtual address spaces.
pathsym is the index of the pathname where DataCAD adds new symbol files. This is used when new symbol files are created. Once a symbol file exists in a template, the filename is stored in the template file.
This is the index of the path where temporary files are kept. It should be used for any temporary file that the macro needs.
The path where DataCAD looks for template files. This pathname may be changed while a template file is displayed on the screen. This does not affect any already-opened files.
The following constants are used to create, examine, and modify attributes.
The value of this attribute is a logical address (lgl_addr). These are the addresses of layers, entities, attributes, symbols, etc.
The value of the attribute is a real number interpreted as an angle.
The value of the attribute is a real number interpreted as a distance.
An attribute that is an integer.
The maximum length of the name of an attribute, 12 bytes.
The value of an attribute of this type is a point.
The value of the attribute is a real number.
An attribute whose value is a string of up to 80 characters.
These constants refer to the standard colors used by DataCAD.
Because the value of these constants may change between versions of DataCAD, use the constant names.
clrdkgray Dark gray
clrltblue Light blue
clrltcyan Light cyan
clrltgray Light gray
clrltgrn Light green
clrltmgta Light magenta
clrltred Light red
The constants in this section refer to DataCAD's built-in line types.
ltype_dashed is the dashed line type.
ltype_dotdash is the dot-dash line type. The user-defined line types are identified by integer values starting at 4.
ltype_dotted is the dotted line type.
ltype_solid refers to the line type solid.
These constants are used in some of the database routines to refer to the different types of entities that DataCAD supports:
entar3 is used for a 3D arc (an arc not in the x-y plane).
entarc indicates that the entity is a two- dimensional arc.
entbez refers to a Bezier curve entity.
entblk represents a block. A block is similar to a slab, but has only four sides.
entbsp indicates an entity type of a b-spline.
entcnt represents a three-dimensional contour curve.
entcon refers to a cone. See also enttrn.
entcrc indicates a circle entity.
entcyl refers to a cylinder.
entdim refers to the associative dimension.
entdom indicates a dome. A dome is any section of a sphere.
entell indicates an ellipse.
entlin refers to a line, the most common entity.
entln3 refers to a three-dimensional line. This entity is a free vector in 3D space.
entmrk is the point (marker) entity type.
entpln is the entity constant for a polyline.
entply represents a polygon. A polygon is a flat, closed, three-dimensional entity.
entrev indicates a surface of revolution. Like polylines, this involves the copious data of polyverts.
entslb represents a slab. A slab is similar to a polygon, but has some specified thickness.
entsrf refers to the three-dimensional mesh surface.
entsym refers to the insertion (an instance) of a symbol. Note that this is an instance of a symbol and does not describe its geometry.
enttor indicates the entity type torus, a doughnut shape.
enttrn represents a truncated cone.
enttxt refers to text strings.
The constants in this section describe the mode that DataCAD uses to search for entities across layers. They are used with a mode_type variable.
Using this mode, all layers in the drawing are searched whether they are on or off.
Using lyr_curr, only the current layer is searched.
Using lyr_on, all layers in the drawing that are turned on are searched.
These constants are used when drawing entities on the screen. They are used by some of the routines which manipulate the screen.
When an entity is drawn with mode drmode_black, it is erased from the screen. This makes an entity vanish from the screen, but not from the database.
With drmode_flip, the entity being drawn is XORed with what is currently on the screen. Notice that two consecutive XORs result in the restoration of the original image. By using drmode_flip twice in a row, you can make an entity blink.
Using drmode_white causes an entity to be drawn on the screen in whatever its color is. This is the opposite operation from drmode_black.
The constants in this section are returned by the routines that detect function key presses, such as getchar, getpoint, and dgetint. Also, see the function FnKeyConv.
f1, f2, f3, f4, f5, f6, f7,f8, f9, f0
These constants are returned when any of the unshifted function keys are pressed. When function key (F10) is pressed, f0 is returned.
s1, s2, s3, s4, s5, s6, s7,s8, s9, s0
These constants are returned when the shifted function keys are pressed. When (S10) is pressed, s0 is the constant returned.
The constants in this section are used for hatching.
See the "Processing Routines" chapter for more information.
Indicates to procedure hatch_mode that all entities interior to the hatching boundary are ignored. In this case, each scan line creates one section of segments, at most.
Indicates that hatching should start and stop the hatching scan line as it crosses the edge of each entity in its path.
Indicates that no matter how many sections the scan line may be broken into, only the first and last section lying within the outer boundary will be drawn.
Represents the maximum number of portions of dashes in a given scan line pattern. maxdash applies to portions of a broken scan line where the line is drawn and where the line is not drawn (the spaces). maxDash is equal to 6.
Snap constants are used by the built-in variable osnap_mode, which controls the object snap mode. These constants can be added together.
For example, to set center, end point, and quick mode, use:
osnap_mode := osnap_center +
osnap_endpoint + osnap_quick;
This constant sets object snap to recognize the center of arcs and circles.
osnap_endpoint sets object snap to snap to the end points of the nearest line, point, Bezier curve, b-spline, arc, or associative dimension.
Object snapping recognizes the intersections of lines, circles, and arcs. Although powerful, this may significantly slow down snapping operations.
When osnap_midpoint is on, snapping recognizes the mid point of the nearest line, arc, or associative dimension.
When osnap_nearest is set, snapping recognizes the nearest point on the nearest line, point, Bezier curve, b-spline, circle, or arc. Bezier curves and b-splines use their control points.
osnap_npoint divides the nearest line or arc into osnap_num divisions, and snaps to one of these points.
When object snap uses osnap_perp, points which are perpendicular to the nearest line, arc, or circle, and which pass through the last point entered are recognized.
Object snapping snaps to the quadrant points of arcs and circles. Quadrant points are the points at 0, 90, 180, and 270 degrees. When an arc does not pass through one or more of these points, the points are not used.
When osnap_quick is used and osnap_intsect is not, the search for the nearest entity is abandoned after an entity within the current miss distance is found.
When object snap uses osnap_tan, if the point entered is within the miss distance of an arc or circle, a possible snapping point is considered at the point of tangency of a line passing through the last point entered and tangent to the arc or circle.
The following constants are used in the polyline routines:
pv_bulge represents a polyvert which is an arc segment between a polyvert and the next polyvert in the chain.
pv_vert represents a polyvert which is a straight line between a polyvert and the next polyvert in a chain.
The following constants are used with the view management and calculation routines as well as with the function getpointp:
Represents an oblique projection calculated using the elevation oblique technique.
See view_calcoblq for more information.
Represents an oblique projection calculated using the plan oblique technique.
See view_calcoblq for more information.
Instructs DataCAD that any viewing projection is valid for a given function.
See view_checkmode, getpointp for more information.
Represents a viewing projection that the user can edit, including orthographic and parallel views. In general, data may be entered into a drawing in either an orthographic or a parallel projection where object snapping and all selection functions work properly.
See getpointp for more information.
Represents oblique viewing projections.
Represents orthographic viewing projections.
Represents parallel viewing projections.
Represents perspective viewing projections.
These constants are used by some of the built- in variables to determine certain wall conditions:
The variable wallend is set to the constant wall_cap when the end condition of walls is to cap them.
wallend is set to wall_clip when the end condition for walls is to clip an intersecting wall, forming a T-intersection.
wallend is set to wall_none when the end condition for a wall is to do nothing.
The built-in variable wallson is set to wall_off when walls are not being drawn, in which case DataCAD draws simple lines.
wallson is set to wall_on if DataCAD is drawing walls.
This constant is equal to 1.OE-12. Useful for near zero tests.
halfpi is defined as pi / 2.0.
maxpnts is the maximum number of points in a polygon, slab, or contour. 36 is the maximum number of points.
pi is defined as 3.141592654. This value is useful in many mathematical computations, since angles are stored and manipulated in DataCAD in radians.
res_escape is the counterpart to res_normal. It indicates that an entry was not completed correctly, but that a key (such as a function key) was pressed during input. See "getpoint" for more information.
res_normal is returned by several of the input routines to indicate a valid entry.
This is equal to ABSZero * ABSZero.
twopi is defined as 2.0 * pi.
The constant x is used whenever the x coordinate of a point is needed, or the x axis is specified, such as in a rotation.
The constant y is the counterpart of x, and indicates the y coordinate or y axis.
The constant z is similar to x and y, and indicates the z coordinate or z axis.