TheyCallMeJohn Posted January 21, 2011 Posted January 21, 2011 Okay so two questions both relating to text in a multileader. 1) I have written a lisp that sets layer, creates a revcloud but when it gets the point at which it generates an mleader, I run into problems. Basically it draws the leader then ask me for the text in the command window. But soon as I hit space (as in between words) it finishes the command. I am hoping there is a way to pop up the normal dialog box that happens with multileaders so that the user can type in there entry hit okay then it finishes the lisp. 2) Second question, I am using a portion of a lisp from Ken Jolly that uses a series of texts in quote marks and then the user can select from them in a dialog box. it works great but for some of our longer texts I would like it if it could insert a 'return' to bring it to the next line. Is there a way to do that? See attached code. The one I have modified but not posted utilizes a mleader not a leader. '\n' did not work. Any help would be appreciated. note.zip Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 What method are you using to obtain the text string? I think using getstring would allow spaces in your routine. Quote
BlackBox Posted January 21, 2011 Posted January 21, 2011 Consider this example: (command "._mleader" "_h" pause pause ([color=blue]getstring[/color] [color=red]T[/color])) Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 Consider this example: (command "._mleader" "_h" pause pause ([color=blue]getstring[/color] [color=red]T[/color])) RenderMan, What does the "_h" mean? For AutoCAD 2009, the options I can type are: Command: _mleader Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: Quote
BlackBox Posted January 21, 2011 Posted January 21, 2011 RenderMan, What does the "_h" mean? For AutoCAD 2009, the options I can type are: Command: _mleader Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: Question: What options are present after you hit Enter ? Answer: (No cheating!) [color=white]Command:[/color] [color=white]MLEADER[/color] [color=white]Specify leader arrowhead location or [leader Landing first/Content [/color] [color=white]first/Options] <leader Landing first>:[/color] [color=white]Specify leader landing location or [leader arrow[b]H[/b]ead first/Content [/color] [color=white]first/Options] <leader arrow[b]H[/b]ead first>: *Cancel*[/color] Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 (No cheating!) I needed a good laugh today! BTW, thanks for teaching me yet something else I didn't know about AutoCAD. Learn something new every day.... Quote
BlackBox Posted January 21, 2011 Posted January 21, 2011 I needed a good laugh today! Happy Friday, glad I could help! :wink: ... But you got the answer, no? The mleader command 'remembers' the last setting used first (arrowhead first, landing first, etc.), so the "_h" simply forces the command (no matter what option is pre-selected) to start with the arrowhead. Cheers! Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 Well I do understand what your code is supposed to do but I still get "Invalid input" when I copy and paste your code into the command line. Quote
BlackBox Posted January 21, 2011 Posted January 21, 2011 Ah well, guess that's what I get for dabbling with mleaders (I never use them). lol Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 Well I do understand what your code is supposed to do but I still get "Invalid input" when I copy and paste your code into the command line. My settings are for the arrowhead to be drawn first so that's why the "_h" doesn't work, it's already set to that. Yet it works if we leave off the "pause" - "pause" - getstring portion of the code. Quote
TheyCallMeJohn Posted January 21, 2011 Author Posted January 21, 2011 The issue is that if you already have arrowhead set to be first it doesn't give you that option. But if you do have content first then "_h" is an option. I got around that part by inserting the line below. Unfortunately Renderman's little bit of code didn't work for me. It still asked for the text at the command line and then exited soon as I hit space. Furthermore it brings me back to my original issue about trying to use the dialog box so the user can input multiple line text. I supposed I could have some default text inserted and the use something like #2 below. But I would have to play around with it to see how works. 1: (command "_mleader" "C" (command)) 2: (command "ddedit" (entlast)) Still hoping one of you can come up with some glorious solution like I normally find on here. Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 The issue is that if you already have arrowhead set to be first it doesn't give you that option. But if you do have content first then "_h" is an option. I got around that part by inserting the line below. Unfortunately Renderman's little bit of code didn't work for me. It still asked for the text at the command line and then exited soon as I hit space. Furthermore it brings me back to my original issue about trying to use the dialog box so the user can input multiple line text.I supposed I could have some default text inserted and the use something like #2 below. But I would have to play around with it to see how works. 1: (command "_mleader" "C" (command)) 2: (command "ddedit" (entlast)) Still hoping one of you can come up with some glorious solution like I normally find on here. Can you share the code you already have? Might help to get your answer... Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 Can you share the code you already have? Might help to get your answer... Oops Just saw that you had attached your code in a zip in your first post. Looking at it now. Quote
TheyCallMeJohn Posted January 21, 2011 Author Posted January 21, 2011 Oops Just saw that you had attached your code in a zip in your first post. Looking at it now. That's Ken Jolly's original code. I can post my code once I have modified it a little. Its just not that clean right now. Quote
lfe011969 Posted January 21, 2011 Posted January 21, 2011 That was easy. Just change this line: (COMMAND "DIM" "LEADER" PAUSE PAUSE "" SIZ "EXIT") with this line: (command "_mleader" pause pause siz) Works for me. 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.