Jump to content

Recommended Posts

Posted

 Hi all, hope all of you doing great and healthy.

I tried GETPOINT but..that's all i can think of and not knowing what's next.

The reference point was from a

(setq RefPoint (GETPOINT "\nSelect Ref Point"))

and if i select Left, all the objects is on the left vice versa.

Is it correct if i use

 (IF (< = Getpoint1 RefPoint))

, my routine will make things on the left? Im not trying to mirror or offset but create object by picking a side. If i picked a point (Getpoint1) that is not parallel to the Y value of RefPoint, how will the routine know that's the LEFT or RIGHT? I kind of know how to calculate the X value from those 2 numbers (car Getpoint1 & car RefPoint) but what if the Y value is not the same?

0.PNG

Posted

A couple of answers you can code what is left and right, but for me I use a more manual method pick an end this implies go away from this point then you always know left and right it takes a little bit of care but you get used to it. So looking at a rectang pick left top line and on bottom line pick right end they are the same direction right is inside. This is like 30 year old code but works. Need variation for plines.

 

(SETQ TP1 (entsel "\nSelect Line near left end: ")) ; implies which way for holes
(setq tpp1 (entget (car tp1))
	p1 (cdr (assoc 10 tpp1))
	p2 (cdr (assoc 11 tpp1))
	p3 (cadr tp1)
)

(setq d1 (distance p1 p3)
	d2 (distance p2 p3)
)

(if (> d1 d2)
    (progn 
    (setq temp p1)
    (setq p1 p2)
    (setq p2 temp)
    )
)
	
(setq ang (angle p1 p2)
	dist (distance p1 p2)
)

 

 

 

 

  • Like 1

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