TheZman Posted November 11, 2010 Share Posted November 11, 2010 (edited) Hello, I have a dwg that I use to find roads on in our jurisdiction area when ever people in the field need to find a road, and cant read a map. I use find to find the road text on the dwg. however the annoying thing is the rotates the entire dwg so the text is horizontal. Most of the time the text is not at rotation 0 its rotated so it will fit on the road. When the entire dwg gets rotated it makes it very difficult to give directions. Is there some setting somewhere that I can uncheck to make it not do that. Thanks for your help. EDIT: Oh yes, I am using AutoCAD 2009. Edited November 11, 2010 by TheZman Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 11, 2010 Share Posted November 11, 2010 I really hate what they did with FIND in 2009 and up. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 11, 2010 Share Posted November 11, 2010 (edited) Oh! That does suck! I've only used find, for replacing text strings in the past. Try this: (defun c:FIND2 (/ s ss) (if (and (setq s (getstring "\n >> Enter Text to Find: ")) (setq ss (ssget "_x" (list '(0 . "TEXT,MTEXT") (cons 1 (strcat "*" s "*")))))) (command "._zoom" "_object" (ssname ss 0) "")) (prompt "\n <!> Matching Text Not Found <!> ")) Edit: Added the failure prompt. Hope this helps! Edited November 11, 2010 by BlackBox Removed (vl-load-com)... first time that was necessary! lol Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 11, 2010 Share Posted November 11, 2010 Oh! That does suck! I've only used find, for replacing text strings in the past. Try this: (defun c:FIND2 (/ s ss) (if (and (setq s (getstring "\n >> Enter Text to Find: ")) (setq ss (ssget "_x" (list '(0 . "TEXT,MTEXT") (cons 1 (strcat "*" s "*")))))) (command "._zoom" "_object" (ssname ss 0) ""))) Hope this helps! DXF 1 is case sensitive and check your and statement (hint: getstring return). Quote Link to comment Share on other sites More sharing options...
TheZman Posted November 11, 2010 Author Share Posted November 11, 2010 Oh programming, is there anything you cannot do? This helps a lot. The only problem I see is that it can only find one whole word. So like "1st" it will find only one of them but there are others such as "NW 1st Ave" "NW 1st Ct." "SE 1st Ave" and so on. However this gives me something to fiddle with the rest of the day. Thank you. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 11, 2010 Share Posted November 11, 2010 DXF 1 is case sensitive and check your and statement (hint: getstring return). Oh programming, is there anything you cannot do? This helps a lot. The only problem I see is that it can only find one whole word. So like "1st" it will find only one of them but there are others such as "NW 1st Ave" "NW 1st Ct." "SE 1st Ave" and so on. However this gives me something to fiddle with the rest of the day. Thank you. Disaster averted: (defun c:FIND2 (/ s ss l) (if (and (/= nil (setq s (getstring "\n >> Enter Text to Find: "))) (setq ss (ssget "_x" (list '(0 . "TEXT,MTEXT") '(-4 . "<OR") (cons 1 (strcase (strcat "*" s "*"))) (cons 1 (strcase (strcat "*" s "*") T)) '(-4 . "OR>"))))) (if (< 1 (setq l (sslength ss))) ((lambda (i / ok e) (prompt (strcat "\n >> There were " (rtos l 2 0) " Matches Found... ")) (setq ok "NO") (while (and (/= "YES" ok) (setq e (ssname ss (setq i (1+ i))))) (command "._zoom" "_object" e "") (initget 7 "YES NO") (setq ok (getkword "\n >> Is this the right one? [Yes/No]: ")))) -1) (command "._zoom" "_object" (ssname ss 0) "")) (prompt "\n <!> Matching Text Not Found <!> ")) (princ)) This revision will also handle multiple matches. Edit: Fiddle away, Zman... Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 11, 2010 Share Posted November 11, 2010 What about "PiZzA"? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 11, 2010 Share Posted November 11, 2010 What about "PiZzA"? Found it without a problem: Command: find2 >> Enter Text to Find: z >> There were 8 Matches Found... ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: n ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: n ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: y Command: D@mnit Alan, now I'm hungry for pizza! Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 11, 2010 Share Posted November 11, 2010 Found it without a problem: Command: find2 >> Enter Text to Find: z >> There were 8 Matches Found... ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: n ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: n ._zoom Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _object Select objects: 1 found Select objects: Command: >> Is this the right one? [Yes/No]: y Command: [ATTACH]24539[/ATTACH] D@mnit Alan, now I'm hungry for pizza! Hmph. I could have sworn you couldn't pull that off with SSGET filtering. I stand corrected. Out of curiosity, try (cons 1 (strcat "*" (strcase s) "*,*" (strcase s T) "*")) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 11, 2010 Share Posted November 11, 2010 Hmph. I could have sworn you couldn't pull that off with SSGET filtering. I stand corrected. Out of curiosity, try (cons 1 (strcat "*" (strcase s) "*,*" (strcase s T) "*")) Yep, that works too. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 11, 2010 Share Posted November 11, 2010 Hmph. I could have sworn you couldn't pull that off with SSGET filtering. I stand corrected. ... And might I just add that today is being marked down in my calendar , and I kind of think you should be proud of that. Edit: You wouldn't be 'proud of that' enough to buy me a pizza, would you...? I mean it's your fault, I'm hungry for pizza. 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.