Irne, the problem with finding intersections with helix is that it's never planar even if you enter height 0.0...
So I've made routines that will segment helix or any other 2D object and make sure z value of segmented spline points are 0.0 if they are near 0.0 (0.0 < z value < 1e-4)... Use these first routine on your helix, and second on your circle and newly created spline from helix (green color)... You should get results...
Regards,
M.R.
(defun c:seg ( / APERT CLD CMDE ENTL ENTLAY ENTLIST ENTN K1 K1SEL K2 K2SEL KRPT LAY LAYOB N NC NN OSM PAUSE POCPT PT PT0 PTLIST PTLISTA PTN PTSEL PTSELRED PTSLEN SS )
(setq osm (getvar 'osmode))
(setq cmde (getvar 'cmdecho))
(setq apert (getvar 'aperture))
(terpri)
(prompt "\nSegmenting all 3D lines, plylines and curves with segmented SPLINE")
(prompt "\nENTER to continue")
(terpri)
(textpage)
(command "\\")
(setvar 'osmode 0)
(setvar 'cmdecho 0)
(setvar 'aperture 1)
(prompt "\nSelect object for segmentation")
(setq ss (ssget "_+.:E:S"))
(setq n (getint "\nInput number of segmentations : "))
(initget 1 "Open Closed")
(setq cld (getkword "\nIs selected object (Open / Closed) : "))
(if (= cld "Open")(setq nc (+ n 1)))
(if (= cld "Closed")(setq nc n))
(setq lay (getvar 'clayer))
(if (= (tblsearch "layer" "new") nil)
(command "-layer" "n" "new" "")
(progn
(prompt "\nAborting: Delete Layer (new) witch is used by this routine, press ENTER")
(command pause)
(exit)
)
)
(setvar 'clayer "new")
(command "divide" ss n)
(setq ptsel (ssget "X" '((0 . "POINT") (8 . "new")) ))
(setq entn (ssname ss 0))
(setq entl (entget entn))
(setq entlay (assoc 8 entl))
(setq layob (cdr entlay))
(setvar 'clayer lay)
(if (= cld "Open")
(progn
(setq k1 (ssname ptsel 0))
(setq k1sel (ssadd))
(ssadd k1 k1sel)
(setq k2 (ssname ptsel (- (sslength ptsel) 1)))
(setq k2sel (ssadd))
(ssadd k2 k2sel)
(setvar 'osmode 1)
(prompt "\nStarting point is near displayed one - press ENTER")
(sssetfirst k1sel k1sel)
(command "regen")
(command "\\")
(prompt "\nNow pick starting point according to previously displayed near one : ")
(command "point" "\\")
(setq pocpt (entlast))
(prompt "\nEnding point is near displayed one - press ENTER")
(sssetfirst k2sel k2sel)
(command "regen")
(command "\\")
(prompt "\nNow pick ending point according to previously displayed near one : ")
(command "point" "\\")
(setq krpt (entlast))
(setq ptselred (ssadd))
(ssadd pocpt ptselred)
(setq ptslen (sslength ptsel))
(setq nn -1)
(repeat ptslen
(setq nn (+ 1 nn))
(setq entn (ssname ptsel nn))
(ssadd entn ptselred)
)
(ssadd krpt ptselred)
)
)
(setq nn -1)
(repeat nc
(setq nn (+ 1 nn))
(if (eq cld "Closed")(setq ptselred ptsel) ())
(setq entn (ssname ptselred nn))
(setq entlist (entget entn))
(setq entl (assoc 10 entlist))
(setq pt (cdr entl))
(if (and (= cld "Closed")(= nn 0)) (setq pt0 pt))
(entdel entn)
(setq ptlista (cons pt ptlista))
)
(if (= cld "Closed")
(setq ptlista (cons pt0 ptlista))
)
(mapcar '(lambda (x) (if (< 0 (caddr x) 1e-4) (progn (setq ptn (list (car x) (cadr x) 0.0)) (setq ptlist (cons ptn ptlist))) (setq ptlist (cons x ptlist)) ) ) ptlista)
(setvar 'osmode 0)
(command "._spline")
(foreach ptn ptlist
(command ptn)
)
(command "" "" "")
(command "change" "l" "" "p" "c" "green" "")
(command "-purge" "la" "new" "n")
(setvar 'osmode osm)
(setvar 'cmdecho cmde)
(setvar 'aperture apert)
(princ)
)
;;-----------------=={ Get Intersections }==------------------;;
;; ;;
;; Returns a list of all points of intersection between ;;
;; two objects ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; obj1, obj2 - VLA-Objects ;;
;;------------------------------------------------------------;;
;; Returns: List of intersection points, or nil ;;
;;------------------------------------------------------------;;
(defun LM:GetIntersections ( obj1 obj2 )
(LM:GroupByNum (vlax-invoke obj1 'IntersectWith obj2 acExtendNone) 3)
)
;;-----------------=={ Group by Number }==--------------------;;
;; ;;
;; Groups a list into a list of lists, each of length 'n' ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; l - List to process ;;
;; n - Number of elements by which to group the list ;;
;;------------------------------------------------------------;;
;; Returns: List of lists, each of length 'n' ;;
;;------------------------------------------------------------;;
(defun LM:GroupByNum ( l n / r)
(if l
(cons
(reverse (repeat n (setq r (cons (car l) r) l (cdr l)) r))
(LM:GroupByNum l n)
)
)
)
---------------------------------------------------------------
(defun c:interse1e2 ( / e1 e2 ) (vl-load-com)
(if
(and
(setq e1 (car (entsel "\nSelect First Object: ")))
(setq e2 (car (entsel "\nSelect Second Object: ")))
)
(progn
(terpri)
(princ (LM:GetIntersections (vlax-ename->vla-object e1) (vlax-ename->vla-object e2)))
)
)
(princ)
)