Preview for Polyline root.

Preview for Polyline root.

smallƑish
Advocate Advocate
4,877 Views
47 Replies
Message 1 of 48

Preview for Polyline root.

smallƑish
Advocate
Advocate

For example, User picks 2 Points, we have 2 options to connect the 2 points with the orthogonal root.

 

lisp is here;

 

 

(defun c:1 ( / Z1 z2 z5 z6 z3 z4)
  
  (if (and (setq Z1 (getpoint "\n Top of L shape : "))
	   (setq z2 (getpoint Z1 "\n Bot of L shape : "))
	   (setq z3 (list (car Z1) (cadr z2) 0.))
	   (setq z6 (list (car z2) (cadr Z1) 0.))
	   (setq z4 (inters Z1 (polar Z1 (* 1.75 pi) 1.)
			    z3 z2 nil))
	   (setq z5 (inters z2 (polar z2 (* 1.75 pi) 1.)
			    Z1 z6 nil))
	   )
    (command "_.line" "_non" Z1 "_non" z3 "_non" z2 ""))
  (princ)
  )


(defun c:2 ( / Z1 z2 z5 z6 z3 z4)
  
  (if (and (setq Z1 (getpoint "\nTop of 7 shape: "))
	   (setq z2 (getpoint Z1 "\n Bot of 7 shape: "))
	   (setq z3 (list (car Z1) (cadr z2) 0.))
	   (setq z6 (list (car z2) (cadr Z1) 0.))
	   (setq z4 (inters Z1 (polar Z1 (* 1.75 pi) 1.)
			    z3 z2 nil))
	   (setq z5 (inters z2 (polar z2 (* 1.75 pi) 1.)
			    Z1 z6 nil))
	   )
    (command "_.line" "_non" Z1 "_non" z6 "_non" z2 ""))
  (princ)
  )

 

 

 

Any chance to preview option 1 and option 2 Before making the polyline ?

 

smallish_0-1700553442021.png

 

 

 

 

0 Likes
Replies (47)
Message 41 of 48

viejaytabago02
Participant
Participant

Hi sir,

 

Im interested in this lisp, but how about that it is automatically fillet the intersection point and choose the value of the fillet, for example? 30mm or 40mm? Thank you

0 Likes
Message 42 of 48

Kent1Cooper
Consultant
Consultant

@viejaytabago02 wrote:

.... how about that it is automatically fillet the intersection point and choose the value of the fillet, for example? 30mm or 40mm? Thank you


That is probably possible, but first:  Which of several of my routines in this topic?

Kent Cooper, AIA
0 Likes
Message 43 of 48

viejaytabago02
Participant
Participant

For last routine lisp sir if we are able to have a fillet option for the intersection lines and radius option. Thank yo

 

 

 

 

 

0 Likes
Message 44 of 48

Kent1Cooper
Consultant
Consultant

@viejaytabago02 wrote:

.... if we are able to have a fillet option for the intersection lines and radius option. Thank yo


Well, I played with it for a while, and came up with the attached Path2Points.lsp, defining a P2P command.  I think it does everything, in limited trial.  See the comments at the top of the file.

 

EDIT:  File replaced 1 July 2024 with a correction.

Kent Cooper, AIA
0 Likes
Message 45 of 48

viejaytabago02
Participant
Participant

It work's, Thank you so much sir @Kent1Cooper for sharing. 

0 Likes
Message 46 of 48

viejaytabago02
Participant
Participant

It work's, Thank you so much sir @Kent1Cooper for sharing. May The Lord Jesus Bless you

0 Likes
Message 47 of 48

nada_rathakrishnan4ZKGD
Explorer
Explorer

Dear Cooper

 

The U length (same as other) and orthogonal are now working for me

All others shapes are working

 

Opposite end/corner: <Ortho on>
Error: bad argument type: stringp ("L,Z,D")

0 Likes
Message 48 of 48

Kent1Cooper
Consultant
Consultant

@nada_rathakrishnan4ZKGD wrote:

....Opposite end/corner: <Ortho on>

Error: bad argument type: stringp ("L,Z,D")


I don't know how this line of code ended up the way it did, but it slipped through my trials.  Change this line:

 

(if (and orth (wcmatch *P2Pshape* '("L,Z,D")))

 

by removing the red parts, to just this:

(if (and orth (wcmatch *P2Pshape* "L,Z,D"))

 

I replaced the file in Message 44 with a corrected version.

Kent Cooper, AIA
0 Likes