@cool.stuff ,
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