Jump to content

CADTutor AutoLISP Tutorial


AdamW

Recommended Posts

Hi All Ive been going through the AutoLISP tutorial on this site and think I might have found an error. The example for changing the cross hair reads

 

"(defun c:perpdon (/ a b pntl pnt2 angl) (graphscr)

(setq a (entsel))

(setq b (entget (car a)))

(setq pntl (cdr (assoc 10 b)))

(setq pnt2 (cdr (assoc 11 b)))

(setq angl (angle pntl pnt2))

(setvar "snapang" ang1)

(princ)

)

 

(defun c:perpdoff (setvar "snapang" 0)

(princ)

)"

 

These don't seem to work for me.

 

However if I add a set of parentheses to (defun c:perpdoff (setvar "snapang" 0) to make it (defun c:perpdoff () (setvar "snapang" 0) then Perpoff works.

 

Similary in perpon I have to change the line (setvar "snapang" ang1) to (setvar "snapang" angl) chnaging the "1" to an "L".

 

Then all works well. If I have it wrong I appologise.

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...