danielk Posted June 26, 2013 Share Posted June 26, 2013 The first lisp SLOPE.LSP label a slope of a line in percentage and also have the ability to use different scales horizontal and vertical , something that is very useful when creating a pipeline section... Its Working great just sometimes in autocad 2013 or 2014 when im trying to repeat the command it wont let me so i need to restart autocad. the second lisp SLOPEDRAW.LSP create a line at a specified slope the problems are: 1)the lisp starts only when i drag the file into autocad screen 2) the line is created in opposite direction from the points i click to create it . thanks guys, i hope that someone else will also find it usefulslopedraw.lsp slope.lsp Quote Link to comment Share on other sites More sharing options...
danielk Posted June 28, 2013 Author Share Posted June 28, 2013 anyone please? Quote Link to comment Share on other sites More sharing options...
GP_ Posted June 29, 2013 Share Posted June 29, 2013 ...in autocad 2013 or 2014 when im trying to repeat the command it wont let me so i need to restart autocad. maybe: rem is a lisp function, can not be indicated as a variable. (setvar "osmode" rem) the second lisp SLOPEDRAW.LSP create a line at a specified slope the problems are: 1)the lisp starts only when i drag the file into autocad screen 2) the line is created in opposite direction from the points i click to create it . ;CODE ;by Maurizio - July 2011 [b][color=red]([/color][/b]defun C:Slopedraw () ;; [color=red][b]1)[/b][/color] [color=red]missing parenthesis[/color] ;INPUT SLOPE (if (= pSlope nil) (setq pSlope 3.03) ) (setq perc (getreal (strcat "\nSlope % <" (rtos pSlope 2 2) "> :"))) (if (/= perc nil) (setq pSlope perc) ) ;FIRST POINT - DISTANCE (setq p1 (getpoint "\nStart point: ")) (setq dd (getdist "\nDistance: " p1)) (setq dy (/ (* dd pSlope) 100.0)) ;SECOND POINT AT LEFT AND DY > 0 (setq p2 (mapcar '+ p1 (list ([b][color=red]+[/color][/b] dd) dy 0))) ;; [color=red][b]2)[/b] substitute - with +[/color] (command "_line" p1 p2 "") (princ) ) or (setq p2 (mapcar '+ p1 (list dd dy 0))) Quote Link to comment Share on other sites More sharing options...
GP_ Posted July 2, 2013 Share Posted July 2, 2013 anyone please? .......... Quote Link to comment Share on other sites More sharing options...
danielk Posted July 2, 2013 Author Share Posted July 2, 2013 Thank you soo much , SlOPEDRAW.LSP is working great. what about the slope.lsp did you find the problem ? do i need to delete the raw with "rem"? Quote Link to comment Share on other sites More sharing options...
neophoible Posted July 2, 2013 Share Posted July 2, 2013 Thank you soo much , SlOPEDRAW.LSP is working great. what about the slope.lsp did you find the problem ? do i need to delete the raw with "rem"? GP_ told you what one problem was. Renaming rem to rem2 everywhere would be a simple fix for this. Try it and see if that's all it needs. Quote Link to comment Share on other sites More sharing options...
neophoible Posted July 2, 2013 Share Posted July 2, 2013 Actually, I don't see where rem was actually being used other than at the end. It looks like the intent was to save the OSMODE value then reset it, but that didn't happen. You could add the missing line near the beginning like this (setq rem2 (getvar "OSMODE")) 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.