CAD2005 Posted February 27 Posted February 27 (edited) Hi everybody. I found on the web lisp change dimension style. But the lisp part does not have object selection. So I hope those who understand lisp can help me fix it! Sincerely thank you (I do not understand lisp programming) (defun c:CHDM (/ sclst dms dmlst dcl_id wri) (setq dmlst '() obj (vlax-get-acad-object) doc (vla-get-activedocument obj) dms (vla-get-dimstyles doc)) (vlax-for x dms (setq dmlst (cons (vla-get-name x) dmlst))) (setq dcl_id (vl-filename-mktemp nil nil ".dcl") wri (open dcl_id "w")) (foreach x '( "dimsty : dialog" "{label = \"DimStyle List\";" ":list_box {key = \"dmstyle\";" "multiple_select = false; height=10;}" "ok_cancel;" "}" ) (write-line x wri)) (setq wri (close wri)) (< 0 (setq dcl-load (load_dialog dcl_id)) (if (not (new_dialog "dimsty" dcl-load))(exit))) (start_list "dmstyle")(mapcar 'add_list dmlst)(end_list) (action_tile "dmstyle" "(setq sclst (get_tile \"dmstyle\"))") (action_tile "accept" "(done_dialog)(setq clk t)") (action_tile "cancel" "(done_dialog)(setq clk nil)") (start_dialog) (unload_dialog dcl-load) (if clk (if sclst (progn (setq secstl (nth (atoi sclst) dmlst)) (vla-put-activedimstyle doc (vla-item (vla-get-Dimstyles doc) secstl))))) (princ)) Edited February 27 by SLW210 Added Code Tags!! Quote
Steven P Posted February 27 Posted February 27 So if you put the code in the code tags (press the '<>' button in the text editor box) it makes it a lot clearer to read - puts the code in the grey box. What are you trying to do? This look just like a pop-up box to change the current dimension style Quote
BIGAL Posted February 27 Posted February 27 You can use SSGET to make a selection of dims then simply change their style. Either a entmod or VL method. Maybe as simple as this. (defun c:wow ( / ss obj) (setq ss (ssget (list (cons 0 "DIM*")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (vlax-put obj 'StyleName "Standard") ) (princ) ) (c:wow) OOPs thought I posted this yesterday. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.