See the top rated post in this thread. Click here

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Help: Check overlap polylines

  1. #11
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,521
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    Quote Originally Posted by mhy3sx. View Post
    Hi Ed Jobe, I told you before, I don't use CIVIL3d

    Thanks
    That doesn't match what you said in post 4.
    Quote Originally Posted by mhy3sx. View Post
    Hi Ed Jobe, I am using Civil 3D

    Thanks
    C:> ED WORKING....


    LinkedIn

  2. #12
    Active Member
    Join Date
    2023-03
    Posts
    68
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    Hi Ed Jobe, I am NOT using Civil 3D. I will never use Civil 3D. I not a good program. My opinion !!!

  3. #13
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,521
    Login to Give a bone
    1

    Default Re: Help: Check overlap polylines

    Calm down. I don't care what program you use. It's just not what you made me believe at the beginning.

    I see what you are trying to do. You want to highlight bad data so that you can manually fix it. But this is going to be a lot of work. Have you considered automatically cleaning up the intersections? I believe that others have created code libraries already that would help you. GIS programs typically have tools built in for improving data quality, e.g. see this ArcMap function. You can try QGIS, it's free.

    If you want to use .NET, there are other GIS based libraries you can use. For example, NetTopologySuite.
    C:> ED WORKING....


    LinkedIn

  4. #14
    Active Member
    Join Date
    2023-03
    Posts
    68
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    Hi Ed Jobe, I understand that you are trying to help. I want to make very complicated filter test for overlap polylines. I am not in possition to explain full the idea because my English not allowed it. With few words the gov web page want to upload a dxf file for out topografic drawing . This drawing contains open and close overlap polylines , text , no blocks, and specific layer names. The problem is that we have a lot open close overlap polylines and for some reasong some times not overlap corectly and gives errors on the upload.

    I have some ideas how the errors can be marked

    1) with circles on the not overlap polyline (easy to see and fix the problem)
    2) another way is to give me or in txt file or comand line a list o coordinates (x,y) of the not overlap vertex
    3) Is the not overlap vertex is more than 2 (one next to other) can draw a polyline with red coloer and a global to mark the length with the problem.

    This code is close. I dont want to draw the green circles, draw only the red and only to not overlap vertex. I did same test and this part need a little work because some times mark with red circle overlap vertex. The fuzz will be 0 all the times. We need to have 0 tolerance , we need 100% overlap polylines.


    Code:
            (defun c:ccmrk2 (/ askreal is_intersect double->lst _groupbyfuzz centrum ; local functions
                             CMRK-FUZZ ss data ename0 ename1 pline0 pline1 rgn1 rgnUnion doubles points cross NotCross grp)
    
             (defun askreal (def)
              (initget 4)
              (if (not (setq ask (getreal (strcat "\ncmrk-fuzz <" (rtos def 2) ">: "))))
               (setq ask def)
               (setq def ask)
              )
             ); askreal
    
             (defun is_intersect (o0 o1 / r)
              (if
               (not
                 (vl-catch-all-error-p
                   (setq r (vl-catch-all-apply 'vlax-invoke (list o0 'IntersectWith o1 acExtendNone)))
                 )
               )
               r
              )
             ); is_intersect
    
             (defun double->lst (doubles / _index i lst)
              (setq _index (lambda (b inc) (+ (* b 3) inc)))
               
              (setq i -1)
              (repeat (/ (length doubles) 3)
               (setq i (1+ i)) 
               (setq lst (cons (list (nth (_index i 0) doubles) (nth (_index i 1) doubles) (nth (_index i 2) doubles)) lst))
              )
              
              lst
             ); double->lst
    
             ; by jonronp
             (defun _groupbyfuzz (l f / a b r)
              (while (car l)
               (setq a (car l))
               (setq b (vl-remove-if-not '(lambda (x) (equal a x f)) l))
               (foreach c (append (list a) b) (setq l (vl-remove c l)))
               (setq r (cons b r))
              )
              r
             ); _groupbyfuzz
    
             (defun centrum (g / l)
              (mapcar
               '(lambda (x y)
                 (/ (+ x y) 2) 
                )  
                (car
                  (setq l
                        (mapcar
                          '(lambda (f0)
                             (mapcar
                               '(lambda (f1)  
                                 (apply f0 (mapcar '(lambda (p) (f1 p)) g))
                                )
                               (list car cadr)
                             )
                           ); lambda
                          (list 'min 'max)
                        )
                  ); setq
                ); car
                (cadr l)
              ); mapcar
             ); centrum
    
             ; here start c:cmrk2
             (setvar "cmdecho" 0)
             (command "._undo" "_begin")
             (command "_layer" "_m" "Check_Mark" "_c" "90" "" "")
             (setq cross nil)
              
             (if (= (getvar "userr1") 0)
              (setq def-fuzz (setvar "userr1" 1e-2))
              (setq def-fuzz (getvar "userr1"))
             )
             
             (if (and
                   (setvar "userr1" (setq cmrk-fuzz (askreal def-fuzz)))
                   (setq ss (ssget '((0 . "lwpolyline") (70 . 1)))) ; select closed polylines
                 )
              (progn
               (setq data (mapcar '(lambda (ename) ename) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))))
               
               (foreach ename0 (reverse (cdr (reverse data)))
                (setq pline0 (vlax-ename->vla-object ename0))
                  
                (foreach ename1 (cdr (member ename0 data))
                 (setq pline1 (vlax-ename->vla-object ename1))
    
                 (if (setq doubles (is_intersect pline0 pline1))
                  (progn
                   (command ".region" "_si" (vlax-vla-object->ename (vla-copy pline0)))
                   (setq rgn0 (entlast))
                   
                   (command ".region" "_si" (vlax-vla-object->ename (vla-copy pline1))) 
                   (setq rgn1 (entlast)) 
    
                   (command "._union" rgn0 rgn1 "")  
                   (setq rgnUnion (vlax-ename->vla-object (entlast)))
    
                   (if (and
                         (not (equal (vla-get-area rgnUnion) (+ (vlax-curve-getarea pline0) (vlax-curve-getarea pline1)) 0.0))
                         (setq points (double->lst doubles))
                       )
                    (setq cross (append cross points))
                   ); if
                   ;;------------------------- Jose L. G. G. Code -----------------------------------------------
                   (setq points (vlax-invoke rgnUnion 'IntersectWith rgnUnion acExtendNone))
                   (setq points (double->lst points))
                   (setq NotCross (append NotCross points))
                   (setq NotCross
            	(vl-remove-if
            	 (function
            	  (lambda (a)
            	   (vl-some (function (lambda (b) (equal a b cmrk-fuzz))) cross) 
            	  )
            	 )
            	 NotCross
            	)
                   )			
                   ;;------------------------- Jose L. G. G. Code -----------------------------------------------
                   
                   (vla-delete rgnUnion)
                   (vlax-release-object rgnUnion)
                  ); progn
                 ); if
    
                 (vlax-release-object pline1)
                ); foreach
    
                (vlax-release-object pline0)
               ); foreach
    
               (foreach grp (_groupbyfuzz cross cmrk-fuzz)
                (entmake
                  (list
                   '(0 . "CIRCLE")
                   (cons '10 (centrum grp))
                   (cons '40 0.2)
                  )
                ); entmake
               ); foreach
               ;;------------------------- Jose L. G. G. Code -----------------------------------------------
               (foreach grp NotCross
                (entmake
                  (list
                   '(0 . "CIRCLE")
                   (cons '10  grp)
                   (cons '40 0.2)
                   (cons 62 1)
                  )
                ); entmake
               )
               ;;------------------------- Jose L. G. G. Code -----------------------------------------------
              ); progn
             ); if
    
             (command "._undo" "_end")
             (setvar "cmdecho" 0)
              
             (princ)
            ); c:ccmrk2
    
        Reply With Quote Reply With Quote

    I know that this is something very difficult.

    Thanks

  5. #15
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,521
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    I'm trying to understand your geometry and your descriptions. I've modified your images from earlier posts to ask you some questions. In the image below, are you trying to merge the polylines so that all vertices align like the red lines show?

    test.jpg

    In the next image, how do you determine which polyline is correct and which is the one that needs fixing? Is ABCDEFG the correct polygon? Is ABCJ the bad polygon? If the bad polygon is AJCDHFG, then moving J to B and H to E will produce duplicate polygons. Is that what you want? I think that when you say polylines, you actually mean polygons. I also think that you don't mean you want them to OVERLAP, but that the vertices should be coincident. When lines overlap, they cross over each other and do not meet. But you should avoid having duplicate polygons. That would mean that you have duplicate parcels.

    1.jpg

    Can you attach a sample file? What format is the file supplied by your government? What government is this?
    C:> ED WORKING....


    LinkedIn

  6. #16
    Active Member
    Join Date
    2023-03
    Posts
    68
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    This is my last job I upload. This is the dxf I upload. Here will see all the overlap polylines. This dxf upload correct, but I have a lot of problems to fix with the polylines before pass the system upload test. I upload it as dwg because as dxf I have problem in the forum
    Attached Files Attached Files
    • File Type: dwg 1.dwg (49.1 KB, 5 views)

  7. #17
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,118
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    Have you tried the OVERKILL command?
    AutomateCAD

  8. #18
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,521
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    That's fine, but can you answer my questions? What rules define what is good and what is bad? Does one of the layers represent the good polygons and all the other layers need to match the good layer? You can't create a logical program if you don't have a set of rules.

    What is your native language?
    C:> ED WORKING....


    LinkedIn

  9. #19
    Active Member
    Join Date
    2023-03
    Posts
    68
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    for example all DGM_PROP_FINAL and TOPO_PROP_NEW will be overlap 100%. It is one of the rules. Or another crasy rule is that the LINE_XM polyline will stop when crossing another LINE_XM like t he example !!!

  10. #20
    Active Member
    Join Date
    2023-03
    Posts
    68
    Login to Give a bone
    0

    Default Re: Help: Check overlap polylines

    Hi Peter. Overkill command delete overlap polylines. I need them , I dont want to delete them or clean my drawing. I want to check the 100% overlap of the polylines and find some vertex not overlap.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Erase polylines and lines overlap.
    By Martinsb in forum AutoLISP
    Replies: 2
    Last Post: 2009-11-24, 02:10 PM
  2. How to change LW PolyLines to 2D PolyLines
    By Lions60 in forum AutoLISP
    Replies: 10
    Last Post: 2007-07-13, 05:58 PM
  3. How to convert 3D Polylines to 2D Polylines
    By GreyHippo in forum AutoLISP
    Replies: 16
    Last Post: 2007-01-04, 05:32 PM
  4. AutoCAD polylines to 3d polylines
    By neil_morrish in forum AutoCAD General
    Replies: 5
    Last Post: 2004-07-22, 10:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •