kalai Posted July 3, 2012 Share Posted July 3, 2012 Hi the check with code (setq ss1 (ssget "W" pt1 pt2 '((8 . "FLOOR9"))) ) (setq ss1 (ssget "W" pt1 pt2 '((8 . "Floor9"))) ) Of the two which works. I have layer name caps in some dwg and small letters in some (as in code) how to write ssget statement common for all dwgs? Is there a possiblity? Help me . Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 3, 2012 Share Posted July 3, 2012 Have you tested the code at all? The Layer filter in the ssget filter list is not case-sensitive. Quote Link to comment Share on other sites More sharing options...
MSasu Posted July 3, 2012 Share Posted July 3, 2012 Both statements should work. Quote Link to comment Share on other sites More sharing options...
kalai Posted July 4, 2012 Author Share Posted July 4, 2012 Thanks to both Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 3, 2023 Share Posted June 3, 2023 How about text content, please? Ex: (setq ss1 (ssget "W" pt1 pt2 '((0. "TEXT")(1 . "FLOOR9")))) (setq ss1 (ssget "W" pt1 pt2 '((0. "TEXT")(1 . "Floor9")))) Can I select by text content without being case sensitive? Thank you! Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted June 3, 2023 Share Posted June 3, 2023 (setq ss1 (ssget "W" pt1 pt2 '((0. "TEXT")(1 . "FLOOR9,Floor9,floor9")))) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 3, 2023 Share Posted June 3, 2023 (ssget "W" pt1 pt2 '((0 . "TEXT") (1 . "[Ff][Ll][Oo][Oo][Rr]9"))) 2 Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 3, 2023 Share Posted June 3, 2023 1 hour ago, Lee Mac said: (ssget "W" pt1 pt2 '((0 . "TEXT") (1 . "[Ff][Ll][Oo][Oo][Rr]9"))) Thank you, Lee! It is totally what I need. Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 3, 2023 Share Posted June 3, 2023 4 hours ago, marko_ribar said: (setq ss1 (ssget "W" pt1 pt2 '((0. "TEXT")(1 . "FLOOR9,Floor9,floor9")))) Actually there are many cases. There are 5 letters, so there are 5^2 = 25 cases. Quote Link to comment Share on other sites More sharing options...
Steven P Posted June 3, 2023 Share Posted June 3, 2023 (edited) On 6/3/2023 at 2:17 PM, saunambon654 said: Actually there are many cases. There are 5 letters, so there are 5^2 = 25 cases. But in all practicality, only these 3 will ever be used, very unlikely to have "floOr9" for example. Lee Macs example covers all cases well Edited June 4, 2023 by Steven P 2 Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted June 3, 2023 Share Posted June 3, 2023 (edited) There are more than 25 cases... Combinations are included : 5!/2! = 60 cases... I think that Steven P is right - 25 cases... Actually I've found 16 cases... Here is what I founded : 1.floor 2.fLoor 3.flOor 4.floOr 5.flooR 6.Floor 7.FlOor 8.FloOr 9.FlooR 10.FLoor 11.FLoOr 12.FLooR 13.FLOor 14.FLOOr 15.FLOoR 16.FLOOR Edited June 3, 2023 by marko_ribar 1 Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted June 3, 2023 Share Posted June 3, 2023 I've changed my last post - I founded 16 cases, so it's not neither 25, nor 60... 1 Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 3, 2023 Share Posted June 3, 2023 1. floor 2. Floor 3. fLoor 4. flOor 5. floOr 6. flooR 7. FLoor 8. FlOor 9. FloOr 10. FlooR 11. fLOor 12. fLoOr 13. fLooR 14. flOOr 15. flOoR 16. floOR 17. FLOor 18. FLoOr 19. FLooR 20. fLOOr 21. fLOoR 22. fLoOR 23. flOOR 24. fLOOR 25. FLOOR Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 4, 2023 Share Posted June 4, 2023 5 hours ago, marko_ribar said: I've changed my last post - I founded 16 cases, so it's not neither 25, nor 60... Two choices per letter upper or lower case 5 letters 2^5 = 32 possible choices. either do it lee's way (best) or use the strcase funciton to convert everything to upper case and check that way. 3 Quote Link to comment Share on other sites More sharing options...
Steven P Posted June 4, 2023 Share Posted June 4, 2023 (edited) I want a go.... 10 hours ago, saunambon654 said: 23. flOOR 24. fLOOR 24.a FlOOR 24b. FLoOR.... 25. FLOOR See.... 25... Edited June 4, 2023 by Steven P 1 Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 4, 2023 Share Posted June 4, 2023 Here is my code, for anyone who needs. Thanks for Mr. Lee Mac. (defun CaseSensitivity (str1 / str2) (and str1 (= (type str1) 'STR) (progn (setq str2 "" i 1) (repeat (strlen str1) (if (and (= (strcase (substr str1 i 1));upper case (strcase (substr str1 i 1) T);lower case )) (setq str2 (strcat str2 (strcase (substr str1 i 1)))) (setq str2 (strcat str2 "[" (strcase (substr str1 i 1)) (strcase (substr str1 i 1) T) "]"))) (setq i (1+ i)) );repeat (setq str1 str2) );progn );and str1) ;(CaseSensitivity "floor9") => "[Ff][Ll][Oo][Oo][Rr]9" 1 Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 4, 2023 Share Posted June 4, 2023 Quote Link to comment Share on other sites More sharing options...
Steven P Posted June 4, 2023 Share Posted June 4, 2023 Lets do counting, I can do counting. Let's make it trickier and do binary counting, the first number in the list is the decimal equivalent. Dead handy if each character in a string has only 2 options. 1. 00000 2. 00001 3. 00010 4. 00011 5. 00100 6. 00101 7. 00110 8. 00111 9. 01000 10.01001 11.01010 12.01011 13.01100 14.01101 15.01110 16.01111 17.10000 18.10001 19.10010 20.10011 21.10100 22.10101 23.10110 24.10111 25.11000 26.11001 27.11010 28.11011 29.11100 30.11101 31.11110 32.11111 3 Quote Link to comment Share on other sites More sharing options...
saunambon654 Posted June 4, 2023 Share Posted June 4, 2023 1 hour ago, Steven P said: Lets do counting, I can do counting. Let's make it trickier and do binary counting, the first number in the list is the decimal equivalent. Dead handy if each character in a string has only 2 options. 1. 00000 2. 00001 3. 00010 4. 00011 5. 00100 6. 00101 7. 00110 8. 00111 9. 01000 10.01001 11.01010 12.01011 13.01100 14.01101 15.01110 16.01111 17.10000 18.10001 19.10010 20.10011 21.10100 22.10101 23.10110 24.10111 25.11000 26.11001 27.11010 28.11011 29.11100 30.11101 31.11110 32.11111 You're right, Steven. The calculation 2^5 = 32 correct. Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 4, 2023 Share Posted June 4, 2023 (edited) Nice @saunambon654 was thinking about doing the same thing. ;;----------------------------------------------------------------------------;; ;; Generate a text search that ignores Case Senesitivity. ;; saunambon654, Lee Mac, mhupp ;; https://www.cadtutor.net/forum/topic/39880-case-sensitivity/#comment-618863 ;; (ssget "X" (list '(0 . "TEXT") (cons 1 (IC "Floor9")))) ;; (ssget "X" '((0 . "TEXT") (1 . "[Ff][Ll][Oo][Oo][Rr]9"))) (defun IC (str1 / str2 i) (if (= (type str1) 'STR) (progn (setq str2 "" i 1) (repeat (strlen str1) (if (numberp (read (setq x (substr str1 i 1)))) (setq str2 (strcat str2 x)) (setq str2 (strcat str2 "[" (strcase x) (strcase x T) "]")) ) (setq i (1+ i)) ) ) ) str2 ) Edited June 4, 2023 by mhupp Quote Link to comment Share on other sites More sharing options...
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.