Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Jun 8, 2010
Messages
4
Location
AT
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))
)
)
 
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

Back
Top