Jump to content
teknomatika

Break overlapping lines using endpoints

Recommended Posts

teknomatika

Does anyone know any routine that allows, automatically, the break function, but with the points to be defined by endpoints? I need to make the break in overlapping lines.

I know and I use the excellent routine authored by CAB, "Breakall.lsp" but only works for intersections.

Share this post


Link to post
Share on other sites
MSasu

I'm afraid that I don't understand what you were looking for. Can you, please, post a sketch of this case?

Share this post


Link to post
Share on other sites
teknomatika
I'm afraid that I don't understand what you were looking for. Can you, please, post a sketch of this case?

 

MSasu,

Thank you for your interest.

I attached the file.

I hope that is understandable.

cadtutor_exp.dwg

Share this post


Link to post
Share on other sites
MSasu

So, you were looking to join contiguous line segments into single line, not to break them. Please check the built-in JOIN command.

Share this post


Link to post
Share on other sites
teknomatika
So, you were looking to join contiguous line segments into single line, not to break them. Please check the built-in JOIN command.

 

MSasu,

No. Just the opposite. I intend to break the line 1 from the endpoints of the other overlapping lines.

Share this post


Link to post
Share on other sites
teknomatika
MSasu,

No. Just the opposite. I intend to break the line 1 from the endpoints of the other overlapping lines.

 

 

I would like to resume the request for help was requested.

I am grateful to the one who can help.

Tanks.

Share this post


Link to post
Share on other sites
hmsilva

teknomatika,

if I understand correctly, perhaps something like this...

 

(defun c:test (/ ENT ENT1 ENT2 I LEN1 LEN2 LNAME LST PT SS)
 (defun remdup (inlst / outlst)
   (while inlst
     (setq outlst (cons (nth 0 inlst) outlst)
    inlst  (vl-remove (nth 0 inlst) inlst)
     );; setq
   );; while
   (reverse outlst)
 );; remdup
 (if (setq ss (ssget ":L" '((0 . "LINE"))))
   (progn
     (setq i 0
    len1 0
     );; setq
     (repeat (sslength ss)
(setq ent1 (ssname ss i)
      ent2 (entget ent1)
      len2 (distance (cdr (assoc 10 ent2)) (cdr (assoc 11 ent2)))
      i    (+ i 1)
);; setq
(if (> len2 len1)
  (setq len1  len2
 lname ent1
  );; setq
);; if
     );; repeat
     (ssdel lname ss)
     (setq i 0)
     (repeat (sslength ss)
(setq ent (ssname ss i)
      i   (1+ i)
      pt  (cdr (assoc 10 (entget ent)))
      lst (append lst (list pt))
      pt  (cdr (assoc 11 (entget ent)))
      lst (append lst (list pt))
);; setq
     );; repeat
     (command "erase" ss "")
     (setq lst (remdup lst))
     (foreach pt lst
(command "_.break" "_non" pt "_f" "_non" "@" "_non" "@")
     );; foreach
   );; progn
 );; if
);; test

 

hope that helps

Henrique

Share this post


Link to post
Share on other sites
teknomatika
teknomatika,

if I understand correctly, perhaps something like this...

 

(defun c:test (/ ENT ENT1 ENT2 I LEN1 LEN2 LNAME LST PT SS)
 (defun remdup (inlst / outlst)
   (while inlst
     (setq outlst (cons (nth 0 inlst) outlst)
    inlst  (vl-remove (nth 0 inlst) inlst)
     );; setq
   );; while
   (reverse outlst)
 );; remdup
 (if (setq ss (ssget ":L" '((0 . "LINE"))))
   (progn
     (setq i 0
    len1 0
     );; setq
     (repeat (sslength ss)
(setq ent1 (ssname ss i)
      ent2 (entget ent1)
      len2 (distance (cdr (assoc 10 ent2)) (cdr (assoc 11 ent2)))
      i    (+ i 1)
);; setq
(if (> len2 len1)
  (setq len1  len2
 lname ent1
  );; setq
);; if
     );; repeat
     (ssdel lname ss)
     (setq i 0)
     (repeat (sslength ss)
(setq ent (ssname ss i)
      i   (1+ i)
      pt  (cdr (assoc 10 (entget ent)))
      lst (append lst (list pt))
      pt  (cdr (assoc 11 (entget ent)))
      lst (append lst (list pt))
);; setq
     );; repeat
     (command "erase" ss "")
     (setq lst (remdup lst))
     (foreach pt lst
(command "_.break" "_non" pt "_f" "_non" "@" "_non" "@")
     );; foreach
   );; progn
 );; if
);; test

 

hope that helps

Henrique

 

Dear hmsilva, appreciate the attention. Unfortunately it is not working the way you want and need.

Furthermore returns an error: Invalid point, polygon segment is zero length.

; error: Function cancelled

Share this post


Link to post
Share on other sites
hmsilva

teknomatika,

tested with your dwg, and gives no error...

 

Henrique

cadtutor_exp_h.dwg

Share this post


Link to post
Share on other sites
teknomatika
teknomatika,

tested with your dwg, and gives no error...

 

Henrique

 

hmsilva,

tanks.

 

Yes indeed testing darwin in the specific example, it gives no error.

However, this was just an example. I attached another example in which the routine no longer works. In resume, i need to do the routine breakpoint on all endpoints of overlapping lines. The resulting lines should be kept.

cadtutor_exp2.dwg

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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