CADTutor: The best free help for AutoCAD on the web

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Go Back   AutoCAD Forums > AutoCAD > AutoLISP, VBA, the CUI & Customisation

Reply
 
Thread Tools
Old 23rd Nov 2009, 08:46 am   #1
MR MAN
Senior Member
 
Using: AutoCAD 2007
 
Join Date: Apr 2008
Posts: 249
Default Intersecting lines

i have two lines intersecting at point is there any way to explode them to 4 parts at intersection point.
MR MAN is offline   Reply With Quote
Old 23rd Nov 2009, 10:04 am   #2
msasu
Full Member
 
Using: AutoCAD 2008
 
Join Date: Mar 2009
Location: Brasov, Romania
Posts: 80
Default

By hand or automatically?
For the first case use BREAK command with “First point” option and subsequently select intersection point twice – do the same for both lines. Done!
msasu is offline   Reply With Quote
Old 23rd Nov 2009, 11:46 am   #3
MR MAN
Senior Member
 
Using: AutoCAD 2007
 
Join Date: Apr 2008
Posts: 249
Default

thanks msasu for your help,but if i need select some intersecting lines and do this automatically how can i do that?
MR MAN is offline   Reply With Quote
Old 23rd Nov 2009, 11:58 am   #4
Tiger
Super Moderator
 
Tiger's Avatar
 
Using: AutoCAD 2010
 
Computer Details
 
Join Date: Nov 2006
Location: Wintery Sweden
Posts: 2,838
Default

There are a few lisps floating around that expands the Break-command - this thread highlights one that might be of use to you:

http://www.cadtutor.net/forum/showth...ght=BREAK+LISP

For help on how to use Lisps, please see this instruction:

http://www.cadtutor.net/forum/showthread.php?t=1390

I blame the fish!
Tiger is offline   Reply With Quote
Old 23rd Nov 2009, 12:00 pm   #5
msasu
Full Member
 
Using: AutoCAD 2008
 
Join Date: Mar 2009
Location: Brasov, Romania
Posts: 80
Default

Will require an AutoLISP routine with the above structure
1. Select the lines to process (filter for errors).
2. List endpoints of those lines.
3. Get the intersection point – using INTERS statements; exit if lines don’t intersect or the point doesn’t lies on (both) lines.
4. Call programmatically the BREAK command to split entities.
msasu is offline   Reply With Quote
Old 23rd Nov 2009, 02:18 pm   #6
David Bethel
Super Member
 
David Bethel's Avatar
 
Using: AutoCAD R12
 
Join Date: Dec 2003
Location: Newport News, Virginia
Posts: 1,126
Default

This will work on LINEs, not PLINESs or ARCs

Code:
(defun c:bil (/ ss l1 l1d l2 l2d p10 p11 p20 p21 ip)
  (while (or (not ss)
             (/= (sslength ss) 2))
         (princ "\nSelect 2 LINEs that Intersect")
         (setq ss (ssget (list (cons 0 "LINE")
                               (if (getvar "CTAB")
                                   (cons 410 (getvar "CTAB"))
                                   (cons 67 (- 1 (getvar "TILEMODE"))))))))

  (setq l1 (ssname ss 0) l1d (entget l1)
        l2 (ssname ss 1) l2d (entget l2)
        p10 (cdr (assoc 10 l1d)) p11 (cdr (assoc 11 l1d))
        p20 (cdr (assoc 10 l2d)) p21 (cdr (assoc 11 l2d))
        ip (inters p10 p11 p20 p21))

  (cond ((not ip)
         (alert "Lines Do Not Intersect"))
        (T
         (command "_.BREAK" l1 ip ip
                  "_.BREAK" l2 ip ip)))
  (prin1))

-David

R12 (Dos) - A2K
David Bethel is offline   Reply With Quote
Old 24th Nov 2009, 02:04 am   #7
Lee Mac
Luminous Being
 
Lee Mac's Avatar
 
Using: AutoCAD 2010
 
Computer Details
 
Join Date: Aug 2008
Location: London, England
Posts: 7,714
Default

Another,

Code:
(defun c:brk (/ ss i y Obj1 Obj2 Ent1 Ent2 iLst ip)
  (vl-load-com)

  (if (setq ss (ssget "_:L" '((0 . "~VIEWPORT"))))
    (progn
      
      (setq i (sslength ss))
      (while (not (minusp (setq y (1- i) i (1- i))))
        (setq Obj1 (vlax-ename->vla-object (setq Ent1 (ssname ss i))))

        (while (not (minusp (setq y (1- y))))
          (setq Obj2 (vlax-ename->vla-object (setq Ent2 (ssname ss y))))

          (if (setq iLst (vlax-invoke Obj1 'IntersectWith Obj2 acExtendNone))
            (command "_.break" Ent1 "_non" (setq ip (list (car iLst) (cadr iLst) (caddr iLst)))
                      ip "_.break" (list Ent2 ip) "_non" ip ip))))))

  (princ))

Lee Mac is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Polyline and Line intersecting Jozi68 AutoLISP, VBA, the CUI & Customisation 4 22nd Sep 2009 12:48 pm
Isometric with two fillet intersecting magwea AutoCAD Beginners' Area 8 14th Jan 2009 10:34 am
Break 2 Intersecting Lines wherestheanykey AutoCAD Drawing Management & Output 3 16th Apr 2007 11:32 pm
Fix self-intersecting pline boundary ORgrown AutoCAD General 5 13th Dec 2006 04:53 am
3d plane and intersecting line Jreez AutoCAD General 3 18th May 2005 02:39 pm

Why Donate?


All times are GMT +1. The time now is 12:47 am.

RSS Feed for AutoCAD ForumsValid XHTML 1.0!Valid CSS!Creative Commons Licence