;; | ---------------------------------------------------------------------------- ;; | GE_MarkLengths ;; | ---------------------------------------------------------------------------- ;; | Function : Marks a series of lengths defined by a list of lengths along a ;; | line defined by 'vlist' points ;; | Arguments: ;; | 'vlist' - List of points along which to apply length pattern ;; | Overloaded argument, can also be an curve object ;; | ename. ;; | 'LenLst' - List of lengths to apply along the line ;; | 'Closed' - Boolean flag which denotes if the list of points is ;; | closed or not. ;; | Action : Returns a list of points with the specified lengths marked along ;; | it. ;; | Updated : November 30, 2003 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_MarkLengths (vlist LenLst Closed / Seg SegLst oname _LenLst d param pt pt1 pt2 len LastPtLen NextLen dX More vlist1 ang First CurveLen ) (setq vlist1 '()) (cond ((= (type vlist) 'ENAME) (setq oname (vlax-ename->vla-object vlist) param (vlax-curve-getEndParam oname) ; End parameter CurveLen (vlax-curve-getDistAtParam oname param) _LenLst LenLst More T d 0.0 pt (vlax-curve-getStartPoint oname) vlist1 (list pt) ) (while More (setq d (+ d (car _LenLst)) _LenLst (cdr _LenLst) ) (if (not _LenLst) (setq _LenLst LenLst) ) (if (<= d CurveLen) (progn (setq param (vlax-curve-getParamAtDist oname d)) (if param (progn (setq pt (vlax-curve-getPointAtParam oname param)) (if pt (setq vlist1 (cons pt vlist1)) ) )) ) (setq More nil) ) ) (setq pt (vlax-curve-getEndPoint oname) ; End point vlist1 (cons pt vlist1) vlist1 (reverse vlist1) vlist1 (nth 0 (GE_DistWeed vlist1 0.0001 "Slope")) ) (vlax-release-object oname) ) ((listp vlist) (setq SegLst (GE_GetSegmentPoints vlist Closed)) (if SegLst (progn (setq LastPtLen 0.0 dX 0.0 _LenLst LenLst vlist1 (list (car vlist)) ) (foreach Seg SegLst (setq pt1 (nth 0 Seg) pt2 (nth 1 Seg) ang (angle pt1 pt2) len (distance pt1 pt2) More T d 0.0 pt pt1 First T ) (while More (setq NextLen (car _LenLst)) (if NextLen (setq _LenLst (cdr _LenLst)) (setq _LenLst LenLst NextLen (car _LenLst) _LenLst (cdr _LenLst) ) ) (if First (setq d (+ d (- NextLen dX))) (setq d (+ d NextLen)) ) (if (< d len) (progn (setq LastPtLen (+ LastPtLen NextLen)) (if First (setq pt (polar pt ang (- NextLen dX))) (setq pt (polar pt ang NextLen)) ) (setq vlist1 (cons pt vlist1)) ) (setq _LenLst (cons NextLen _LenLst) dX (- len (- d NextLen)) More nil )) (setq First nil) ) ) (setq vlist1 (cons pt2 vlist1) vlist1 (reverse vlist1) vlist1 (nth 0 (GE_DistWeed vlist1 0.0001 "Slope")) ) )) ) ) vlist1 )