TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rainier on July 09, 2007, 11:15:45 PM

Title: how to identify a line has a duplicate???
Post by: rainier on July 09, 2007, 11:15:45 PM
guys!
question:
how to identify a single line not duplicate.. and not lays in the same line...

       start point1  X----------X----------X---------------X  end point1
                                start point2   start point2

how to make in lisp routine...??
Title: Re: how to identify a line has a duplicate???
Post by: Adesu on July 10, 2007, 01:28:34 AM
Hi rainier,
look like this
Code: [Select]
(defun c:test (/ ss ssl)
  (if
    (setq ss (ssget '((0 . "LINE"))))
    (progn
      (setq ssl (sslength ss))
      (if
(>= ssl 2)
(alert (strcat "\nThis object have"
       "\n"
       "\n" (itoa ssl) " lines"))
) ; if
      )   ; progn
    (alert "\nThis object not line")
    )     ; if
  (princ)
  )       ; defun  

guys!
question:
how to identify a single line not duplicate.. and not lays in the same line...

       start point1  X----------X----------X---------------X  end point1
                                start point2   start point2

how to make in lisp routine...??
Title: Re: how to identify a line has a duplicate???
Post by: rainier on July 10, 2007, 01:50:51 AM
its close...

do u know the command overkill in autocad command... but a simplier one... i will add it to my routine...
Title: Re: how to identify a line has a duplicate???
Post by: Adesu on July 10, 2007, 02:06:16 AM
Quote
how to make in lisp routine...??
are you want lisp program or Autocad build in command ?  :angel:

its close...

do u know the command overkill in autocad command... but a simplier one... i will add it to my routine...
Title: Re: how to identify a line has a duplicate???
Post by: rainier on July 10, 2007, 02:11:47 AM
no, we make by our own code for find the duplicate lines or arcs...
Title: Re: how to identify a line has a duplicate???
Post by: Adesu on July 10, 2007, 02:24:04 AM
Post here your code, in order to others member would correction.

no, we make by our own code for find the duplicate lines or arcs...
Title: Re: how to identify a line has a duplicate???
Post by: rainier on July 10, 2007, 02:28:22 AM
i dont have the yet the code for finding the duplicate lines and arcs.. still finding one in the web..
Title: Re: how to identify a line has a duplicate???
Post by: hmspe on July 10, 2007, 11:00:58 AM
i dont have the yet the code for finding the duplicate lines and arcs.. still finding one in the web..

If you want to write your own function you could use the same approach as what is used in OVERKILL that resolves overlapping lines.  See the acet-overkill-resolve-lines2 and acet-overkill-resolve-arcs2 functions in overkillsup.lsp. 

If you intend to only use the lisp code in your office I'd recommend using OVERKILL rather than writing a new routine.  OVERKILL isn't perfect, but it has been available for a long time and it works fairly well.  OVERKILL.LSP is just an interface.  All the code to do the cleanup is in OVERKILL.SUP.  It is easy to link directly to the functions in OVERKILLSUP.LSP.

Martin
Title: Re: how to identify a line has a duplicate???
Post by: JohnK on July 10, 2007, 11:06:55 AM
guys!
question:
how to identify a single line not duplicate.. and not lays in the same line...

       start point1  X----------X----------X---------------X  end point1
                                start point2   start point2

how to make in lisp routine...??

math
Title: Re: how to identify a line has a duplicate???
Post by: CAB on July 10, 2007, 12:17:42 PM
http://www.theswamp.org/index.php?topic=8646.msg110536#msg110536