Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

line commad wont osnap intersection just mid end or perp point

4 REPLIES 4
Reply
Message 1 of 5
cadking2k5
343 Views, 4 Replies

line commad wont osnap intersection just mid end or perp point

I am work on a new line command with some more option and it works fine unless I draw the line up to another line and run it accross the line to the angle I want it, it will not snap to the point it snaps to endp midp or prep If I have the intersection osnap on it will not snap to the point I am at htis is not all of the command I left out some of the (= null pt1)

 

(setq pt1a (getpoint "\nSpecify point")) 

(setq pt2 (getpoint pt1 "\nSpecify second point" ))
  (if (null pt2)
    (vl-exit-with-error "")
    )
  (command "_line" pt1 pt2 "")

(while

(setq ang1 (angtos (angle pt2 pt1) 0 1))

(command "angbase" pt2 pt1)

(initget "C D U")

(setq pt3 (getpoint pt2 "\nPick next Point or [Undo/Close]:"))

(cond

((null pt3)

(vl-exit-with-error "") );end null

((= 'LIST (type pt3))

(command "angbase" pt2 Pt1)

(command "_line" pt2 pt3 "")

(setq pt1 pt2)

(setq pt2 pt3)

(setq l (cons (entlast) l)) ); end list

((= pt3 "U")

(entdel (car l))

(setq l (cdr l))

(setq obj1 (cdr (assoc 10 (entget (entlast)))))

(setq obj2 (cdr (assoc 11 (entget (entlast)))))

(setq ob1 (list(car obj1) (cadr obj1)))

(setq ob2 (list(car obj2) (cadr obj2)))

(setq ang (angtos (angle ob2 ob1)))

(setq pt1 ob1) (setq pt2 ob2)

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: cadking2k5

If I understood correctly, change

(command "_line" pt2 pt3 "")

to

(command "_line" "none" pt2 "none" pt3 "")

HTH
Henrique

EESignature

Message 3 of 5
cadking2k5
in reply to: hmsilva

that dose work if I highlight it and past it on the command line but it won't if I load it and run it in the command which don't make any since to me I see how it should work
Message 4 of 5
cadking2k5
in reply to: cadking2k5

it work i found my mistake thanks a lot
Message 5 of 5
hmsilva
in reply to: cadking2k5

You're welcome, cadking2k5
Glad I could help

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost