help using the dimaligned

help using the dimaligned

Anonymous
Not applicable
944 Views
3 Replies
Message 1 of 4

help using the dimaligned

Anonymous
Not applicable

hello, everyone

I have a question about dimaligned

see atteched file. and some different

I want to no.2 dimaligned. how to make......

is there any lisp.

 

 

0 Likes
945 Views
3 Replies
Replies (3)
Message 2 of 4

Moshe-A
Mentor
Mentor

hi,

 

do you mean what's bother you is modifying an aligned dimension gets it's angle changed then here is a simple lisp that can replace it to a rotated dimension.

 

enjoy

moshe

 

 

; convert aligned dimension to rotate dimension
(defun c:al2ro (/ set_dimstyle ; local function
		  ss i ename elist p10 p13 p14 c50 savDimstyle)

 (defun set_dimstyle (dimsty)
  (if (/= (getvar "dimstyle") dimsty)
   (setvar "dimstyle" dimsty) 
  )
 ); set_dimstyle

 ; here start (c:al2ro)
 (setvar "cmdecho" 0)		       ; disable command echo	
 (command "._undo" "begin")            ; start undo group
 (setq savDimstyle (getvar "dimstyle") ; save current dimstyle
  
 (if (setq ss (ssget '((0 . "dimension"))))
  (progn
   (setq i -1)
   (repeat (sslength ss)
    (setq i (1+ i) ename (ssname ss i) elist (entget ename))
    (if (= (logand (cdr (assoc '70 elist)) 1) 1) ; is it aligned dimension
     (progn
      (set_dimstyle (cdr (assoc '3 elist))) ; set dimstyle
       
      (setq p10 (cdr (assoc '10 elist))
            p13 (cdr (assoc '13 elist))
            p14 (cdr (assoc '14 elist))
            c50 (angle p13  p14))
      
      (command "._dimrotated" (angtos c50 0 4) p13 p14 p10)
      (entdel ename) ; delete old dimension
     ); progn
    ); if 
   ); repeat
  ); progn
 ); if

 (set_dimstyle savDimstyle) ; restore dimstyle
 (command ".undo" "_end")   ; close undo group
 (setvar "cmdecho" 1)	    ; restore command echo
  
 (princ)
); c:al2ro
  

 

 

Message 3 of 4

Anonymous
Not applicable

tnank you so much

 

(setq savDimstyle (getvar "dimstyle") ; save current dimstyle    --->>  add ")"

 

0 Likes
Message 4 of 4

Moshe-A
Mentor
Mentor

unionaf,

 

there is one  more thing to take care of is the layer to draw the modified dimension (attached an updated lsp)

please mark this thread as your solution.

 

thank you

moshe

 

 

0 Likes