Jump to content

Recommended Posts

Posted

Dear all,

i need a lisp that will check ,end of polyline is snapping with any polygon aren't ?

in my working drawing they need to snap polyline end with any Polygons. it may be some times at intersection and some times mid of the polygons.

so please help me with a lisp. that will check whether end of the polyline is snapping to the polygon aren't.

i have so many polylines and polygons. its taking very long time to check whether all the  polyline snapping  to the polygons arent . plz help me. thanks 

snapping.dwg

Posted

If I understand you correctly you want to identify polylines that do not have a block inserted at their start and end point. This is possible. Sadly one of your blocks has been badly designed: The insertion point of the FOC block seems totally illogical. The code below works for the other blocks.

(defun KGA_Conv_Pickset_To_ObjectList (ss / i ret)
  (if ss
    (repeat (setq i (sslength ss))
      (setq ret (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) ret))
    )
  )
)

(defun c:Test ( / end polyLst ptLst ss ssOut sta)
  (if (setq ss (ssget "_X" '((0 . "INSERT,LWPOLYLINE"))))
    (progn
      (foreach obj (KGA_Conv_Pickset_To_ObjectList ss)
        (if (= "AcDbBlockReference" (vla-get-objectname obj))
          (setq ptLst (cons (vlax-get obj 'insertionpoint) ptLst))
          (setq polyLst (cons obj polyLst))
        )
      )
      (setq ssOut (ssadd))
      (foreach poly polyLst
        (setq sta (vlax-curve-getstartpoint poly))
        (setq end (vlax-curve-getendpoint poly))
        (if
          (not
            (and
              (vl-some '(lambda (pt) (equal pt sta 1e-8)) ptLst)
              (vl-some '(lambda (pt) (equal pt end 1e-8)) ptLst)
            )
          )
          (ssadd (vlax-vla-object->ename poly) ssOut)
        )
      )
      (sssetfirst nil ssOut)
    )
  )
  (princ)
)

 

  • Like 1
  • 10 months later...
Posted

Hi,

Good day,I am using Autocad 2018,I need lisp for two main things 

1) I want to check the continuty check for multiple layer should be snapping with muliple layers e.

Example:a) one electrical cable should be snap with other electrical cable or Junction box or fence or lamp post and etc.
     b) if pipe line need to snap with other pipe line with T BEND or fence or Pipe rack or water well and etc.

2)If i want to select one feature then need to select all the above ground layer and under ground layer with all the snaping points.

 

Thanks in advance


sekhar J

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