Offset Angles 90 and 270

Dommy2Hotty

Usenet Archive
Joined
Jan 28, 2004
Messages
58
Reaction score
0
Here's part of my lisp to offest a line created...what do I replace the ? with to offset the line 90 or 270 degrees? Is this something I need to set during the lisp, something like (setq angup (....))? I want to avoid picking a point above or below the line, but I don't know how to input angles into a lisp command.

(setq L1 (entlast))

(command "offset" "8.0" L1 ? "")
 
Look into the polar function:

You would need to determine an angle ahead of time.
You could use the angle of the line:
(setq pt1(cdr (assoc 10 (entget l1)))
pt2 (cdr (assoc 11 (entget l1)))
angle_in_radians (+ (angle pt1 pt2)(* pi 0.5)) ;minus is other direction. ) (command "offset" "8.0" L1 (polar (getvar "lastpoint") angle_in_radians distance) "")

HTH

Bill
 
Okay, all lines will be horizontal, so the angles offset will always be 90 and 270. Here's what I got so far, but don't know if I need to change anything in the part that you gave me...

(defun c:offtest

(command "line" pause pause "")

(setq L1 (entlast))

(setq pt1(cdr (assoc 10 (entget L1)))
(setq pt2(cdr (assoc 11 (entget L1)))
(+ (angle pt1 pt2)(* pi 0.5)))

(command "offset" "8.0" L1 (polar (getvar "lastpoint") angle_in_radians distance) "")

(princ)

)
(princ)
 
no, the 8.0 is ok in quotes, I mean, the lisp works great, but I'd like to take the these two steps out:

(setq DN (getpoint "\nSelect Point BELOW Foundation : " ))

(setq UP (getpoint "\nSelect Point ABOVE Second Floor : " ))

I use them to establish points to offset to, but that's two extra steps I have to do when running the lisp. I want to replace them with 90 for UP and 270 degrees for DN so they are set automatically when the lisp starts.
 
if the points will ALWAYS be either in the +y or -y direction ,relative to the line, why not just use incredibly large numbers for the pick point? (setq dn '(0 -100000000) up '(0 100000000)
)

Jeff

Dommy2Hotty said:
no, the 8.0 is ok in quotes, I mean, the lisp works great, but I'd like to take the these two steps out:

(setq DN (getpoint "\nSelect Point BELOW Foundation : " ))

(setq UP (getpoint "\nSelect Point ABOVE Second Floor : " ))

I use them to establish points to offset to, but that's two extra steps I
have to do when running the lisp. I want to replace them with 90 for UP and 270 degrees for DN so they are set automatically when the lisp starts.
 

Latest threads

Back
Top