Lee Mac Posted February 16, 2009 Posted February 16, 2009 I must say that I am impressed Jammie... not sure where you got the idea of creating and running temporary scripts within your LISP programs, but it seems to work well! Well Done mate Lee Quote
jammie Posted February 18, 2009 Posted February 18, 2009 That works great... more than one way to skin a catThanks Jammie You welcome lpseifert, glad I could help . AutoCAD was just being stubborn I must say that I am impressed Jammie... not sure where you got the idea of creating and running temporary scripts within your LISP programs, but it seems to work well! Well Done mate Thanks Lee. It was down to a bit of trial and a lot of error really! Just trying to work with what is available and a little bit of lateral. Quote
David Bethel Posted February 19, 2009 Posted February 19, 2009 Unless it has changed over the years, a script will not return control to AutoLISP. When it terminates, it stops all evaluations and return the command prompt. -David Restrictions and Notes If the SCRIPT command is used with the command function, it should be the last function call in the AutoLISP routine. Quote
alanjt Posted April 9, 2010 Posted April 9, 2010 I know this is an old thread, but it was linked to and I wanted to add another solution for archival purposes. (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "tcircle 1 0.3 r ") One has to get the prompts correct. BTW, "\n" or " " counts as one carriage return. Quote
lpseifert Posted April 9, 2010 Author Posted April 9, 2010 cat skinning time (if (not bns_tcircle) (load "acettxt.lsp")) (setq txent (entlast)) (setq ss1 (ssadd)) (ssadd txent ss1) (bns_tcircle ss1 "Variable" "Rectangles" "" 0.30);requires selection set BTW Alan, when I cut/pasted your code into Vlide the "l" (for last I'm assuming) came across as 1 (one). I don't know if it's a font thing or what. Also, how did you determine the prompt sequence? As I read it... Tcircle L (last) 0.3 (offset factor) R (rectangle) but there is no prompt for "Constant/Variable" as there is when using Tcircle from the command line. Quote
alanjt Posted April 9, 2010 Posted April 9, 2010 cat skinning time (if (not bns_tcircle) (load "acettxt.lsp")) (setq txent (entlast)) (setq ss1 (ssadd)) (ssadd txent ss1) (bns_tcircle ss1 "Variable" "Rectangles" "" 0.30);requires selection set BTW Alan, when I cut/pasted your code into Vlide the "l" (for last I'm assuming) came across as 1 (one). I don't know if it's a font thing or what. Also, how did you determine the prompt sequence? As I read it... Tcircle L (last) 0.3 (offset factor) R (rectangle) but there is no prompt for "Constant/Variable" as there is when using Tcircle from the command line. It's an 1 (one) not L. I just copied what prompts were displayed in an earlier post. For that, a selection must be active (sssetfirst). There's a few examples of me abusing vla-sendcommand floating around. Precisely. Quote
lpseifert Posted April 9, 2010 Author Posted April 9, 2010 Gotcha, thanks. I never knew a double space was read as an Enter. Quote
Lee Mac Posted April 9, 2010 Posted April 9, 2010 Gotcha, thanks. I never knew a double space was read as an Enter. Its an Enter Enter Quote
alanjt Posted April 9, 2010 Posted April 9, 2010 Gotcha, thanks. I never knew a double space was read as an Enter. It doesn't. One space or "\n" counts as an enter. However, using vla-sendcommand is just like using a script. You have to include a carriage return for each value entered. If you put "e" it will just print "e" at the command line. However, if you send "e " or "e\n" it will act as if you just type "E" and hit enter, which will execute Erase. Quote
lpseifert Posted April 9, 2010 Author Posted April 9, 2010 OK thanks... I've never used sendcommand before. Ya learn something new every day. Quote
alanjt Posted April 9, 2010 Posted April 9, 2010 OK thanks... I've never used sendcommand before. Ya learn something new every day. It has its very random uses. Quote
jdofboise Posted December 16, 2012 Posted December 16, 2012 I'm having trouble getting this to work. (defun c:revtxt () (vl-load-com) (setq os (getvar "osmode")) (setq pt (getpoint "\nSpecify start point of text :") str (getstring t "\nType text :") ) (vl-cmdf "text" pt "" "" str) (setvar "osmode" 0) (setq fname (vl-filename-mktemp "c:\acad_ipco\Control2008\macro\slot") file (open fname "w") ) (foreach n (list "tcircle" "l" "" "0.35" "s" "c" "b" "" ) (write-line n file) ) (close file) (vl-cmdf "script" "slot") (vl-file-delete "slot") (setvar "osmode" os) ) My command line sequence is here. Where is the 3.5 coming from and why is it not selecting the text as the selection set states? Command: (LOAD "C:/acad_ipco/Control2008/slot.lsp") C:REVTXT Command: REVTXT Specify start point of text : Type text :12345 0 Command: tcircle Select TEXT, MTEXT or ATTDEF objects... Select objects: 3.5 - Should be selecting "last" object *Invalid selection* Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Group/Add/Remove/Multiple/P revious/Undo/AUto/SIngle Select objects: 1 found Select objects: Enter distance offset factor : asks for user inputs here. should just enter those inputs via the script. Enclose text with [Circles/Slots/Rectangles] : Create slots of constant or variable size [Constant/Variable] : Creating Slots...Done. Any suggestions on what the issue is? Thanks JD 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.