Jump to content

simple graph with lisp


Recommended Posts


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 by CADTutor
Code moved to code block
Link to post
Share on other sites

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,

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...