.... Macro's .... Is there anyway to ad text prompts!?
.....
If you're not using AutoCAD LT, you can use certain [not all] AutoLisp expressions in command macros, including (get...) functions with prompts in them. So, for instance, you can have:
(setq whatever (getpoint "Pick a point: "))
within a command macro. [In that case, follow it with a \ for the User to pick the requested point.] However, I find that the \n new-line element, which one would typically put at the beginning of the prompt part of something like that in a regular AutoLisp routine, causes a macro to hang up. But when I left that out, it worked, though it's not as "elegant" as in a fully-AutoLisp routine -- it shows that whole (setq ... (get...)) function at the Command: line before repeating the prompt.
@Anonymous wrote: I'm just simply trying to add a line of text to prompt the user. .... my commands to not include (setq (.......)). Is there another way!?
The (prompt) AutoLisp function will do that:
(prompt "This is your prompt text.")
But I expect [without trying], as in my previous Reply, it's going to put the whole (prompt) function on the Command: line and then repeat the prompt itself.
Here is the macro do you believe it will work now?!
^C^C_pasteorig;'_.zoom;e;_ai_selall;(prompt "Select Pit Numbers for Capsule")QSELECT;(LOAD "IPITNO");IPITNO;b;\;y;_ai_selall;QSELECT;(prompt "Change Pit Capsule Layer.")\;(prompt "Select Text to Convert to Mtext.")(LOAD "txt2mtx");TXT2MTX;0;y;_ai_selal;QSELECT;(prompt "Select a Pipe Text to add Diameter.")(LOAD "ADDTOTEXT");ADDTOTEXT; %%C;
@Anonymous wrote: Here is the macro do you believe it will work now?!
^C^C_pasteorig;'_.zoom;e;_ai_selall;(prompt "Select Pit Numbers for Capsule")QSELECT;(LOAD "IPITNO");IPITNO;b;\;y;_ai_selall;QSELECT;(prompt "Change Pit Capsule Layer.")\;(prompt "Select Text to Convert to Mtext.")(LOAD "txt2mtx");TXT2MTX;0;y;_ai_selalL;QSELECT;(prompt "Select a Pipe Text to add Diameter.")(LOAD "ADDTOTEXT");ADDTOTEXT; %%C;
Thanks in advance.
You have a typo...
I you would be interested... this workflow could be much more automated with LISP. All QSELECT could be automated... But you need to elaborate your steps for us. One by one. Some are obvious from the macro... but what properties you're specify in QSELECT..... Post some sample with pre and after situation (dwg) Post the routines you have using. Post all we need to test the whole workflow.
I have created some rather long multi step Macro's and am getting somewhat lost in the routine.
Is there anyway to ad text prompts!?
I read that vbLf pre and post text works but this failed for me.
Does anyone know of another way to write it in?!
Thanks in advance.
Ok... here is the way how to add some text prompts. I used (pricn), but you can use (prompt) as well (as Kent suggested).
^C^C_pasteorig;'_.zoom;e;_ai_selall;(princ ">> Choose TEXT, color GREEN:")(princ);QSELECT;(LOAD "IPITNO");IPITNO;b;\;y;_ai_selall;(princ ">> Choose BLOCK, name PITNO-CAPSULE:")(princ);QSELECT;\;(LOAD "txt2mtx");TXT2MTX;0;y;_ai_selall;(princ ">> Choose MTEXT, color WHITE:")(princ);QSELECT;(LOAD "ADDTOTEXT");ADDTOTEXT; %%C;
BUT, that was the easy part. Does the macro even work for you? It does not for me - because I cannot pass the red backslash. The backslash is a special character in macros (pause for user input) and I don't know how to suppress this special functionality to make it a regular string. Maybe someone else would know...
...if not, you can use this lisp to replace \ to /
I would recommend to abandon DIESEL menu macros (spiced up with AutoLISP) for such more complicated functions and to do it completely in AutoLISP. Replace the "\" input prompts with an appropriate (getpoint) or (getstring) or (getdist) functions in AutoLISP.
I would recommend to abandon DIESEL menu macros (spiced up with AutoLISP) for such more complicated functions and to do it completely in AutoLISP. Replace the "\" input prompts with an appropriate (getpoint) or (getstring) or (getdist) functions in AutoLISP.
I was recommending the same thing (see my post #7), but that was before I see the whole thing. Dustin used three routines in his macro, each has some user prompts which is filled by the macro. That's the advance of macro which makes this programming simple... but this is not simply replicable using lisp. So all three routines must be modified to get rid of this user prompts.
So I offered to the OP this little routine called TextReplaceSlash which should be the OP able to fix his macro with by it's own. To Dustin - try and let know how it goes and if you need any more help.
Btw Unfortunately in this case the backslash was used as text separator "25\7" in the drawing and needs to be replaced (probably with "/"). So it's in conflict with a special symbol \ for pause for user input.
^C^C_pasteorig;'_.zoom;e;_ai_selall;(princ ">> Choose TEXT, color GREEN:")(princ);QSELECT;(LOAD "IPITNO");IPITNO;b;\;y;_ai_selall;(princ ">> Choose BLOCK, name PITNO-CAPSULE:")(princ);QSELECT;/;(LOAD "txt2mtx");TXT2MTX;0;y;_ai_selall;(princ ">> Choose MTEXT, color WHITE:")(princ);QSELECT;(LOAD "ADDTOTEXT");ADDTOTEXT; %%C;
Don't know if you have took the leap to lisp or not but I thought I would share a fix for the backslash problem in macros. Use forwardslash in subsitute, this should work now if that was the only think stopping this macro.