Aftertouch Posted November 28, 2022 Posted November 28, 2022 Hi all, got myself a tricky one... I got a list, with an order, this is just an example.. total list is over 150 items long (setq ordertable (list "*STONE-*" "*EARTH-*" "*PIPES-*" ) ) I got 2 symbols: (setq enlay "TEST-STONE-NEW") (setq enlaydouble "DEFAULT-PIPES-NEW") I got a lot of double lines, i want to 'overkill' them, but keep the layer, highest in the ordertable... So i made this code: (if (< (vl-position enlay ordertable)(vl-position enlaydouble ordertable)) (entdel enseldouble) (entdel ensel) ) This works, when the ordertable is not having any wildcards. I cannot get this to work, with it accepting wildcards.... Any suggestions? So... i need to determine with of the 2 items to delete, based on this position in the ordertable... with usage of wildcards... Thanks in advance! Quote
Tsuky Posted November 28, 2022 Posted November 28, 2022 Perhaps! (setq ordertable (list "*STONE-*" "*EARTH-*" "*PIPES-*" ) ) (setq enlay "TEST-STONE-NEW") (setq enlaydouble "DEFAULT-PIPES-NEW") (if (< (car (vl-remove nil (mapcar '(lambda (x) (if (wcmatch enlay x) (vl-position x ordertable))) ordertable))) (car (vl-remove nil (mapcar '(lambda (x) (if (wcmatch enlaydouble x) (vl-position x ordertable))) ordertable))) ) (print "(entdel enseldouble)") (print "(entdel ensel)") )(prin1) 1 Quote
Aftertouch Posted November 28, 2022 Author Posted November 28, 2022 @Tsuky you nailed it! Thanks alot! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.