(DEFUN xingint (/ pl_ss_len cur_la count line_ss line_ss_len pline_head pline_v pline_la 1st_lname frozen_list nxt_lname next_ent test_ename test_ent pt_of_inters seg_list seg_index pline_list raw_list sort_list ) (SETQ cur_la (GETVAR "clayer") count 0 line_ss (SSGET "X" '((0 . "LINE"))) line_ss_len (SSLENGTH line_ss) entint_lst (LIST (CONS -4 "") ) ;_ end of LIST ) ;_ end of APPEND ) ;_ end of SETQ (SETQ entint_lst (LIST (CONS -4 "") ) ;_ end of LIST ) ;_ end of SETQ ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of IF (SETQ count (1+ count)) ) ;_ end of WHILE (SETQ count 0) (IF raw_list (PROGN (SETQ sort_list nil) (raw_sort raw_list plv_1) ;;;IF there is a raw_list, sort it here. (SETQ pline_list (APPEND pline_list sort_list (LIST plv_2)) raw_list nil ) ;_ end of SETQ ;;;ADD sorted segment intersections list and plv_2 to pline_list ) ;_ end of PROGN (SETQ pline_list (APPEND pline_list (LIST plv_2))) ;;;ADD plv_2 to pline_list. ) ;_ end of IF (SETQ step_ndx (1+ step_ndx)) ) ;_ end of WHILE (SETQ entint_lst (APPEND entint_lst (LIST (CONS -4 "OR>")))) ;;;now create a new pline from pline_list (ENTMAKE (LIST (CONS 0 "POLYLINE") (CONS 8 cur_la) (CONS 66 1) (CONS 70 128) (CONS 10 (LIST 0 0 0)) ) ;_ end of list ) ;_ end of entmake (FOREACH n pline_list (IF n (ENTMAKE (LIST (CONS 0 "VERTEX") (CONS 10 n))) ) ;_ end of if ) ;_ end of FOREACH (ENTMAKE (LIST (CONS 0 "SEQEND"))) (PRINC) (SETQ PLSAV PLINE_LIST) (PRINC) ) ;_ end of DEFUN (DEFUN raw_sort (raw_list plv_1 / sort_len sort_index) (SETQ sort_list nil) (FOREACH n raw_list (IF sort_list (PROGN (SETQ sort_len (LENGTH sort_list) sort_index (1- sort_len) ) ;_ end of SETQ (WHILE (>= sort_index 0) (IF (> (DISTANCE plv_1 n) (DISTANCE plv_1 (NTH sort_index sort_list)) ;_ end of DISTANCE ) ;_ end of > (IF (= sort_index (1- sort_len)) (SETQ sort_list (APPEND sort_list (LIST n)) sort_index -1 ) ;_ end of SETQ (SETQ sort_list (APPEND (REVERSE (MEMBER (NTH sort_index sort_list) (REVERSE sort_list) ) ;_ end of member ) ;_ end of REVERSE ;;;partial sort_list from nth 0 to sort_index (LIST n) (CDR (MEMBER (NTH sort_index sort_list) sort_list ) ;_ end of member ) ;_ end of CDR ;;;partial sort_list from nth (1+ sort_index) to (1- sort_len) ) ;_ end of APPEND sort_index -1 ) ;_ end of SETQ ) ;_ end of if (IF (= sort_index 0) (SETQ sort_list (APPEND (LIST n) sort_list) sort_index -1 ) ;_ end of setq (SETQ sort_index (1- sort_index)) ) ;_ end of if ) ;_ end of IF ) ;_ end of WHILE ) ;_ end of PROGN (SETQ sort_list (LIST n)) ) ;_ end of IF ) ;_ end of FOREACH (PRINC) ) ;_ end of DEFUN ;|«ViLL© FORMAT OPTIONS...» (72 2 20 2 T "end of " 60 9 2 0 0 T nil nil T) ***Don't add text below the comment!***|; ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;