Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, everyone I am trying to draw

Status
Not open for further replies.

hakanliaa

Mechanical
Jun 8, 2010
4
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))
)
)
 
Replies continue below

Recommended for you

AutoCAD will use the current object snaps while executing the lisp, so for points close together, the "endpoint" osnap may be affecting point/line placement.

It's best to control osnaps within the lisp, such as by (setvar "osmode" "0")
Actually you should capture current osmode, set the osmode for routine, then restore osmode setting at end of routine.
 
thanks a lot. yes problem solved with osnap mode
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor