Linear Dimensions

To create linear dimension features in AutoCAD requires writing an aggregate feature having the following attributes. The aggregate must contain at least one feature, although that feature needs no geometry, since all of the dimension geometry is based on the attribute values.


autocad_dimension_attach_point - The justification of the dimension text


autocad_defpt2.x, autocad_defpt2.y, autocad_defpt2.z - The location of the first dimension point. This point should be along the distance being dimensioned


autocad_defpt3.x, autocad_defpt3.y, autocad_defpt3.z - The location of the second dimension point. This should also be along the distance being dimensioned.


autocad_line_defpoint.x, autocad_line_defpoint.y, autocad_line_defpoint.z - The location of dimension line start. This defines the offset of the dimension line and text from the distance being dimensioned.


autocad_text_midpoint.x, autocad_text_midpoint.y, autocad_text_midpoint.z - The location of the text midpoint. This value can be used to position the text along the dimension line, but only takes effect if the autocad_dim_flag is greater than 127.


User-added image


autocad_dimension_type
- The type of dimension(still required even if dim_flag below is set):

   autocad_rotated   autocad_aligned   autocad_angular   autocad_diameter   autocad_radius   autocad_angular3Pt   autocad_ordinate   autocad_xordinate

autocad_dim_flag - The type of dimension (this overrides autocad_dimension_type, but is necessary for a user defined text location):

   0   = Rotated, horizontal, or vertical   1   = Aligned   2   = Angular   3   = Diameter   4   = Radius   5   = Angular 3 point   6   = Ordinate   32  = Indicates that the block reference (group code 2) is referenced by this dimension only.   64  = Ordinate type. This is a bit value (bit 7) used only with integer value 6.         If set, ordinate is X-type; if not set, ordinate is Y-type.   128 = This is a bit value (bit 8) added to the other group 70 values if the dimension         text has been positioned at a user-defined location rather than at the         default location.


autocad_dimension_style_name - The style to use for dimension


autocad_orig_dim_text - Setting this attribute will override AutoCAD's measurement of the dimension. You can use any string, so you can add prefixes or suffixes to your values if desired.


autocad_entity - This must be set to autocad_dimension