TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cadplayer on October 10, 2012, 07:22:01 AM
-
Hello all!
I wish to can get all polyline vertex- and intersection points on line from 3dPolyline.
First I ask the polyline if it have "VERTEX"
(setq en (car (entsel "\nSelect Polyline ")))
(while (and (setq en (entnext en))
(setq edata (entget en))
(=(cdr(assoc 0 edata))"VERTEX")
)
)
)
Intersection points from terrain points (Gpt) to my ployline (vl-en) I get
(defun _sect ()
(vlax-curve-getClosestPointTo vl-en Gpt)
)
The vertex points I get with
(defun _polyV (en /)
(cdr (assoc 10 edata))
)
My Question: How can I get all points in a order
(pList '((vertex1 x y z) (vertex2 x y z) (section1 x y z) (section2 x y z) (vertex3 x y z) (section3 x y z) (vertex4 x y z) (section4 x y z)....))
-
Just a guess...
(append vertex_list section_list
) (<
)
)
)
)
-
thanks that was answer of my question
-
Be aware that vl-sort may remove duplicate data ... so you may have issues if you expect all points will be retained.
-
That is okay.
Now I have a problem how I build function if I have diffrent lists in section_list and vertex_list
but alway is coordinates in second position
section_list
(("S" 152747.0 6.4086e+006 72.3828) ("S" 152752.0 6.4086e+006 72.3091) ("S" 152770.0 6.40863e+006 72.1742) ("S" 152774.0 6.40863e+006 72.1143) ("S" 152786.0 6.40866e+006 71.9021))
vertex_list
(("S" 152747.0 6.4086e+006 72.3828 "A" -4.19779) ("S" 152752.0 6.4086e+006 72.3091 "A" -1.95332) ("S" 152770.0 6.40863e+006 72.1742 "A" 0.722905) ("S" 152774.0 6.40863e+006 72.1143 "A" -2.4611) ("S" 152786.0 6.40866e+006 71.9021 "A" 9.32426))
I try it with a sub-function but finally I donīt know to get a
(defun xxx (y)
(foreach L y
(setq D (vlax-curve-GetDistAtPoint vl-en (list (cadr L) (caddr L) (cadddr L))))
(setq liste (cons D liste))
)
)
vl-sort (xxx section_list) '<
vl-sort (xxx vertex_list) '<
So I get two list with distance
But I want one list with "S"coordinates and "A"area sort by distance D
Can somebody help me.
-
This?
-
Thanks Lee that I was not trying to do.
-
Thanks Lee that I was not trying to do.
Did I misunderstand? :?
-
I'm confused. :-o
-
I'm confused. :-o
Hi, I'm phred.
-
Sorry my English is very bad, I mean it was answer to my problem. It was not easy to find a solution and Lee was very fast. Thanks for helping