TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MeasureUp on December 06, 2010, 10:55:19 PM
-
How to modify an individual dimension object?
For example, I know I can change the "dimaunit" value by selecting a dimension & using the "dimoverride".
But I can't find the "dimaunit" value when selecting the dimension object picked.
The only onething found from the HELP in "HEADER Section Group Codes" (HEADER section) is:
$DIMAUNIT
Group Code = 70
Angle format for angular dimensions:
0 = Decimal degrees;
1 = Degrees/minutes/seconds;
2 = Gradians; 3 = Radians;
4 = Surveyor's units
But there is another group code of "70" with different meaning in "Common Dimension Group Codes" in ENTITIES section.
Thanks in advance.
-
Try: vla-get-AngleFormat
(defun c:test(/ ent obj)
(vl-load-com)
(and (setq ent (car (entsel "\nPick a dimension for angle format.")))
(setq obj (vlax-ename->vla-object ent))
(or (vlax-property-available-p obj 'AngleFormat)
(prompt "\nThis is not a angle dimension."))
(princ "\nThe angle Format is ")
(princ (vla-get-AngleFormat obj))
)
(princ)
)
-
Try: vla-get-AngleFormat
(defun c:test(/ ent obj)
(vl-load-com)
(and (setq ent (car (entsel "\nPick a dimension for angle format.")))
(setq obj (vlax-ename->vla-object ent))
(or (vlax-property-available-p obj 'AngleFormat)
(prompt "\nThis is not a angle dimension."))
(princ "\nThe angle Format is ")
(princ (vla-get-AngleFormat obj))
)
(princ)
)
It works. Thanks CAB.
More questions,
1) there is no way to get it by using DXF code directly, is this right?
2) And where to get the entire vla- functions reference? (It is not found in the HELP).
-
Dim overrides are stored in extended entity data:
(entget (car (entsel)) '("*"))
You probably can change them "directly", but it won't be very easy.
-
Dim overrides are stored in extended entity data:
(entget (car (entsel)) '("*"))
You probably can change them "directly", but it won't be very easy.
The attached may help in that respect.
-
I should have realized where this was going. 8-)
http://www.theswamp.org/index.php?topic=3313.msg40725#msg40725
-
Here is a very old lisp that looks at the dimension xdata:
;;; DimPrec.lsp
;;; By Charles Alan Butler 04/27/2003
;;; This routine will flag all dims that have dimension text
;;; over ridden or have a precision greater less than 1/32 .
;;; One or more of the following symbols are placed over the dimension
;;;
;;; Symbols
;;; CHECK = Dimensions that have a precision >= 1/32
;;; S = Dimensions that are STYLE dependent for precision
;;; Circle/ = Dimensions with precision less than 1/32 (0.00000)
;;; SquareX = Dimensions that have Text Overrides
;;; Diamond+ = Dimensions that are rounded off & precision is ok
;;;
;;; The symbols used are placed on Layer "DefPoints"
;;; and sized according to DIMTXT size variable,
;;; or the Text Style of the DIM if it's size > 0
;;;
;;; Limitations :
;;; not designed to work in paper space.
;;; USCS World plan view only
;;;
;;; Revision 04/12/04
;;; Correction for ACAD2000, blocks are created on layer 0 now
;;; Dims selected are visible in space you are working
;;; not All dims & frozen as before
;;; Streamlined code
;;;
;;; Revision 12/17/05
;;; Added the Rounded Off flagging of dimensions that are within
;;; the precision of the style
http://www.theswamp.org/index.php?topic=8098.0
Removed code and added link...
-
This another in this thread. http://www.theswamp.org/index.php?topic=24561.0
Haven't located any great examples yet.
-
OK here is one using DXF codes.
http://www.theswamp.org/index.php?topic=10317.0