grifflee Posted August 15, 2013 Share Posted August 15, 2013 Hi I'm looking for some help regarding Lisp Routines. I process a lot of Topographical surveys using AutoCAD. All of the text sits horizontally to the line, so I have to rotate each bit of text to the polyline. As you can imagine this can be very time consuming. I have come across a Lisp routine that allows me to align text to a polyline, but you have to select each part of the polyline, then the relative text. I've attached some screen dumps, to try and make my point a little more clear. Does anyone know of a routine, so that you could select a polyline, then all text that you select would rotate to that line, be it on the curve of the polyline or not. Rather than having to select a point on the curve then the text, then a point on the straight, then the relative text. Also does anyone know of a Lisp that allows one click deleting? Rather than selecting an object then hitting delete. You can run a lisp that would delete anything you click on and keep the command open until your finished? Sorry if this post seems long winded, but any help would be appreciated. I have also attached the Text Rotate lisp that I am currently using. Thanks RT.LSP Quote Link to comment Share on other sites More sharing options...
Dadgad Posted August 15, 2013 Share Posted August 15, 2013 Welcome to CADTutor. When in doubt, check Lee Mac out! http://www.lee-mac.com/slinkytext.html this is but one of a huge number of great lisps very generously made available for free on Lee's site. Thanks Lee! He has a bunch that deal with text issues, if this is not the correct one, look at his site. Quote Link to comment Share on other sites More sharing options...
grifflee Posted August 15, 2013 Author Share Posted August 15, 2013 Thanks for the reply Dadgad. Lee has some quality Lisps on his site, but not quite what I was looking for. Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted August 15, 2013 Share Posted August 15, 2013 It is going to be difficult to find a pre-made lisp routine that tackles your alignment problem with the added functions to allow one-click deleting. You could find one, and then the other, and combine them though. Quote Link to comment Share on other sites More sharing options...
troggarf Posted August 15, 2013 Share Posted August 15, 2013 Also does anyone know of a Lisp that allows one click deleting? Rather than selecting an object then hitting delete. You can run a lisp that would delete anything you click on and keep the command open until your finished? Thanks Here is one that Lee combined for me. It mimics the eraser tool in SketchUp http://www.theswamp.org/index.php?topic=39014.msg441779#msg441779 Eraser.lsp Quote Link to comment Share on other sites More sharing options...
Tuns Posted August 15, 2013 Share Posted August 15, 2013 Could just do a good ol' macro for that. *^C^C_erase;\; Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 15, 2013 Share Posted August 15, 2013 Please try the attached program. [ Many thanks for the recommendations Dadgad & Troggarf! ] AutoAligntoCurve.lsp Quote Link to comment Share on other sites More sharing options...
Least Posted August 15, 2013 Share Posted August 15, 2013 Hi Lee, Can this be made to also work with blocks? And how about along polylines? cheers P Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 15, 2013 Share Posted August 15, 2013 Here is one that Lee combined for me. It mimics the eraser tool in SketchUp... Thanks Greg - Here is an updated version of that program to adhere to the active UCS settings: [color=GREEN];; Continuous Erase - Lee Mac[/color] ([color=BLUE]defun[/color] c:ce ( [color=BLUE]/[/color] *error* flg lst mod pt1 pt2 sel ) ([color=BLUE]defun[/color] *error* ( m ) ([color=BLUE]redraw[/color]) ([color=BLUE]princ[/color])) ([color=BLUE]princ[/color] [color=MAROON]"\nSelect objects to erase: "[/color]) ([color=BLUE]while[/color] ([color=BLUE]and[/color] ([color=BLUE]not[/color] flg) ([color=BLUE]=[/color] 3 ([color=BLUE]car[/color] ([color=BLUE]setq[/color] pt1 ([color=BLUE]grread[/color] [color=BLUE]nil[/color] 12 2))))) ([color=BLUE]if[/color] ([color=BLUE]setq[/color] sel ([color=BLUE]ssget[/color] ([color=BLUE]setq[/color] pt1 ([color=BLUE]cadr[/color] pt1)))) ([color=BLUE]command[/color] [color=MAROON]"_.erase"[/color] sel [color=MAROON]""[/color]) ([color=BLUE]progn[/color] ([color=BLUE]princ[/color] [color=MAROON]"\nSpecify opposite corner: "[/color]) ([color=BLUE]while[/color] ([color=BLUE]=[/color] 5 ([color=BLUE]car[/color] ([color=BLUE]setq[/color] pt2 ([color=BLUE]grread[/color] [color=BLUE]t[/color] 13 0)))) ([color=BLUE]redraw[/color]) ([color=BLUE]setq[/color] pt2 ([color=BLUE]cadr[/color] pt2) lst ([color=BLUE]list[/color] pt1 ([color=BLUE]list[/color] ([color=BLUE]car[/color] pt2) ([color=BLUE]cadr[/color] pt1)) pt2 ([color=BLUE]list[/color] ([color=BLUE]car[/color] pt1) ([color=BLUE]cadr[/color] pt2))) mod ([color=BLUE]if[/color] ([color=BLUE]<[/color] ([color=BLUE]car[/color] pt1) ([color=BLUE]car[/color] pt2)) 0 1) ) ([color=BLUE]mapcar[/color] '([color=BLUE]lambda[/color] ( a b ) ([color=BLUE]grdraw[/color] a b -1 mod)) ([color=BLUE]cons[/color] ([color=BLUE]last[/color] lst) lst) lst) ) ([color=BLUE]if[/color] ([color=BLUE]listp[/color] ([color=BLUE]setq[/color] pt2 ([color=BLUE]cadr[/color] pt2))) ([color=BLUE]if[/color] ([color=BLUE]setq[/color] sel ([color=BLUE]ssget[/color] ([color=BLUE]if[/color] ([color=BLUE]<[/color] ([color=BLUE]car[/color] pt1) ([color=BLUE]car[/color] pt2)) [color=MAROON]"_WP"[/color] [color=MAROON]"_CP"[/color]) lst)) ([color=BLUE]command[/color] [color=MAROON]"_.erase"[/color] sel [color=MAROON]""[/color]) ) ([color=BLUE]setq[/color] flg [color=BLUE]t[/color]) ) ([color=BLUE]redraw[/color]) ([color=BLUE]princ[/color] [color=MAROON]"\nSelect objects to erase: "[/color]) ) ) ) ([color=BLUE]princ[/color]) ) Example: Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 15, 2013 Share Posted August 15, 2013 Hi Lee, Can this be made to also work with blocks? And how about along polylines? It should already work with polylines; as for blocks - yes, but with more work. Quote Link to comment Share on other sites More sharing options...
troggarf Posted August 15, 2013 Share Posted August 15, 2013 Could just do a good ol' macro for that. *^C^C_erase;\; The macro works great. Thanks for another option as well. Lee - Thank you as well for the enhanced version of the Continuous Erase tool. ~Greg 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.