(defun c:PIEL ()
(setq pt1 (getpoint "\nPick the first point: "))
(setq pt2 (getpoint pt1 "\nPick the second point: "))
(setq pt3 (getpoint pt2 "\nPick the third point (90 degrees): "))
(setq an (* (/ 180 pi) (angle pt2 pt3)))
(command "_.PLINE" pt1 pt2 "")
(command "_.PLINE" pt2 pt3 "")
(command "_.INSERT" "JAI" pt2 1.0 1.0 0)
(setq obj1(entlast))
(princ (strcat "\nRotation angle: " (rtos an 2 2)))
)
(princ)
Solved! Go to Solution.
Solved by ec-cad. Go to Solution.
i want i pick p1 p2 p3 block object insert and angle is p2 p3 its work only one direction its an angle is 0 but other wise its insert but angle its opposite direction dont want dynamic action its just i test for block
Looks like I'll have to check the direction of both plines.
The are 16 combinations of which way they are applied.
But in any case, the elbow needs to be at 0 or 180 it looks like.
I'll try a little later, lunch is ready.
ECCAD
OK, I got it working.
Attached is the Lisp and the sample drawing, with notes.
Seems that there were only 8 combinations of those pline connections,
since pt3 can only be 'perp' to pt2, 0, 90, 180 or 270.
Anyway, have fun with it.
Cheers
ECCAD
Can't find what you're looking for? Ask the community or share your knowledge.