Author Topic: INTERSECTION BETWEEN LINES POLYLINES AND LWPOLYLINES  (Read 2355 times)

0 Members and 1 Guest are viewing this topic.

DEVITG

  • Bull Frog
  • Posts: 480
INTERSECTION BETWEEN LINES POLYLINES AND LWPOLYLINES
« on: June 01, 2005, 07:10:29 PM »
With this code I can find the intersection point of a LINE with a POLYLINE or with a

POLYLINE .
Code: [Select]

;;*//*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

(defun in-pt (ent#a ent#b / inter-point   )
;;;(setq inter-point ())
   
  (setq inter-point
(vlax-safearray->list
  (vlax-variant-value
    (vla-intersectwith
      (vlax-ename->vla-object ent#a)
      (vlax-ename->vla-object ent#b)
      acExtendNone
    ) ;_end intersectwith
  ) ;_end vlax-variant-value
) ;_end vlax-safearray->list
  ) ;_setq
(setq list-puntos inter-point)
 
) ;_end defun
;;*//*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

(defun c:inters ( / list-puntos linea linea# polilinea polilinea#   )


(setq linea (entsel "\n   seleccione la linea"))
(setq linea# (car linea))
(setq polilinea (entsel "\n  Polilinea    :"))
(setq polilinea# (car polilinea))
(in-pt linea# polilinea#)
(prin1 list-puntos)
);_end defun inters

(c:inters)

When I select a LINE with a POLYLINE it return me a LIST with 6 values , the 3 coordinates twice , as follow
Quote
(185728.0 997670.0 9.2 185728.0 997670.0 9.2)

But if I choose a LINE with a LWPOLYLINE, I get this , as it is to be espected.
Quote
(185699.0 997715.0 0.0)

Trying to know what happen I move both the LINE and LWPOLYLINE pair to share their

intersection with the POLYLINE and LINE, so the 4 are intersected at the same point.

And when I choose the POLYLINE with the LWPOLYLINE , I got this values
 
Quote
(185728.0 997670.0 9.2 185728.0 997670.0 9.2)


What is happening??????
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
INTERSECTION BETWEEN LINES POLYLINES AND LWPOLYLINES
« Reply #1 on: June 01, 2005, 08:34:13 PM »
I just tested this and cannot duplicate the listing you show. Is it possible the the 2 objects intersect twice buy having a segement that overlaps? I saw your post in the Adesk newsgroup, but I don't have 2005 to try your drawing.

DEVITG

  • Bull Frog
  • Posts: 480
repeated points
« Reply #2 on: June 01, 2005, 10:29:14 PM »
Neither do I know , why.
So I take the first 3 , and all going weel.
maybe some one could explain.
 :oops:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10