;; | --------------------------------------------------------------------------- ;; | LI_StreamItem ;; | --------------------------------------------------------------------------- ;; | Function : Retrieves a stream of list items starting from the specified DXF ;; | code ;; | Arguments: 'Lst' - The List to process ;; | 'DxfCode' - The DXF Code to search ;; | Returns : A list of sublists, each of which starts from the 'DxfCode' ;; | Update : September 16, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun LI_StreamList (Lst Code / Lst1 Lst2 tmp InLst ) (setq Lst1 '() Lst2 '() InLst nil ) (foreach tmp Lst (if (= (car tmp) Code) (progn (setq InLst T) (if Lst2 (setq Lst1 (cons (reverse Lst2) Lst1)) ) (setq Lst2 (list tmp)) ) (progn (if InLst (setq Lst2 (cons tmp Lst2)) ) )) ) (if (and InLst Lst2) (setq Lst1 (cons (reverse Lst2) Lst1)) ) Lst1 )