- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
With my basic knowledge of Lisp and a lot of searching in forums, I have managed to extract the vertices of a polyline with curves - start of curve, end of curve, etc. I have exported this to a CSV, but I am struggling to extract the projected vertex of the intersection of the tangents that form the curve.
I have tried using the "Inters" function but I am not able to make it work. Here's an image of what I have achieved and what I desire to achieve.
I would appreciate any guidance on this matter. Sorry for my English, it's not my strong suit.
(defun c:vtc (/ ent obj coords i ptActual numVerts tipoEnt)
(vl-load-com)
; Seleccionar polilínea
(setq ent (car (entsel "\nSelecciona una polilínea: ")))
(if (not ent) (exit))
; Obtener objeto VLA de la entidad
(setq obj (vlax-ename->vla-object ent))
(setq tipoEnt (vlax-get-property obj 'ObjectName))
; Verificar si es una polilínea
(if (not (member tipoEnt '("AcDb2dPolyline" "AcDbPolyline")))
(progn
(princ "\nLa entidad seleccionada no es una polilínea.")
(exit)
)
)
; Obtener coordenadas de la polilínea
(setq coords (vlax-safearray->list (vlax-variant-value (vlax-get-property obj 'Coordinates))))
(setq numVerts (/ (length coords) 2)) ; Cada vértice tiene dos coordenadas (x, y)
; Etiquetar cada vértice
(setq i 0)
(while (< i numVerts)
(setq ptActual (list (nth (* 2 i) coords) (nth (1+ (* 2 i)) coords)))
(etiquetarPunto ptActual i)
(setq i (1+ i))
)
(princ)
)
(defun etiquetarPunto (punto index / alturaTexto)
(setq alturaTexto 2.5)
(command "_POINT" punto)
(command "_TEXT" punto alturaTexto 0 (strcat "V-" (itoa index)))
)
(princ)
Solved! Go to Solution.