hakanli Posted September 14, 2021 Share Posted September 14, 2021 (edited) Hi, everyone I am trying to draw a simple graph with lisp, but with very small lengths values, start points are the previous ones can anybody help? (defun c:simp () (setq start (getpoint "\n select point")) (setq n (getint "enter n:")) (setq deltalist nil) (repeat n (setq delta (getdist "/lengths")) (setq deltalist (append deltalist (list delta))) ) (setq ct 0) (repeat n (setq deltax (nth ct deltalist)) (setq pt1 (list (+ (car start) deltax) (cadr start))) (setq pt2 (list (+ (car start) deltax) (+ (cadr start) 3))) (command "line" start pt1 "") (command "line" pt1 pt2 "") (setq ct (+ 1 ct)) ) ) Edited September 14, 2021 by CADTutor Code moved to code block Quote Link to comment Share on other sites More sharing options...
Steven P Posted September 14, 2021 Share Posted September 14, 2021 and what do you want the graph to look like? You might have written the perfect code to draw this graph, but i suspect it isn't the one you want it to draw.. maybe if you can attach a file showing an example, Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 15, 2021 Share Posted September 15, 2021 The obvious missing is setting "osmode" your home work, else you may end up with zero length lines as osnap will cause problems snapping points when you dont want them to. Y= 4x^2 + 3X + 5 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.