chelsea1307 Posted December 30, 2008 Posted December 30, 2008 I have four lisp files attached. BKGD.lsp and all layers.lsp both contain one with the start command of BKGD and Cl.lsp and Leader.lsp both have the beginning command of cl. If anyone can tell me if theres a difference that would be great. BKGD.lsp All layers.lsp Cl.LSP LEADER.lsp Quote
Lee Mac Posted December 31, 2008 Posted December 31, 2008 From just looking, it seems the first two do near about the same thing, (changing layer structures), and the second two also do quite the same thing - producing a curved leader. But test them out for yourself and see if you see any difference in their peformance. Quote
Lee Mac Posted December 31, 2008 Posted December 31, 2008 The CL.lsp also contains a few errors, some contained in the error handler, others elsewhere, like, for instance, in the error handler: (defun *error* (msg) (reset) (prompt (strcat "\n\n" msg " ")) ) ;defun There is no function definition for "reset" Quote
Lee Mac Posted December 31, 2008 Posted December 31, 2008 I have updated the CL.lsp file, for everyones benefit: ;| Curved Leader By Lee McDonnell 31.12.2008 |; (defun c:cl () (c:CurvedLeader)) ; Program Shortcut (defun c:CurvedLeader (/ *error* varlist oldvars pl vlist stpt enpt ang pt ltxt) ;; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varlist oldvars) (if (= msg "") (princ "\nLeader Constructed.") (princ (strcat "\n" (strcase msg))) ) ;_ end if (princ) ) ; end of *error* (setq varlist (list "CMDECHO" "CLAYER" "PLINEWID") oldvars (mapcar 'getvar varlist) ) ; end setq ;; --- Error Trap --- (defun makelay (x y) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "c" y x "") ) ;_ end if ) ;_ end defun (defun polyvert (z) (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget z))) ) ;_ end defun (setvar "cmdecho" 0) (vl-load-com) (mapcar 'makelay '("LEADER" "LEADER-TEXT") '("2" "2")) (setvar "clayer" "LEADER") (prompt "\nConstruct Leader... ") (setvar "PLINEWID" 0.0) (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (setq vlist (polyvert pl)) (command "_pedit" pl "S" "") (setq stpt (car vlist) enpt (last vlist) ang (angle stpt (cadr vlist)) ) ;_ end setq (command "_pline" stpt "W" "0.0" "2.0" (polar stpt ang 4.0) "" ) ;_ end command (setq pt (polar enpt 0 2.5)) (if (/= (setq ltxt (getstring t "\nSpecify Text for Leader: ")) "") (entmake (list '(0 . "TEXT") '(8 . "LEADER-TEXT") (cons 10 pt) (cons 40 2.5) (cons 1 ltxt) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 0) '(73 . 2) (cons 11 pt) ) ; end list ) ; end entmake (alert "Blank Leader Created.") ) ;_ end if (*error* "") (princ) ) ;_ end defun Quote
Lee Mac Posted December 31, 2008 Posted December 31, 2008 Another updated version: ;| Curved Leader By Lee McDonnell 31.12.2008 |; ; Version 2 ~ Added Variable Menu. (defun c:cl () (c:CurvedLeader)) ; Program Shortcut (defun c:CurvedLeader (/ *error* varlist oldvars pl vlist stpt enpt ang pt ltxt) ;; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varlist oldvars) (if (= msg "") (princ "\nLeader Constructed.") (princ (strcat "\n" (strcase msg))) ) ;_ end if (princ) ) ; end of *error* (setq varlist (list "CMDECHO" "CLAYER" "PLINEWID") oldvars (mapcar 'getvar varlist) ) ; end setq ;; --- Error Trap --- (or (getenv "CL:ARROWW") (setenv "CL:ARROWW" "2.0")) (or (getenv "CL:ARROWL") (setenv "CL:ARROWL" "4.0")) (or (getenv "CL:TEXTH") (setenv "CL:TEXTH" "2.5")) (or (getenv "CL:TEXTO") (setenv "CL:TEXTO" "2.5")) (alert (strcat "Type \"CLSET\" to Alter Base Variables. \nCurrent Settings: \n\nArrow Width: " (getenv "CL:ARROWW") "\nArrow Length: " (getenv "CL:ARROWL") "\nText Height: " (getenv "CL:TEXTH") "\nText Offset: " (getenv "CL:TEXTO") ) ;_ end strcat ) ;_ end alert (defun makelay (x y) (if (not (tblsearch "Layer" x)) (command "-layer" "m" x "c" y x "") ) ;_ end if ) ;_ end defun (defun polyvert (z) (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget z))) ) ;_ end defun (setvar "cmdecho" 0) (vl-load-com) (mapcar 'makelay '("LEADER" "LEADER-TEXT") '("2" "2")) (setvar "clayer" "LEADER") (prompt "\nConstruct Leader... ") (setvar "PLINEWID" 0.0) (command "_pline") (while (> (getvar "cmdactive") 0) (command pause)) (setq pl (entlast)) (setq vlist (polyvert pl)) (command "_pedit" pl "S" "") (setq stpt (car vlist) enpt (last vlist) ang (angle stpt (cadr vlist)) ) ;_ end setq (command "_pline" stpt "W" "0.0" "2.0" (polar stpt ang 4.0) "" ) ;_ end command (setq pt (polar enpt 0 2.5)) (if (/= (setq ltxt (getstring t "\nSpecify Text for Leader: ")) "") (entmake (list '(0 . "TEXT") '(8 . "LEADER-TEXT") (cons 10 pt) (cons 40 2.5) (cons 1 ltxt) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 0) '(73 . 2) (cons 11 pt) ) ; end list ) ; end entmake (alert "Blank Leader Created.") ) ;_ end if (*error* "") (princ) ) ;_ end defun (princ "\nCurved Leader by Lee McDonnell Loaded. Type \"CL\" to Invoke.") (defun c:clset (/ arw arl txth txto) (or (getenv "CL:ARROWW") (setenv "CL:ARROWW" "2.0")) (or (getenv "CL:ARROWL") (setenv "CL:ARROWL" "4.0")) (or (getenv "CL:TEXTH") (setenv "CL:TEXTH" "2.5")) (or (getenv "CL:TEXTO") (setenv "CL:TEXTO" "2.5")) (alert (strcat "Current Settings: \n\nArrow Width: " (getenv "CL:ARROWW") "\nArrow Length: " (getenv "CL:ARROWL") "\nText Height: " (getenv "CL:TEXTH") "\nText Offset: " (getenv "CL:TEXTO") ) ;_ end strcat ) ;_ end alert (if (setq arw (getreal (strcat "Specify Arrow Width <" (getenv "CL:ARROWW") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "CL:ARROWW" (rtos arw)) ) ;_ end if (if (setq arl (getreal (strcat "Specify Arrow Length <" (getenv "CL:ARROWL") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "CL:ARROWL" (rtos arl)) ) ;_ end if (if (setq txth (getreal (strcat "Specify Text Height <" (getenv "CL:TEXTH") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "CL:TEXTH" (rtos txth)) ) ;_ end if (if (setq txto (getreal (strcat "Specify Text Offset <" (getenv "CL:TEXTO") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "CL:TEXTO" (rtos txto)) ) ;_ end if (princ "\nBase Variables Set.") (princ) ) ;_ end defun Quote
chelsea1307 Posted January 5, 2009 Author Posted January 5, 2009 Thanks for the info. I ran them and they seemed to do pretty much the same thing i just wanted to make sure there wasnt anything extra in one before i delete one. 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.