Jump to content

Rotate a line until it's end point intersects a polyline


Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted
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.

 

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

 

linegriprotation.gif

Posted

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.

Posted

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)
	)
	)

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...