Community
Hi. Looking for help with creating a lisp program to do what we're doing manually. To scale an exported layout drawing and the dimensions.
1. open Layout tab to be exported
2. make note of the viewport scale using VPSCALE
3. run EXPORTLAYOUT command
4. open the exported drawing
5. SCALE "all" at basepoint 0,0 to the scale noted in #2
6. run DimUpd.lsp (found on CADTutor.net site created by Lee Mac)
Here's the DimUpd.lsp file:
; by Lee Mac from CADTutor.net (defun c:DimUpd ( / *error* _StartUndo _EndUndo _SwapProps doc ss ) (vl-load-com) ;; © Lee Mac 2010 (defun *error* ( msg ) (and doc (_EndUndo doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (defun _SwapProps ( obj prop1 prop2 / tmp ) (if (and (vlax-property-available-p obj prop1 t) (vlax-property-available-p obj prop2 t) ) (progn (setq tmp (vlax-get-property obj prop1)) (vlax-put-property obj prop1 (vlax-get-property obj prop2)) (vlax-put-property obj prop2 tmp) ) ) ) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (ssget "_X" '((0 . "*DIMENSION"))) (progn (_StartUndo doc) (vlax-for o (setq ss (vla-get-ActiveSelectionSet doc)) (_SwapProps o 'LinearScaleFactor 'ScaleFactor) ) (vla-delete ss) (_EndUndo doc) ) ) (princ) )
Could someone please help me out with this?
Thanks in advance.
Bob