X11start Posted October 4, 2023 Posted October 4, 2023 A very useful function is to extract a number or string (without numbers) from a longer string. This is taken care of by the RIPCAR and RIPNUM functions; but to these I wanted to add one that would split the string for me by separating numbers (integers or real) from strings and put everything in a list. I found a way .... but I am sure you experts, with 4 VL-xx commands will achieve the same thing much more efficiently! How can I improve the RIPLST function? RipCarNum.lsp Quote
Emmanuel Delay Posted October 4, 2023 Posted October 4, 2023 So, 1 thing it doesn't account for is notation like: 17.62E+6 (meaning 17620000). Quite common in Autocad for big coordinates. I should try making this function. I need it myself Quote
Lee Mac Posted October 4, 2023 Posted October 4, 2023 You might want to consider my Split String function, as part of my Alphanumerical Sort function, previously posted here. Quote
X11start Posted October 4, 2023 Author Posted October 4, 2023 ... I use it to do a sorting of codes consisting of STRING+NUMBER: Needing to sort '("AA02" "AA10" "AA01") with alphanumeric sorting I would erroneously get ...'("AA01" "AA10" "AA02"), instead using RIPLST for each string, I get '("AA" 2) which I transform to "AA000002", while '("AA" 10) becomes "AA000010": I add zeros and transform it back to string. As a result, the alphanumeric sorting becomes correct, after removing the previously added zeros: '("AA01" "AA02" "AA10"). ORDINE.lsp Quote
X11start Posted October 4, 2023 Author Posted October 4, 2023 Lee Mac you are amazing: your routines contemplate every possible problem! Thank you for existing! 1 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.