CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.092.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search Search  Events Events  Register Register  Login Login

Topic ClosedSimple Lisp Problem?

 Post Reply Post Reply
Author
jpkibble View Drop Down
Newbie
Newbie


Joined: 19.Nov.2010
Location: United Kingdom
Using: AutoCAD 2006
Status: Offline
Points: 6
Direct Link To This Post Topic: Simple Lisp Problem?
    Posted: 19.Nov.2010 at 17:01
I've recently been getting into Lisp with AutoCAD2006 with some success, however the following routine is giving me a headache.

It should draw a simple array of vertical lines 100 high at 25 unit intervals, it works fine but after a few test runs it starts doing funny things, missing every other line...missing lots of random lines or even spuriously joining lines to nearby objects. All very strange - have you any ideas why it might be happening?

(defun c:SPR ()
(setq leng (getint "Enter Length of Section in Metres:"))
(setq sectionstart (getpoint "\nPick Insertion point:"))
(setq aa (car sectionstart))
(setq bb (cadr sectionstart))
(setq rptn (+ 1 (fix (/ leng 25))))
(command "line" (list (+ aa leng) bb) (list (+ aa leng) (+ bb 100)) "")
; Repeat loop starts here
(repeat rptn
(command "line" (list aa bb) (list aa (+ bb 100) ) "")
(setq aa (+ aa 25))
)
; Repeat loop stops here
)





Edited by jpkibble - 19.Nov.2010 at 17:02
Back to Top
CarlB View Drop Down
Senior Member
Senior Member


Joined: 16.Oct.2009
Location: United States
Status: Offline
Points: 321
Direct Link To This Post Posted: 20.Nov.2010 at 07:20
Sounds like a common problem, for people learning Lisp...

You have a running Osnap set, so line snaps to an endpoint rather than the desired coordinate. It's erratic because it depends on the zoom level/pickbox size.
Back to Top
jpkibble View Drop Down
Newbie
Newbie


Joined: 19.Nov.2010
Location: United Kingdom
Using: AutoCAD 2006
Status: Offline
Points: 6
Direct Link To This Post Posted: 20.Nov.2010 at 08:55
That's great - problem solved with the use of OSMODE.

Thanks.Clap
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,075 seconds.