Neburorama Posted September 9, 2022 Posted September 9, 2022 (edited) ; ********************************** (defun chkdims_err (s) ; If an error (such as CTRL-C <ESC>) occurs, (if (/= s "Function cancelled") (princ (strcat "\nError: " s)) ) ; VARIABLE RESETS AND COMMANDS TO PERFORM UPON ERRORS FOLLOW:, (SETVAR "SNAPMODE" SNP) (SETVAR "OSMODE" OS) (SETVAR "ORTHOMODE" ORTH) (if olderr (setq *error* olderr)) ; Restore old *error* handler, (princ) );;defun, ;************************************************ MAIN PROGRAM ********************** ;************************************************************************************, (defun c:DiMRAH (/ olderr snp os orth cot1 a Lyns n index Ln1 Ln2 Lst1 Lst2 Pt1 Pt2 ang Pt1a tipe ) ;VARIABLES TO SAVE FOR ERROR HANDLER FOLLOW:, (setq snp (getvar "snapmode") os (getvar "osmode") orth(getvar "orthomode") ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, (setvar "snapmode" 0) (setvar "osmode" 0) (setvar "orthomode" 1) ;;;*******************************************************************************, (if (= gvr nil) (setq gvr 1.0) );end if, (princ "\nDistancia entre Cota y Linea:<") (princ gvr) (princ "> ") (setq a (getdist)) (if (= a nil) (setq a gvr) );end if, (setq gvr a) ;;; ****************************************************************************, (PROMPT "Select lines or <Fence> ") (setq Lyns (ssget) n (sslength Lyns) index 0 ) ;cierra setq, (repeat (- n 1) (setq Ln1 (ssname Lyns index); Ln2 (ssname Lyns (+ 1 index)); Lst1 (entget Ln1) Lst2 (entget Ln2) Pt1 (cdr (assoc 10 Lst1)) Pt2 (cdr (assoc 10 Lst2)) index (+ 1 index) ang (angle Pt1 Pt2) Pt1a (list (- (car pt1) a) (+ (cadr pt1) a ); ) ) ;cierra setq, ;;;****************************************************************************, (cond ( (or (= ang 0.0 ) (= ang 180.0 ) ) (setq tipe "HOR") ) ( (or (= ang 90.0 ) (= ang 270.0) ) (setq tipe "VER") ) ( T (setq tipe "ALI") ) ) ;;;*****************Acotaciones********************************************, (command "_dimlinear" pt1 pt2 pt1a ) ; ) ; ;;;****************************************************************************, (setvar "snapmode" 0) ; (setvar "osmode" 39) (setvar "orthomode" 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, (setq *error* olderr) ; (princ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, (PRINC) ) ;;;;;;;;;;;;, Edited September 9, 2022 by SLW210 Added Code Tags!! Quote
Neburorama Posted September 13, 2022 Author Posted September 13, 2022 Need help for dimension to make it associated to selected lines Quote
Neburorama Posted September 20, 2022 Author Posted September 20, 2022 On 9/14/2022 at 4:02 PM, ronjonp said: QDIM ? Thanks por help, mi lisp I did was since 2002 and Im updating or deleting someones. 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.