Author Topic: Change Dimension Arrow  (Read 2403 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2084
Change Dimension Arrow
« on: February 24, 2006, 04:32:20 PM »
Luis posted a code to revise dimension arrows on the AutoDesk's forum. I modifed it slightly.
Just thought I would pass it on...

Code: [Select]
;;;by Luis E.   February 2006   www.geometricad.com

(defun ChgArrow1  (arr / data ename elist pt obj p10 p11 p13 p14)
  (if (and (setq data (entsel "\n* Select Dimension to change Arrowhead *"))
           (setq ename (car data))
           (eq (cdadr (setq elist (entget ename))) "DIMENSION")
           (setq pt (osnap (cadr data) "_end")))
    (progn (setq obj (vlax-ename->vla-object ename)
                 p10 (cdr (assoc 10 elist))
                 p11 (cdr (assoc 11 elist))
                 p13 (cdr (assoc 13 elist))
                 p14 (cdr (assoc 14 elist)))
           (if (< (distance pt p10) (distance pt p13))
             (vla-put-Arrowhead2Type obj arr)
             (vla-put-Arrowhead1Type obj arr)
           )
    )
  )
  (princ))
;;;
(defun c:CHD1 (/ arrx1)
  (setq arrx1 (getreal "\n* Enter Arrow number type <0 thru 19): "))
  (if arrx1 (ChgArrow1 arrx1))
  (princ)
)
(defun ChgArrow2  (arr1 arr2 / data ename elist pt obj p10 p11 p13 p14)
  (if (and (setq data (entsel "\n* Select arrowhead of dimension to change *"))
           (setq ename (car data))
           (eq (cdadr (setq elist (entget ename))) "DIMENSION")
           (setq pt (osnap (cadr data) "_end")))
    (progn (setq obj (vlax-ename->vla-object ename)
                 p10 (cdr (assoc 10 elist))
                 p11 (cdr (assoc 11 elist))
                 p13 (cdr (assoc 13 elist))
                 p14 (cdr (assoc 14 elist)))
           (if (< (distance pt p10) (distance pt p13))
             (vla-put-Arrowhead2Type
               obj
               (if (eq (vla-get-Arrowhead2Type obj) arr2)
                 arr1
                 arr2))
             (vla-put-Arrowhead1Type
               obj
               (if (eq (vla-get-Arrowhead1Type obj) arr2)
                 arr1
                 arr2)))))
  (princ))
;;;
(defun c:CHD2 (/ arrx1 arrx2)
  (if arrx1 (setq arrx1 (getreal "\n* Enter Arrow number type <0 thru 19): ")))
  (if arrx2 (setq arrx2 (getreal "\n* Enter Arrow number type <0 thru 19): ")))
  (ChgArrow2 arrx1 arrx2)
  (princ)
)

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Change Dimension Arrow
« Reply #1 on: February 24, 2006, 04:42:04 PM »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

GDF

  • Water Moccasin
  • Posts: 2084
Re: Change Dimension Arrow
« Reply #2 on: February 24, 2006, 04:56:23 PM »
Yes, sorry I forgot where I got it.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Change Dimension Arrow
« Reply #3 on: February 24, 2006, 04:59:41 PM »
No prob.  It's a Friday.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.