Message 1 of 2

Not applicable
07-16-2015
08:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I'm having issues with this LISP in ACAD 2014. I'm unsure why, but the intent is to import a dimstyle via a block depending on the MEASUREMENT variable for Metric and Imperial styles.
What I'm running into is each time the command runs, it brings in the dimstyle, but it resets the DIMSCALE to 1 and does not set it as the current dimstyle. Any help is appreciated. Thanks!
(defun c:dim_lin (/ ds dskbk dim acdoc) (setq ds (if (= (getvar 'measurement) 0) "s2014" "s2014 - M" ) ) (setq dsbk (strcat "*" @dwg "dim_" ds ".dwg") ;define dimstyle block dim (getvar 'dimscale) ;gets dimscale for cmleaderscale ) (if (tblsearch "dimstyle" ds);test (progn ;thenexprs (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (vla-put-activedimstyle acdoc (vla-item (vla-get-Dimstyles acdoc) ds)) );endthen (progn ;elseexprs (command "-insert" dsbk "0,0" "1" "1" "0") ;place dsbk (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (vla-put-activedimstyle acdoc (vla-item (vla-get-Dimstyles acdoc) ds)) );endelse );endif (initcommandversion) (command ".dimlinear") ;run command (while (> (getvar 'cmdactive) 0) (command pause) );endwhile );enddefun
Solved! Go to Solution.