Hi, I am still in the process of learning AUTOLISP, and would like to edit some script. Recently I asked a question on autodesk and someone gave me this code which I am grateful for. but I have been trying to edit it for the past few days.
basically it selects a polyline, finds intersection points with the polyline and selected objects, then places text at points of intersection
the problem is
1- many times the polyline intersects twice with an object, so it places two text objects
2- the text should be at the geometric center of the polyline or block if necessary to transform it.
i really have tried and it was too complex for my level .. any help would be truly appreciated.
(defun c:IntersNumbering
( / LM:intersections p s l o z e
)
;; Intersections - Lee Mac ;; Returns a list of all points of intersection between two objects ;; for the given intersection mode.
;; ob1,ob2 - [vla] VLA-Objects ;; mod - [int] acextendoption enum of intersectwith method
(defun LM:intersections
( ob1 ob2 mod
/ lst rtn
)
)
)
; ======================================================================================================
);car
);setq
(princ "Select intersecting polylines and blocks, ")
(setq s
(ssget '
((0 .
"LWPOLYLINE,LINE,INSERT")))) (*in-n*)))
);and
l
(append (LM:intersections o e acextendnone
) l
))))
)