NH3man! Posted May 22, 2009 Author Share Posted May 22, 2009 I will give it a go. Thanks Lee! Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 22, 2009 Author Share Posted May 22, 2009 Work like a champ Lee. Thanks again!!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 22, 2009 Share Posted May 22, 2009 excellent, no problem Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 28, 2009 Author Share Posted May 28, 2009 I have been trying to get your lsp to do a zero slope. The only way I can do it is the change the slope int to 1. But then it will not slope at all. Then I tried to edit out all of the slope related command and redo the definitions and temps but seem to get an error when I do that. Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 30, 2009 Author Share Posted May 30, 2009 I tried to edit this to make it so I didn't need to enter a slope but it keeps giving me error when I try to call it. It would be nice just to have the original be able to do a zero slope, I can make it do it but then it will not work with the slope when needed unless I edit it back. (defun c:sh (/ *error* vlst ovar cBlk tmp1 tmp2 tmp3 blkpt) ; Error Handler (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) ; Return System Variables (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n<< Error: " msg " >>"))) ; Print Error Message (princ)) ; Collect and Set System Variables (setq vlst '("CMDECHO" "OSMODE") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) ; Set Defaults (or hc$cop:def (setq hc$cop:def 1)) (or hc$spc:def (setq hc$spc:def 1)) (or hc$dir:def (setq hc$dir:def "X")) ; Get Block to Copy (if (and (setq cBlk (car (entsel "\nSelect Block: "))) (eq "INSERT" (cdr (assoc 0 (entget cBlk))))) (progn ; Get User Input (initget 6) (setq tmp1 (getint (strcat "\nSpecify Number of Copies <" (itoa hc$cop:def) "> : "))) (or (not tmp1) (setq hc$cop:def tmp1)) (initget 6) (setq tmp2 (getreal (strcat "\nSpecify Spacing <" (rtos hc$spc:def) "> : "))) (or (not tmp2) (setq hc$spc:def tmp2)) (initget "X Y -x -y") (setq tmp3 (getkword (strcat "\nSpecify Axis [X/Y/-X/-Y] <" hc$dir:def "> : "))) (or (not tmp3) (setq hc$dir:def tmp3)) ; Get Block Insertion Point Information and Initiate Counter (setq blkpt (cdr (assoc 10 (entget cBlk))) i 1) ; Copy the Block a Number of Times (command "_undo" "_Begin") (repeat hc$cop:def (command "_copy" cBlk "" blkpt) (cond ((eq "X" hc$dir:def) (command (list (+ (* i hc$spc:def) (car blkpt)) (cadr blkpt) ((eq "Y" hc$dir:def) (command (list (car blkpt) (+ (* i hc$spc:def) (cadr blkpt)) ((eq "-x" hc$dir:def) (command (list (+ (* -1. i hc$spc:def) (car blkpt)) (cadr blkpt) ((eq "-y" hc$dir:def) (command (list (car blkpt) (+ (* -1. i hc$spc:def) (cadr blkpt)) ) ; end cond (command) (setq i (1+ i))) (command "_undo" "_End")) ; Else No Block was Selected (princ "\n<!> No Block Selected <!>")) ; Return Sys Vars Back (mapcar 'setvar vlst ovar) ; Exit Cleanly (princ)) Not sure if i did the code thing right. Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 30, 2009 Author Share Posted May 30, 2009 Well I see the code thing didn't work. I need help with that also I see. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 30, 2009 Share Posted May 30, 2009 See here: http://www.cadtutor.net/forum/showthread.php?t=9184 Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 30, 2009 Author Share Posted May 30, 2009 I don't seem to have those option even in the advanced reply box. I am using firefox do you think that might be the reason? Thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 30, 2009 Share Posted May 30, 2009 I don't seem to have those option even in the advanced reply box. I am using firefox do you think that might be the reason? Thanks I am also using Firefox and have the options. Just enclose the code with [/ code] tags - without the space. Quote Link to comment Share on other sites More sharing options...
NH3man! Posted May 31, 2009 Author Share Posted May 31, 2009 That did it. Thanks again and again Lee. Quote Link to comment Share on other sites More sharing options...
Arizona Posted June 23, 2011 Share Posted June 23, 2011 READ THIS: http://www.dailyautocad.com/2007/11/visuallisp-calculating-slope-between.html Quote Link to comment Share on other sites More sharing options...
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.