N
Nick Pirkl
Bob at ECCAD, wrote a routine for me that grabs all blocks in a drawing per
a list and inserts a different block per a second list with some attribute
values from the intial blocks. This is used to create a legend. I am
trying to figure out if I can append the final_list (each list item has 3
parts) prior to inserting the blocks and then sort the list per a master
block list. Something like:
(defun c:listtest ()
(setq list1 (list "l1" "l2" "l3" "l5" "l6" "l8" ))
(setq list2 (list "l4a"))
(setq master_list (list "l2" "l4" "l1" "l4a" "l3" "l5" "l8" "l6" "l7" ))
(setq new_list (append list1 list2))
;sort new_list per master_list format and create final list
)
This is where I get lost. How do I sort the new_list per the master format
"master_list" knowing that not all the items in the masterlist will be in
the new_list? I was trying to use vl-sort but can't seem to get it to work.
Nick
a list and inserts a different block per a second list with some attribute
values from the intial blocks. This is used to create a legend. I am
trying to figure out if I can append the final_list (each list item has 3
parts) prior to inserting the blocks and then sort the list per a master
block list. Something like:
(defun c:listtest ()
(setq list1 (list "l1" "l2" "l3" "l5" "l6" "l8" ))
(setq list2 (list "l4a"))
(setq master_list (list "l2" "l4" "l1" "l4a" "l3" "l5" "l8" "l6" "l7" ))
(setq new_list (append list1 list2))
;sort new_list per master_list format and create final list
)
This is where I get lost. How do I sort the new_list per the master format
"master_list" knowing that not all the items in the masterlist will be in
the new_list? I was trying to use vl-sort but can't seem to get it to work.
Nick