Jump to content

Break all lines intersect with each other


dcpanchal_2005

Recommended Posts

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • kyosmith

    9

  • Lee Mac

    5

  • alanjt

    3

  • manirpg

    2

Top Posters In This Topic

Posted Images

Lee i didnt understand what you said about the wipeout.

I dont know how to code in lisp. if someone can do it for me i will be very grateful

thanks anyway

Link to comment
Share on other sites

  • 2 months later...

I have a dwg. which contains a lot of polylines and many places it will have a block on the vertices of the polylines. I need to break the bunch of polylines at the insertion point of the block or at the vertex of each of the polyline nearest to the place i select the polylines.

 

Thanks in advance...

Link to comment
Share on other sites

Hi Lee,

Nice routine..

I need the same with some other application. If possible pls help me.

means required jump in all breaking points.Here attached jpeg for ur reference

thanks in advance

Mani:)

BRKALL.jpg

Link to comment
Share on other sites

Hi,

I checked in that thread also, many jumper routines posted by lee....but all are not working fine.(need any initial setting?). also need gap or radious input (mine its showing too small).Any way that all jumper routines working one by one, but i need all in one time without pick intersetion points.

Jumper either horizontal or vertical not a problem.........

pls someone help me.............

Thanks in advance

Regards

mani:)

Link to comment
Share on other sites

  • 1 year later...

Hi,

is there a lsp to obtain the results showed in the attachement ? Is it available to other objects too ?

 

I'd like to break all selected objects using two params: "distance" and "gap".

 

"Distance" is the distance from one to another break and "gap" is the break gap :D

if an object length is shorter than "distance", cut in the middle.

 

 

Sample.dwg

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I found a solution for my problem, but I'm new with LISP and I have a problem: I added a if condition to check in the length of object is less that the distance. This stops the execution. Is there anyone who can check the code anb save me ?

 

Thanks

 

Jack

 

(defun c:BDG (/	      *error* AT:DrawX	      _getint _getint2
      cmd     seg     i	      ss      e	      div     gap
      poc     poc2
     )
 ;; Break object(s) at Distance with Gap 
 ;; Modified by Jack, 04.29.12 
 ;; Original by Alan J. Thompson, 11.01.11  

 (vl-load-com)

 (defun *error* (msg)
   (and cmd (setvar 'CMDECHO cmd))
   (and *AcadDoc* (vla-endundomark *AcadDoc*))
   (if	(and msg
     (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,"))
)
     (princ (strcat "\nError: " msg))
   )
 )

 (defun AT:DrawX (P C)
   ;; Draw and "X" vector at specified point
   ;; P - Placement point for "X"
   ;; C - Color of "X" (must be integer b/w 1 & 255)
   ;; Alan J. Thompson, 10.31.09
   (if	(vl-consp P)
     ((lambda (d)
 (grvecs
   (cons C
	 (mapcar (function (lambda (n) (polar P (* n pi) d)))
		 '(0.25 1.25 0.75 1.75)
	 )
   )
 )
 P
      )
(* (getvar 'VIEWSIZE) 0.02)
     )
   )
 )

 (defun _getint (/ i)
   (cond ((not (setq i (getdist "\nSpecify Distance: "))))
  ((<= i 0)
   (princ "\nValue must be greater than 0!")
   (_getint)
  )
  (i)
   )
 )

 (defun _getint2 (/ i)
   (cond ((not (setq i (getdist "\nSpecify Gap: "))))
  ((<= i 0)
   (princ "\nValue must be greater than 0!")
   (_getint2)
  )
  (i)
   )
 )

 (vla-startundomark
   (cond (*AcadDoc*)
  ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))
  )
   )
 )
 (setq cmd (getvar 'CMDECHO))
 (setvar 'CMDECHO 0)
 (redraw)

 (if (and (setq div (_getint))
   (setq gap (_getint2))
   (setq i  -1
	 ss (ssget "_:L"
		   '((0 . "ARC,LINE,*POLYLINE,SPLINE,CIRCLE,ELLIPSE"))
	    )
   )
     )
   (while (setq e (ssname ss (setq i (1+ i))))
     (setq
len (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e))
     )
     (if (> len div)
(
 (setq seg (fix (/ len div)))
  (repeat (1- seg)
    (setq poc (trans (vlax-curve-getPointAtDist e div) e 1))
    (setq
      poc2
       (trans (vlax-curve-getPointAtDist e (+ div gap)) e 1)
    )

    (vl-cmdf "_.break" e "_F" "_non" poc "_non" poc2)
    (setq e (entlast))
  )
)
(
 (setq poc
	(trans
	  (vlax-curve-getPointAtDist e (- (/ len 2) (/ gap 2)))
	  e
	  1
	)
 )
  (setq
    poc2
     (trans (vlax-curve-getPointAtDist e (+ (/ len 2) (/ gap 2)))
	    e
	    1
     )
  )

  (vl-cmdf "_.break" e "_F" "_non" poc "_non" poc2)
  (setq e (entlast))
)
     )
   )
   ;; end while
 )
 (*error* nil)
 (princ)
)

Link to comment
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
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...