How to rotate dimangular text

How to rotate dimangular text

devitg
Advisor Advisor
210 Views
1 Reply
Message 1 of 2

How to rotate dimangular text

devitg
Advisor
Advisor

Hi , please help me . I need to rotate, by lisp,   angular dimension as follow find attached a sample dwg

 

rotate dim text ..png

0 Likes
Accepted solutions (1)
211 Views
1 Reply
Reply (1)
Message 2 of 2

Moshe-A
Mentor
Mentor
Accepted solution

@devitg  hi,

 

check this, i not fully sure but it look like the mtext rotation is not part of the dimension style.

 

works?

 

Moshe

 

 

 

; dimenstion text rotate
(defun c:dimtxtrot (/ collectPoints ; local function
		      ss ename AcDbDim pts int)

 (defun collectPoints ()
   (mapcar
     (function
       (lambda (prop)
         (vlax-safearray->list (vlax-variant-value (vlax-get-property AcDbDim prop)))
       )
     )
     '(textPosition ExtLine1StartPoint ExtLine1EndPoint ExtLine2StartPoint ExtLine2EndPoint) 
   )
 ); collectPoints

  
 (if (setq ss (ssget '((0 . "dimension") (100 . "AcDbAngularDimension"))))
  (progn 
   (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
     
    (setq AcDbDim (vlax-ename->vla-object ename)) 
    (setq pts (collectPoints))
     
    (if (setq int (inters (cadr pts) (caddr pts) (cadddr pts) (last pts)))
     (vla-put-textRotation AcDbDim (angle int (car pts)))
    )
     
    (vlax-release-object AcDbDim) 
   ); foreach
   
  ); progn 
 ); if
  
 (princ)
); c:dimtxtrot