Hi 🙂
I' ve found several lists that draws points at object intersections from a object selection set.
Is there any lisp that would draw points at intersections of 2 selections sets objects?
An example would be the first selection of lines and a second selection of another lines. Thus only lines intersections between those 2 selections sets will have points drawn and not on lines intersections belonging to the same selection set.
Could anyone help please?
Many thanks in advance
Solved! Go to Solution.
Solved by Moshe-A. Go to Solution.
check this CROSS command
you need to define point type (like pdmode = 3)
this could not be done without (LM:intersections) function from great mr Lee Mac - thank you 🙏
enjoy
Moshe
;; 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 )
(if (and (vlax-method-applicable-p ob1 'intersectwith)
(vlax-method-applicable-p ob2 'intersectwith)
(setq lst (vlax-invoke ob1 'intersectwith ob2 mod))
)
(repeat (/ (length lst) 3)
(setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn)
lst (cdddr lst)
)
)
)
(reverse rtn)
)
(defun c:cross (/ OBJPATT ss0 ss1 AcDbEntity0 AcDbEntity1 pt)
(setq OBJPATT "*line,circle,arc,ray")
(if (and
(not (prompt "\nSelect group objects #1: "))
(setq ss0 (ssget (list (cons '0 OBJPATT))))
(not (prompt "\nSelect group objects #2: "))
(setq ss1 (ssget (list (cons '0 OBJPATT))))
)
(progn
(foreach AcDbEntity0 (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss0))))
(foreach AcDbEntity1 (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1))))
(foreach pt (LM:intersections AcDbEntity0 AcDbEntity1 acExtendNone)
(entmake (list '(0 . "POINT") (cons 10 (trans pt 1 0))))
)
); foreach
); foreach
); progn
); if
(princ)
); c:cross
I've attached a sample dwg. If I select all red lines (continuous and dashed) as first selection set and then all green lines as second selection set, it would be possible to get the common nodes between red lines and green lines intersection? Just the common nodes between those two selection sets?
Many thanks in advance
@cool.stuff wrote:
Get the intersection points between some structural elements and solids edges.
I'll get a sample. Thanks
what do you mean by solid edges? the lisp supports only curve lines not solid objects
note the lisp supports picking:
all kinds of line forms + arcs, circles, xline, rays
Can't find what you're looking for? Ask the community or share your knowledge.