|
|
|
Control codes in automatic text fields introduced in AutoCAD 2005 (the FIELD command) allow some detailed options which are not available in the standard user interface.
Fortunately, you can enter the field code manually (or by pasting) anywhere in the MText editor, when entering DText or in the DDEDIT dialog. Using this method, you can use some advanced formatting to your field values - see some examples:
- %<\AcVar osmode \f "%X">%
- displays OSMODE value as hex code
- %<\AcDiesel test$(/,5,2) bbb \f "%tc4">%
- displays DIESEL string expression with uppercase initials
-
%<\AcDiesel $(edtime,$(getvar,tdindwg),$(+,$(*,24,$(fix,$(getvar,tdindwg))),$(edtime,$(getvar,tdindwg),HH)):MM:SS)>%
- displays total edit time (hh:mm:ss) spent on this drawing
- %<\AcObjProp Object(%<\_ObjId 2130116872>%).Length \f "%ds33">%
- uses "!" as decimal separator in object length (ASCII code 33)
- %<\AcObjProp Object(%<\_ObjId 2130100448>%).Area \f "%.3f">%
- displays object area to 3 decimal places (independently on LUPREC setting)
- %<\AcObjProp Object(%<\_ObjId 2130042784>%).Area \f "%lu2%ct4%qf1%PR0 sq.ft.">%
- displays object area in sq.ft. rounded (to 0 decimal places)
- %<\AcObjProp Object(%<\_ObjId 2130276472>%).Area \f "%lu2%pr2%ps[area is , sq.m]%ds44%zs8%ct8[1234]%th32">%
- displays the area rounded to 2 decimal places, with prefix "area is " and suffix " sq.m", decimal separator will be "," thousands will be separated by spaces, trailing zeroes will be suppressed, values will be multiplied by 1234 (A2007)
- %<\AcObjProp Object(%<\_ObjId 2130112520>%).CustomScale \f "1\"=%lu2%ct1%qf28161'">%
- displays viewport scale in the 1"=20' format
- %<\AcDiesel $(upper,$(edtime, $(getvar, tdcreate),DD. MONTH YYYY))>%
- displays drawing creation date in uppercase ("16. APRIL 2004")
- %<\AcObjProp Object(%<\_ObjId 2130022304>%).Coordinates \f "%pt2">%
- displays Y-coordinate of the selected POINT object
- %<\AcObjProp Object(%<\_ObjId 2130022304>%).Coordinates \f "%pt4%ct8[0.001]">%
- displays in [m] the [mm] Z-coordinate of the selected object (divides by 1000)
- for block attributes: in the BEDIT mode, add a preset attribute a set its value to (Y-coord, A2007):
%<\AcObjProp.16.2 Object(?BlockRefId,1).InsertionPoint \f "%pt2%.30q0%ct8[0.001]">%
Please note that you can also insert the %<\Ac-codes>% as DTEXT in AutoCAD LT (2005 and higher).
For other ways of flexible automatic labelling and linking object properties see LiveLabel by CAD Studio (also available for AutoCAD 2004 and 2002).
|
|
ACAD2007ACAD2005ACAD2004LTMapADT
|
* CAD
|
22.3.2004
55360×
|
|
|