How to Convert Aligned Dimension to Rotated/Linear Dimension

How to Convert Aligned Dimension to Rotated/Linear Dimension

vsanchezT8AAJ
Community Visitor Community Visitor
11,667 Views
21 Replies
Message 1 of 22

How to Convert Aligned Dimension to Rotated/Linear Dimension

vsanchezT8AAJ
Community Visitor
Community Visitor

How to Convert Aligned Dimension to Rotated/Linear Dimension

0 Likes
11,668 Views
21 Replies
Replies (21)
Message 21 of 22

calderg1000
Mentor
Mentor

Regards @autocad123_asd 

Try this code with a small edit for multiple selection.

(defun c:ChangeDimObject2 (/ lsn j EntData Pt1 Pt2 Pt3)
  (setq
    lsn (vl-remove-if 'listp
                      (mapcar 'cadr (ssnamex (ssget '((0 . "DIMENSION")))))
        )
  )
  (foreach j lsn
    (setq EntData (entget j)
          Pt1     (cdr (assoc 13 EntData))
          Pt2     (cdr (assoc 14 EntData))
          Pt3     (cdr (assoc 11 EntData))
    )
    (if (< (car Pt1) (car Pt2))
      (command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2)) 5))
      (command "_.ucs" "-3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1)) 5))
    )
    (entdel j)
    (command "_.dim"
             "_horizontal"
             (trans Pt1 0 1)
             (trans Pt2 0 1)
             (trans Pt3 0 1)
             ""
             "_exit"
    )
    (command "_.ucs" "_p")
  )
)
;___
(defun dtr (deg) (* (/ deg 180.0) pi))

 

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 22 of 22

autocad123_asd
Observer
Observer
20250929-0609-55.6016051.mp4
<>

sir it's not working it's actually playing with coordinate arrows.....here
is a screen recording... Sir please check the code in a model.....
0 Likes