;;;Requires (ARXUNLOAD "ACDIM") before first run to enable this defun as (C:DIM) in lieu of AutoCAD's built in DIMension functions. ;;;typing (ARXLOAD "ACDIM") at the command prompt will load ACDIM.ARX restoring the default DIM command. ;;; ;;;Purpose: ;;; ;;; Automatically set view dependent layers for dimensions within floating viewports so that their display can easily ;;; be isolated to the view they are in. ;;; ;;;Limitations: ;;; ;;; This function can only be used for Horizontal or Vertical dimensions. ;;; While using this function you cannot select the entity to dimension, you must select both extension line origins. ;;; ;;;Subroutines used: ;;; ;;; mklayr.lsp, gvpno.lsp, ukword.lsp, upoint.lsp, ustr.lsp ;;; ;;; Author: Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; http://paracadd.com ;;; All rights reserved. ;;; ;;; COPYRIGHT: 6-19-2009 ;;; EDITED: 2-10-2011 ;;; (DEFUN mydim_error (msg / ) (SETQ *error* old_mydim_error) (SETVAR "osmode" old_mydim_osmode) (PRINC "\n") (PRINC msg) (PRINC) (SETVAR "clayer" old_mydim_layer) (IF (MEMBER "acdim.arx" (ARX)) NIL (ARXLOAD "ACDIM") ) (PRINC) ) (DEFUN C:MYDIM () (SETQ old_mydim_error *ERROR*) (SETQ *ERROR* mydim_error) (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ")) (IF upoint NIL (LOAD "upoint" "\nFile UPOINT.LSP not loaded! ")) (IF ustr NIL (LOAD "ustr" "\nFile USTR.LSP not loaded! ")) (c:dimlay) (SETQ first_key nil) (SETQ old_mydim_osmode (GETVAR "osmode")) (WHILE (NOT (OR (EQ first_key "Exit")(EQ first_key "Quit"))) (COMMAND nil nil nil) (PRINC "AutoCAD's Dimension command has been redefined, restores AutoCAD's native DIM command and starts it.\n") (PRINC) (SETQ first_key (ukword 1 "Horizontal Vertical Exit Quit" "Autolayered Dim [Horizontal/Vertical/Exit or Quit] " (IF first_key first_key nil)));ANGular DIAmeter RADius (IF (OR (EQ first_key "Exit")(EQ first_key "Quit")) (COMMAND ".dim" "Exit") (PROGN (SETQ dimpt_1 (upoint 1 "" "Specify first extension line origin " nil nil)) (SETVAR "osmode" 53) (COMMAND ".DIM" first_key "non" dimpt_1 (SETQ dimpt_2 (upoint 1 "" "Specify second extension line origin " nil dimpt_1))) (SETVAR "osmode" old_mydim_osmode) (PRINC "\nSpecify dimension line location ") (COMMAND pause) (SETQ default_dim (COND ((EQ first_key "Horizontal") (DISTANCE (LIST (CAR dimpt_1)(CADR dimpt_1)0.0) (LIST (CAR dimpt_2)(CADR dimpt_1)0.0) )) ((EQ first_key "Vertical") (DISTANCE (LIST (CAR dimpt_1)(CADR dimpt_1)0.0) (LIST (CAR dimpt_1)(CADR dimpt_2)0.0) )) ) ) (SETQ this_dim_text (ustr 1 "Enter dimension text " (RTOS default_dim (GETVAR "DIMLUNIT") (GETVAR "DIMDEC") ) T ) ) (IF (WCMATCH this_dim_text (RTOS default_dim (GETVAR "DIMLUNIT")(GETVAR "DIMDEC"))) (SETQ this_dim_text "") ) (COMMAND this_dim_text) (SETVAR "osmode" old_mydim_osmode) ) ) ) (c:rslayr) (IF (MEMBER "acdim.arx" (ARX)) NIL (ARXLOAD "ACDIM") ) (SETQ *error* old_mydim_error) (SETVAR "clayer" old_mydim_layer) (SETVAR "osmode" old_mydim_osmode) (PRINC) ) (DEFUN c:dimlay () (SETQ old_mydim_layer (GETVAR "clayer")) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (IF set_mjrg NIL (LOAD "SET_MJRG" "\nFile SET_MJRG.LSP not loaded! ")) (set_mjrg) (SETQ llt "-" colra nil colri nil colr "1" modf "DIMS" ) ;_ end of SETQ (IF gvpno nil (LOAD "gvpno") ) ;_ end of if (gvpno) (c:mklayr) ) (DEFUN C:DIM () (C:MYDIM)) (DEFUN C:ACDIM () (IF (MEMBER "acdim.arx" (ARX)) (COMMAND ".DIM") (PROGN (ARXLOAD "ACDIM") (COMMAND ".DIM") ) ) (PRINC) ) (PRINC) ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 1 0 0 T T nil T) ;*** DO NOT add text below the comment! ***|;