join tow parallell polyline

join tow parallell polyline

abdulellah.alattab
Advocate Advocate
4,700 Views
25 Replies
Message 1 of 26

join tow parallell polyline

abdulellah.alattab
Advocate
Advocate
 

there is an lisp to join polylines positioned  with gap as shown image .

select first line  then second line , give angle measured from first line , lisp extend second line and join it with first by an inclined line  

join two parallel polylines.JPG

0 Likes
Accepted solutions (2)
4,701 Views
25 Replies
Replies (25)
Message 2 of 26

devitg
Advisor
Advisor

Study the INTERS function 

0 Likes
Message 3 of 26

Sea-Haven
Mentor
Mentor

Can be done simple

 

pick line 1 end get the x,y co-ords. 

Pick line 2 end get xy co-ords

use sin cos to work out new x & Y co-ord of sloping line for entered angle.

draw line pedit and join if pline.

use fillet entlast and line 2 to auto join (use ssget with pick point of line 2)

 

Or end point angle draw a line way longer, then fillet using pick line 2. (you need to know roughly how far apart lines would normally be to make 2 picks.)

0 Likes
Message 4 of 26

Kent1Cooper
Consultant
Consultant

Any interest in something that does this?

tcc.JPG

You can get TCC.lsp that does it >here<.  You pick the nearer endpoints and specify the radius of the arc segments, and it draws a Polyline [the reddish part here].

Kent Cooper, AIA
0 Likes
Message 5 of 26

Kent1Cooper
Consultant
Consultant

...and they don't need to be parallel for TCC to connect them:
tcc2.JPG

nor do they need to be straight:

tcc3.JPG

Kent Cooper, AIA
0 Likes
Message 6 of 26

abdulellah.alattab
Advocate
Advocate

i am glad for your replay lisp wise

i am sure you will help me . this lisp posted in this link is what i want . https://www.theswamp.org/index.php?topic=54130.msg587555#msg587555 it need littel modification . let me run fillet command with preset radius equal zero , and aske me to pick lines that i want to join them , after that done , lisp return to frist task with last angle value . lisp must be remember last angle value when start it agine. i hope to help me

0 Likes
Message 7 of 26

Kent1Cooper
Consultant
Consultant

@abdulellah.alattab wrote:

i am glad for your replay lisp wise

i am sure you will help me . this lisp posted in this link is what i want ....



I can't get that to work.  I don't see attachments for the image/drawing that shows how it's supposed to work, nor to get the later code modification(s), and if one needs to be a member there to see attachments, I'm not willing to join just for this.  I tried several combinations of direction of Polylines, which one is above the other, the Left/Right/Both options, etc., and I got "numberp: nil" error messages every time.

 

Have you tried asking there?

 

I may just try something starting from my TCC command rather than from that, but not immediately.

 

[By the way, the word "replay" is  an English word, but it means something completely different -- you want the word "reply."]

Kent Cooper, AIA
Message 8 of 26

hak_vz
Advisor
Advisor

Simple code, maybe you will like it

(defun c:jtangle nil (jtangle))

(defun jtangle () (setq jt_ang (* PI (/ (getreal "\nGeneral angle for sloped joint >" ) 180.0))))

(defun c:angjoin ( / e p1 p2 p3 p4 p5 *error*)
(defun *error* () (princ))
(if (not jt_ang) (jtangle))
(setq
    p1 (getpoint "\n Specify startpoint of sloped polyline > ")
    p2 (polar p1 jt_ang 10000.0)
    e (car(entsel "\n Select line to intersect with >"))
    p3 (cdr (assoc 10 (entget e)))
    p4 (cdr (assoc 11 (entget e)))
    p5 (inters p1 p2 p3 p4 nil)
)
(command "pline" p1 p5 (getpoint "\nSelect endpoint of sloped polyline") "")
(princ)
)

To store or change angle of sloped line use command JTANGLE.

To create a sloped line and join it to other use command ANGJOIN.

It asks you to select starting point of sloped line, line to cross with, and at the end

to click at end point to finish polyline.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 9 of 26

abdulellah.alattab
Advocate
Advocate

i am sorry about word my English very weak .

i will attach two lisp files (plangle and JL commands ) , i think ,  They will be useful for the purpose of the study .

 

This will not be a hindrance to you, I am sure of that

 

0 Likes
Message 10 of 26

abdulellah.alattab
Advocate
Advocate

and this .

why *.fas format file can not able to load as attachment .

Why do I always ask for a  DWG file

 

0 Likes
Message 11 of 26

abdulellah.alattab
Advocate
Advocate

thanks for your help , but some thing wrong about second command .

 

Command: ANGJOIN
Specify startpoint of sloped polyline >
Select line to intersect with >too many arguments
Command:

0 Likes
Message 12 of 26

Kent1Cooper
Consultant
Consultant

@abdulellah.alattab wrote:

.... why *.fas format file can not able to load as attachment . ....


You should be able to put it in a .zip file and attach that.

Kent Cooper, AIA
0 Likes
Message 13 of 26

hak_vz
Advisor
Advisor
Accepted solution

Instead of polylines use LINE objects (you may easily join them later).

Use command to define an global angle.

 

Here is another version that draws line at angle to the point of intersection, and waits

to extend other line to intersection point.

 

(defun c:angjoin2 ( / e p1 p2 p3 p4 p5 *error*)
(defun *error* () (princ))
(if (not jt_ang) (jtangle))
(setq
    p1 (getpoint "\n Specify startpoint of sloped polyline > ")
    p2 (polar p1 jt_ang 10000.0)
    e (car(entsel "\n Select line to intersect with >"))
    p3 (cdr (assoc 10 (entget e)))
    p4 (cdr (assoc 11 (entget e)))
    p5 (inters p1 p2 p3 p4 nil)
)
(setq m
         (entmakex
           (list
             '(0 . "LINE")
             (cons 10 p1)
             (cons 11 p5)
           )
         )
       )
(command "_extend" m "")
  (while (> (getvar 'cmdactive) 0)
   (command "\\")
  )
(princ)
)

 

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 14 of 26

abdulellah.alattab
Advocate
Advocate

my opinion "well job" < it need more effort  , there is other way make it more efficient .

thanks

0 Likes
Message 15 of 26

ВeekeeCZ
Consultant
Consultant

@abdulellah.alattab wrote:

my opinion "well job" < it need more effort  , there is other way make it more efficient .


Ohh, that's rude!

 

But on the other hand, what a great opportunity for you! You know, everyone who's learning needs some goal. The big thing. Something to aim the effort. For us is hard to tell what you consider as efficient... because we don't know your specific workflow. So once you learn enough you can do adjust the workflow to be as efficient as you think is the best. Nobody else could ever do that for you.

 

 

 

 
Message 16 of 26

abdulellah.alattab
Advocate
Advocate

Your previous program is very impressive, can you make it work in any direction in the 2d model space . At least in the vertical and horizontal direction

 

my goal is : rebar drafting ................

 

 

0 Likes
Message 17 of 26

hak_vz
Advisor
Advisor

@abdulellah.alattab wrote:

my goal is : rebar drafting ................


Code I've provided was written as a sample to show what can be done with few simple lines of code.  As a such it needs some optimizations. First it would have to calculate  orientation (inclination) of first bar, on that it would add angle to draw sloped bar, find intersection to second bar and finally extend second bar to intersection.  It would have to use autolisp trans command to work correctly no matter how your lines are positioned. And it can be optimized to do it more efficiently. It would work correctly for any orientation of two bars that had to be joined.

 

Without lisp you can try a option to use polar tracking and with enabled option extension for object snap.

 

Many years ago I had been doing a lot of rebar drafting and calculations (beams, slabs, plates, various foundations....) and have had all my drafting and calculations done in acad (eurocode and PBAB sandard). If you want to achieve your goal the best option is to learn basics of autolisp. Knowing just basic set of commands enables you to create very usable helper functions or even a whole programs. Of course, that program would need a lot of testing before you can use it in practice.  Asking for help without learning autolisp wont get you far with your goal.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 18 of 26

abdulellah.alattab
Advocate
Advocate

I hope so, if i don't make mistake, you are also a civil engineer. Being like that, you certainly know that your time is no longer yours, work is losing us.😓😓

 

 

 

0 Likes
Message 19 of 26

abdulellah.alattab
Advocate
Advocate

I am embarrassed to carry out your stress with me, but what I want is an amendment, according to what is mentioned here, no more.

I will never go back to bother you .

 

 

0 Likes
Message 20 of 26

Sea-Haven
Mentor
Mentor

Hi hak_vz a quick and dirty is

UCS ob pick 1st line end point

(setq pt1 (getpoint)) returns (0.0 0.0 0.0)

(setq pt2 (getpoint)) returns (-123.470482154845 -127.157217775563 0.0) the x y z of the point so know the Y value 

check the +/- of X Y diff gives direction

use sin cos for new x y of pt3 given angle

as per my previous post does not matter line or pline.

Then UCS W

 

0 Likes