The structure of

object types, characteristics and drawing parameters

definition files

 (as applied to ODCLASS application or etc.)

 

 

Contents

 

Contents.................................................................................................................................. 1

1.     General information........................................................................................................ 2

2.     Local variables................................................................................................................. 3

3.     Autoconst – data fields input and edit option............................................................. 4

4.     AutoCAD variables.......................................................................................................... 4

5.     Drawing resource files.................................................................................................... 5

6.      Classificational object grouping.................................................................................... 6

7.     Objects description......................................................................................................... 7

7.1.      Object description start line......................................................................................... 7

7.2.      Line describing the types of graphical primitives of the object.................................... 8

7.3.      Lines describing graphical properties of the created object........................................ 8

7.4.      Lines describing AutoCAD drawing parameters variables........................................ 11

7.5.      Xrecord or Object data table description start line.................................................... 11

7.6.      Lines describing the data fields of the object data table............................................ 12

 


 

1.    General information

 

Drawing parameters, object types and its characteristics definition files as applied to ODCLASS application or etc. AutoCAD ® software or etc. – text files, made of:

- the description of the definition file local variables and options,

- the description of the specific AutoCAD ® variables,

- the description of the access to the drawing resources files,

- the description of object classes, types, characteristics, possible values, input parameters.

Object types and characteristics definition files allow for definition of drawing standards of the drawing area or a specific project, formalization of the requirement to the created DWG files, drawing objects classification and structure - the collection of all graphical object types of the specific drawing subject. Furthermore, object type definitions consist of the description of all the necessary object characteristics as well as its possible values.

 

Revision 4.

Sharov Alexander & NULL ©   Russia, Moscow    odxclass.odxedit.ac@gmail.com

 

You may not publish, sell, create derivative works or use this object descriptions structure outside of ODCLASS in any way without the prior written permission of Alexander Sharov.

 

 

 

The general separator of different data types in the definition files is a tab or a space symbol, “   ”, “ ”. The number of tabs and / or spaces between the data is not limited, but not less than one.

The general separator of data lists of similar type is a comma, “,”. There is only one comma between two data of the same type. After the comma, space characters are allowed, “ ” - if this facilitates onscreen data perception. Space characters after the first significant character are perceived as a part of the value.

Decimal separator of numeric values ​​is the dot sign, ".".

Numeric values ​​describing ranges are separated by a colon, “:”.

If text values ​​contain commas or colons, then a backslash character must be put before each such sign, "\". Ie: "\," or "\:".

The description of each definition file unit and its value ​​takes one line. Two lines are used only for the description of object classification groups.

The hash sign, "#", means commenting everything on the line after this sign.

Each meaningful line consists of a keyword denoting the definition subject, a notation, the name of the given data and its values. In addition, the values ​​of other parameters of the data can be placed in the same line.

The case of keyword characters does not matter.

UTF-8 BOM encoding is used.

 

 

 

 

 

 

 

2.    Local variables

 

Local variables are optional.

Internal variables are defined each with the following one-line structure:

Define[tab]<variable>[tab]<value>.

 

Example:

Define          DrawingStandard_name  DrawingStandard_Architecture

, where:

- «Define» - the keyword for lines describing local variables,

- «DrawingStandard_name» – example of variable name being described,

- «DrawingStandard_Architecture» – example of the described variable DrawingStandard_name value.

 

The following standard variables are provided:

- DrawingStandard_name – code, drawing standard name,

- computer_name – computer ID,

- user_name – user ID,

- file_name – path and file name,

- day/month/year/hour/minute/second – date local variables.

Standard variables are distinguished by the fact their values ​​are determined automatically by ODCLASS application or etc., and programmatically substituted or entered into the appropriate data fields.

Any other desired variables can be described.

Variables can be nested, i.e. variables can be used in the description of other variables.

Variable substitution is implemented with: $ (<variable>).

Example:

od_fld[tab]computer_name[tab]desc[tab]Character[tab]$(computer_name)[tab]$(computer_name)

, where:

-        «od_fld» - keyword describing data field,

-        «computer_name» - data field name,

-        «desc» - data field description,

-        «Character» - data field type,

-        «$(computer_name)» - default value,

-        «$(computer_name - allowed values list of one option.

In this example, the “computer_name” field will be set by ODCLASS or etc. with the value corresponding to the computer ID.

 

 

 

 

 

 

 

 

 

 

 

 

 

3.    Autoconst – data fields input and edit option

 

Autoconst parameter is optional.

Autoconst parameter is defined with the following one-line structure:

Autoconst[tab]<value>.

Valid values ​​are 0 or 1, where:

- 0 -​​ input and edit of characteristic values in the fields with a single valid value are allowed. In the ODCLASS_PROPERTIES window, the background of the description line is white,

- 1 - input and edit of characteristic values in the fields with a single valid value are forbidden. In the ODCLASS_PROPERTIES window, the background of the description line is grey,

Autoconst allows you to control the ability to input and edit characteristic values ​​for all the fields at once with a single valid value in all the tables.

 

 

4.    AutoCAD variables

 

AutoCAD variables definition is optional.

AutoCAD variables are defined each with the following one-line structure:

Variable [tab] <variable> [tab] < value>.

 

For example:

Variable MEASUREMENT 1

, where:

- “Variable” - keyword for lines describing AutoCAD variables,

- “MEASUREMENT” - example of the variable being described,

- “1” - example of the MEASURED variable described value.

Or:

Variable LIMMIN 0,0

, where:

- “Variable” - keyword for lines describing AutoCAD variables,

- "LIMMIN" - example of the variable being described,

- "0,0" - example of the values ​​described by the variable LIMMIN.

 

For any number of AutoCAD variables its values ​​can be set using Variable.

AutoCAD variable values ​​are set according to their AutoCAD requirements. The fact angular dimensions must be specified in radians instead of degrees should be taken into account.

 

 

 

 

 

 

 

 

 

 

 

 

 

5.    Drawing resource files

 

Drawing resources files definition is optional.

Drawing resources files are defined each with the following one-line structure:

<resource>[tab]<file name and path> or

<resource>[tab]<file mask and path>.

"Resource" has the following values:

- Linetype – for the description of linetypes files *.dwg, *.dwt, *.lin, *.shx,

- BlockReference - for the description of block references files *.dwg, *.dwt,

- BlockReferenceFile - for the description of block collection files *.dwg, *.dwt,

- Dimension - for the description of dimension styles files *.dwg, *.dwt,

- Font - for the description of AutoCAD fonts files *.shx,

- Layer - for the description of AutoCAD layers files *.dwg, *.dwt

- Layout - for the description of layout templates files *.dwg, *.dwt,

- MLeader - for the description of multileader styles files *.dwg, *.dwt,              

- MLine - for the description of multiline styles files *.dwg, *.dwt,

- Pattern - for the description of hatch patterns files *.pat,

- Textstyle - for the description of text styles files *.dwg, *.dwt.

All paths are relative.

 

Example:

Linetype      C:\Users\User1\my_linetype.lin

, where:

- «Linetype» - keyword for lines describing linetypes access,

- «C:\Users\User1\my_linetype.lin» - example with full path to the linetypes *.lin file.

Or:

BlockReferenceFile         \Blocks\elev*.dwg

, where:

- «BlockReferenceFile» - keyword for lines describing block references  *.dwg file,

- «\Blocks\elev*.dwg» - example with relative path to the block references file with «elev*.dwg» mask, i.e. all *.dwg files beginning with «elev».

 

Using lines describing resource files, access to any of the foregoing types of drawing resources for any number of resource files can be defined.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.     Classificational object grouping

 

Classificational object groupings are optional.

Classificational object groupings are defined each in two lines with the following structure:

class description start line

Ñlass [tab] <name> [tab] <display attribute> [tab] {icon file}

class description end line

/class

Icons can be in BMP or PNG format.

 

Example:

Ñlass Buildings 1 C:\Users\User1\BMP\1.bmp

...

/class

, where:

- “Ñlass” - keyword for object class description start lines,

- “Buildings” - class name example,

- “1” - whether class is displayed in object menu or not,

- “C:\Users\User\BMP\1.bmp” - example of the full path to the object icon,

- “/Ñlass” - keyword for object class description end lines.

 

Or:

Ñlass Hydro 1        C:\Hydrography\Images\50.png

Ñlass River 1         \Images\51.png

...

/class

Ñlass Creek 0        \Images\52.png

...

/class

Ñlass Lake 1          \Images\57.png

...

/class

...

/class

where:

- “Ñlass” - keyword for object class description start lines,

- “Hydro” - an example of senior class name, parent for “River”, “Creek”, “Lake” classes

- “River”, “Creek”, “Lake” - examples of the subclass names,

- “1”, “0” - whether class is displayed in object menu or not,

- "C:\Hydrography\Images\50.png", "\Images\51.png", "\Images\52.png", "\Images\57.png" are examples of relative and full paths to icon files for object menu.

- “/Ñlass” - keyword for object class description end lines.

Class display attribute in the object menu can take the values ​​“0” - do not display, and “1” - display. Not displaying a class in the object menu leads to non-displaying of all subclasses of the given class and all objects belonging to this class in the object menu.

Description of the icon files is not mandatory.

 

 

 

Using Ñlass ... and /class lines, one can describe any number of classes, any depth (nesting) of the classification.

The belonging of an object to a class is determined by its position in the object definition file between the corresponding pair of lines Class ... and /class.

 

 

7.    Definition of objects

 

Definition of objects is optional.

Objects are defined with rowsets of the following structure:

1. object description start line

2. line describing the types of graphical primitives of the object,

3. lines describing graphical properties of the created object,

4. lines of AutoCAD drawing parameters variables,

5. object data table description start line

6. lines describing the data fields of the object data table.

 

7.1.        Object definition start line

 

Object definition start line is mandatory.

Object definition start line is implemented with the following structure:

obj_name[tab]<title>[tab]<display attribute>[tab]<draw order>>[tab]{icon}

 

Example:

obj_name     Parcel          1        141    C:\Images\line.png

, where:

- «obj_name» - keyword for object description start lines,

- «Parcel» - example of the described object name,

- «1» - class display attribute in the object menu,

- «141» - example of objects draw order in the drawing,

- «C:\Images\line.png» - example of the full path to the icon file for the object menu.

Object names are not a repeating set of symbols within the definition file, serve as object identifiers for programs and are displayed in the object menu for users to select for their actions.

In the object names any characters are allowed, except for tabulation - the symbol of data separation in the definition file and the hash - “#”, which means commenting everything in the line after this sign. The allowed length of the name is 1-132 characters.

Display attribute can take the values ​​“0” - do not display, and “1” - display.

Draw order is an integer ad can take values ​​from -2147483648 to 2147483647.

The description of the icon files is not mandatory.

 

 

 

 

 

 

 

 

 

 

 

7.2.        Line describing the types of graphical primitives of the object

 

Line describing the types of graphical primitives of the object is mandatory.

Graphical primitives types of the object are described in one line with the following structure:

obj_type [tab] <primitive type 1> {, <primitive type 2>, ..., <primitive type N>}

 

Example:

obj_type      BlockReference

, where:

- «obj_ type» - keyword for the description line of the types of graphical primitives,

- «BlockReference» – example of a type of AutoCAD graphical primitive.

Or:

obj_type      Polyline, 3DPolyline, Arc, Circle, Line, Mline, MPolygon, Spline

, where:

- «obj_ type» - keyword for the description line of the types of graphical primitives,

- «Polyline, 3DPolyline, Arc, Circle, Line, Mline, MPolygon, Spline» – example of the allowed types of AutoCAD graphical primitive for the specific object.

The following types of object graphical primitives can be used in the definition file: 3DFace, 3DPolyline, 3DSolid, Arc, BlockReference, Circle, Dimension, Ellipse, Hatch, Line, Mesh, MLeader, Mline, MPolygon, MText, Point, PolyFaceMesh, Polyline, Ray, Spline , Surface, Text, Wipeout, Xline.

In addition to these types of graphical primitives that correspond to the basic types of AutoCAD primitives, one can use any other types of AutoCAD primitives or any applications and AutoCAD add-ons - Custom Entities. Including for the objects displayed as Proxy. To do this, Class Name of the objects must be specified (Original Class Name).

Any combination of types of graphical primitives for one object is allowed.

The first value is used by default - to create objects, etc.

 

 

7.3.        Lines describing graphical properties of the created object

 

Lines describing graphical properties of the created object are optional.

Object graphical properties/parameters description is defined each in one line with the following structure:

obj_prop[tab]<property/parameter>[tab]<default value>[tab]{<value 2>,…<value N>}

or:

obj_prop[tab]<property/parameter>[tab]<default value>[tab]{<value MIN><:><value MAX>}

 

Example:

obj_prop      layer  0

, where:

- «obj_ prop» - keyword for object’s graphical properties/parameters description line,

- «layer» – example of AutoCAD primitive’s specific property/parameter,

- «0» – example of the value of AutoCAD primitive’s specific property/parameter – single possible value.

Or:

obj_prop      color  1        ByLayer, ByBlock

, where:

- «obj_ prop» - keyword for object’s graphical properties/parameters description line,

- «color» – example of AutoCAD primitive’s specific property/parameter,

- «1» – example of the default value of AutoCAD primitive’s property/parameter.

- «ByLayer, ByBlock» – example of the value list of AutoCAD primitive’s property/parameter.

Or:

obj_prop      elevation      50      0:1000

, where:

- «obj_ prop» - keyword for object’s graphical properties/parameters description line,

- «elevation» – example of AutoCAD primitive’s specific property/parameter,

- «50» – example of the default value of AutoCAD primitive’s property/parameter.

- «0:1000» – example of the value list of AutoCAD primitive’s property/parameter.

 

The following properties/parameters of objects can be defined:

 

Property/parameter

Format & possible values

Types of primitives

color

int, (int int int), ByBlock, ByLayer

 

explode

0, 1

 

layer

string

 

linetype

string

 

linetypeScale

real

 

lineWeight

int, ByBlock, ByLayer, Default

 

 

 

 

angle

real

BlockReference, MText, Text

blockScale

real, (real real real)

BlockReference

blockName

string

BlockReference

closed

0, 1

3DPolyline, Mline, Polyline, Spline

circleMode

Center, 2P, 3P

Circle

circleRadius

real

Circle

constantWidth

real

Polyline

dimensionMode

Aligned, Angular, Arc, Diameter, Jogged, Linear, Ordinate, Radius

Dimension

dimensionStyle

string

Dimension

elevation

real

Polyline

ellipseMode

Arc, Center

Ellipse

hatchMode

Boundary, Point

Hatch

meshMode

Box, Cone, Cylinder, Pyramid, Sphere, Wedge, Torus

Mesh

mleaderStyle

string

MLeader

mlineJustification

Bottom, Top, Zero

Mline

mlineScale

real

Mline

mlineStyle

string

Mline

mtextAttachmentPoint

BaseAlign, BaseCenter, BaseFit, BaseLeft, BaseMid, BaseRight, BottomAlign, BottomCenter, BottomFit, BottomLeft, BottomMid, BottomRight, MiddleAlign, MiddleCenter, MiddleFit, MiddleLeft, MiddleMid, MiddleRight, TopAlign, TopCenter, TopFit, TopLeft, TopMid, TopRight

MText

 

 

 

backgroundColor

int, ByBlock, ByLayer, None

Hatch

pattern

string

Hatch, MPolygon

patternAngle

real

Hatch, MPolygon

patternColor

int, ByBlock, ByLayer

MPolygon

patternScale

real

Hatch, MPolygon

rotate

0, 1

BlockReference, MText, Text

text

string

MText, Text

textHeight

real

MText, Text

textJustification

Aligned, BottomCenter, BottomLeft, BottomRight, Center, Fit, Left, Middle, MiddleCenter, MiddleLeft, MiddleRight, Right, TopCenter, TopLeft, TopRight

Text

textStyle

string

MText, Text

 

Properties/parameters color, layer, linetype, linetypeScale, lineWeight, explode can be defined for any type of AutoCAD primitive.

All other properties/parameters are defined for the specified types of AutoCAD primitives.

 

Properties/parameters description:

 

Property/parameter

Description

color

Color of the object to be inserted, possible colors of the object

explode

Possibility to explode an object after insertion (1). All resulting elements are defined as objects of the type specified.

layer

Layer of the object to be inserted, possible layers of the object

linetype

Linetype of the object to be inserted, possible linetypes of the object

linetypeScale

Scale of linetype of the object to be inserted, possible  linetypes of object

lineWeight

Lineweight of the object to be inserted, possible lineweights of the object

 

 

angle

Rotation angle of the object to be inserted, possible rotation angles of objects

blockScale

Insertion scale of a block object, possible scales of of blockreference objects

blockName

Name of the block displaying the object, names of other blocks displaying the object

closed

Possibility to close a linear object (1)

circleMode

Insertion parameter of a circle object - from the center, by two, three points

circleRadius

Insertion radius of a circle object, possible radiuses for circle objects

constantWidth

Global width of a polyline object, possible values for polyline objects

dimensionMode

Type of a dimension object, possible types for dimension objects

dimensionStyle

Style of a dimension object, possible styles for dimension objects

elevation

The height (Z) of an object insertion, possible elevations

ellipseMode

Insertion parameter for an ellipse object or an elliptical arc object

hatchMode

Hatch object creation type - with the specified boundary, with the specified point

meshMode

Mesh object type, possible mesh object types

mleaderStyle

Style of a multileader object, possible styles for multileader objects

mlineJustification

Justification type of a multiline object, possible justification types for multiline objects

mlineScale

Scale of a multiline object, possible scales for multiline objects

mlineStyle

Style of a multiline object, possible styles for multiline objects

mtextAttachmentPoint

Attachment type of a multi-text object, possible attachment types for multi-text objects

 

 

backgroundColor

Background color of a hatch object, possible background colors for hatch objects

pattern

Pattern name of a hatch object, possible pattern names for hatch objects

patternAngle

Pattern angle of a hatch object, possible pattern angles for hatch objects

patternColor

Color of a hatch object, possible colors for hatch objects

patternScale

The scale of a hatch object, possible scales for hatch objects

rotate

Possibility to rotate an object while insertion (1)

text

Textstring of a text object, possible textstrings for text objects

textHeight

Height of a text object, possible heights for text objects

textJustification

Justification type of a text object, possible justification types for text objects

textStyle

Style of a text object, possible styles for text objects

 

The default value is the value assigned to the properties when an object is inserted into a file, etc. The remaining values in the form of a list of possible values or a range are valid values for properties.

 

7.4.        Lines describing AutoCAD drawing parameters variables

 

Lines describing AutoCAD drawing parameters variables are optional.

AutoCAD object drawing parameters variables are defined similarly to the local variables – see p.2.

One AutoCAD object drawing parameters variable is defined with one line. The number of AutoCAD variables for a particular object is unlimited.

Lines describing AutoCAD object drawing parameters variables are placed after the line describing the types of graphical primitives (see p.6.2) and before the object data table description start line (see p.6.5).

 

Example:

Variable       ORTHOMODE       1

, where:

- «Variable» - keyword for lines describing AutoCAD drawing parameters variables,

- «ORTHOMODE» - AutoCAD variable example,

- «1» – ortho mode enable attribute,

Or:

Variable       POLARANG 0.78539816340       #Angle step, 45 degrees

Variable       AUTOSNAP  47

, where:

- «Variable» - keyword for lines describing AutoCAD drawing parameters variables,

- «POLARANG»,  «AUTOSNAP» – AutoCAD variable examples,

- «0.78539816340»,  «47» – angle restriction in radians for polar tracking, polar tracking mode attribute.

 

 

7.5.        Xrecord or Object data table definition start line

 

Xrecord or Object data table definition start line is optional in the object definition if no table data fields are defined further. In other words, the table for the object and its data fields is optional  for a specific object.

If the object has table data fields, then the object data table definition start line is mandatory.

Xrecord or Object data table definition start line is implemented with the following one-line structure:

od_name [tab]<title>

 

Example:

od_name     PARCEL

, where:

- «od_name» - keyword for object data table definition start line,

- «PARCEL» – example of object data table name.

 

The title of the data tables may consist of numbers and letters, and may contain the dash "-" and underscore "_" symbols. Spaces and other characters are not allowed.

The length of data table title - 1-25 characters.

 

Reserved data tables titles that should not be used by users:

CNTR_..., TPMCNTR_..., TPMDESC_..., TPMID_..., TPMLINK_..., TPMNODE_..., TPMCNTR_..., OD...

 

 

7.6.        Lines describing the data fields of the object data table

 

At least one line describing the data fields of the object data table in the description of the object table is mandatory.

Key field line is described separately - a field intended for storing the name of an object from object data table description start line- see p.6.1.

Key field line is mandatory if the table is intended to identify objects and store their characteristics. If the key field in the table description is missing, the table is intended for other purposes.

If a key field is defined, then other lines of the fields definition are optional.

The key field of the table is defined in one line with the following structure:

od_key[tab]<title>

 

Example:

od_key        object_name

, where:

- «od_key» - keyword for table key field definition,

- «object_name» – example of table key field title.

The length of key field title - 1-31 characters.

 

Table data fields are defined with the following one-line structure:

od_fld[tab]<title>[tab]<comment>[tab]{<field properties><space>}<format>[tab]{<default value>[tab]{<value 1>, …<value N>}

or:

od_fld[tab]<title>[tab]<comment>[tab]{<field properties><space>}<format>[tab]{<default value>[tab]{<MIN value><:><MAX value>}

 

Example:

od_fld          AREA Area in square meters     Real   -20000.00          10.00:50000000.00

, where:

- «obj_fld» - keyword for table field definition line,

- «AREA» – example of a specific table field title,

- «Area in square meters» – example of a comment to the table field,

- «Real» – example of numeric data format of the table field,

- «-20000.00» – example of default value for table data field,

- «10.00:50000000.00» – example of range of values for table data field.

Or:

od_fld          MATERIAL   Main material                  Character    NULL metal, plastic, concrete

, where:

- «obj_fld» - keyword for table field definition line,

- «MATERIAL» – example of a specific table field title,

- «Main material» – example of a comment to the table field,

- «Character» – example of text data format of the table field,

- «NULL» – example of default value for table data field,

- «metal, plastic, concrete» – example of list of values for table data field.

Or:

od_fld          NAME Îfficial name         notempty required Character

, where:

- «obj_fld» - keyword for table field definition line,

- «NAME» – example of a specific table field title,

- «Îfficial name» – example of a comment to the table field,

- «Character» – example of text data format of the table field,

- «notempty required» – field properties: empty value is forbidden, user-input is mandatory.

 

The number of defined data fields is unlimited.

The length of the field title is 1-31 characters.

The unique title of each data field within the same table is mandatory.

The length of the field comment is 1–200 characters.

Field properties in the description of data fields are optional. The following field properties are provided:

- const - user input is not provided,

- notempty - empty value is forbidden,

- required - user-input is mandatory.

Absence of the field properties means the ability to input  values ​​by the user, the possibility of empty field value and/or user-input of values.

One can specify more than one field properties in the description by defining combinations of field properties. Exception: field properties are separated from each other and from the format description with a space "", and not by commas and tabs.

There are three formats for the data fields of the object tables:

- Integer - for numeric integer values ​​(from -2147483648 to 2147483647),

- Real - for numeric fractional values,

- Character - for character text values ​​(up to 10,000 characters).

The length of the string describing text values ​​in the total cannot exceed 10247 characters. In other words, the length of the description of possible values ​​can be up to 10,000 characters.

When describing possible values, if commas “,” or colons “:” appear in the values,  a backslash “\”must be added before them. I.e., “\,” or “\:”.

 

For one object, more than one data table can be defined. The number of tables for one object is not limited.

One table can be defined for any number of objects.

The total number of tables described is not limited.

 

The number of described objects is not limited.

The size of the drawing standards definition file is not limited.

 

 

Revision 4.

Sharov Alexander & NULL ©   Russia, Moscow    odxclass.odxedit.ac@gmail.com

 

04.10.2018