change dimstyle lsp

change dimstyle lsp

nychoe1
Advocate Advocate
1,733 Views
3 Replies
Message 1 of 4

change dimstyle lsp

nychoe1
Advocate
Advocate

hello everyone. I need some lsp

there are many dimstyle in dwg files.  I want to change dimexo <0> selected all dimstyle (offset from origin)

thank you all always.

0 Likes
Accepted solutions (1)
1,734 Views
3 Replies
Replies (3)
Message 2 of 4

dlanorh
Advisor
Advisor
Accepted solution

If i understand correctly you want to change the dimension offset in every DimStyle to 0.

 

 

This code will do that, but it will not affect any dimensions currently in the drawing. You need sothing else to do that.

 

;Micheal Puckett
(defun table (s / d r)
  (while (setq d (tblnext s (null d)))
    (setq r (cons (cdr (assoc 2 d)) r))
  )
)

(vl-load-com)

(defun c:xo20 ( / c_doc c_dims d_lst sty)
  (setq c_doc (vla-get-activedocument (vlax-get-acad-object)))
  (setq c_dims (vla-get-dimstyles c_doc))
  (setq d_lst (table "DimStyle"))
  (foreach ds d_lst
    (setq sty (vla-item c_dims ds))
    (setvar 'dimexo 0.0)
    (vla-copyfrom sty c_doc)
  );end_foreach
);end_defun

 

I am not one of the robots you're looking for

0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant

@dlanorh wrote:

.... it will not affect any dimensions currently in the drawing. You need sothing else to do that.


 

This [in very simplest terms ] will do that part, at least in the current space:

 

(defun C:DEO0 ()
  (command "_.dimoverride" "DIMEXO" 0 "" "_all" "")
)
Kent Cooper, AIA
Message 4 of 4

nychoe1
Advocate
Advocate

thank you

0 Likes