woodman78 发表于 2022-7-5 17:38:47

Rotate a line until it's

Well that is it.I am looking for a lisp to do what I have said above.Is it possible?

Lee Mac 发表于 2022-7-5 17:58:28

Rotation about a user-specified basepoint?

BIGAL 发表于 2022-7-5 18:02:08

Easy draw a circle, intersectwith only tricky bit is it may have two answers. I take you want a programming answer not a drafting answer.
 
Manually do you really need code ? Circle grip-edit erase all done.
 
Code wise 2 picks, pick line near rotation point this returns length and correct point, pick pline, draw a circle and use intersectwith rotate line ask is correct press enter else draw 2nd answer. little busy at moment Lee may beat me anyway.

woodman78 发表于 2022-7-5 18:16:38

Yes LeeMac to rotate about one end of the line until the other end intersects the line.

Lee Mac 发表于 2022-7-5 18:20:47

 
I agree - the manual method may in fact yield a quicker result:
 

Grrr 发表于 2022-7-5 18:29:34

I think the op should specify more his request:
2 endpoints, and 2 rotation orientations (CW and CCW) = 4 different ways for the code to work.

BIGAL 发表于 2022-7-5 18:47:28

Grr correct that is why the pick of the line near the rotation end of the line, saves extra picks just compare pick pt to the two ends and the shortest distance is the rotation pt.
 

(setq tp1 (entsel "\nSelect left side inner wall near end : "))(setq tpp1 (entget (car tp1)))(setq pt1 (cdr (assoc 10 tpp1)))      (setq pt2 (cdr (assoc 11 tpp1)))      (setq pt3 (cadr tp1))(setq wallh (cdr (assoc 39 tpp1)))    (setq hts (caddr pt1))                (setq d1 (distance pt1 pt3))(setq d2 (distance pt2 pt3))        (if (> d1 d2)        (progn                 (setq temp pt1)                (setq pt1 pt2)                (setq pt2 temp)        )        )
页: [1]
查看完整版本: Rotate a line until it's