Boardergrl Posted November 18, 2010 Posted November 18, 2010 I created a macro back in LT 2005 which I remember had a max length of 260 characters. We have now moved to LT2011 and my macros don't allow as many characters for some reason or so it seems. Help says the length of macros is unlimited. In my macros I use DIESEL and can get past those parts fine. I then tried to create a script, but I can't get it to use DIESEL, I get a "unknown command" error with that. Because my macros do quite a bit of stuff, I had already shortened them to be under the 260 characters, and then had the user click two or three times on a menu item. I don't want to have my users have to click even more menu items. So, I am looking to find out if there is a limit on characters in a macro or if I can get a script to work with DIESEL. Quote
Dana W Posted November 19, 2010 Posted November 19, 2010 I believe the script (Lisp) functionality is not available at all in LT. Quote
Boardergrl Posted November 19, 2010 Author Posted November 19, 2010 Lisp is not available but a script is. There is a difference. A script is more like a macro, but each command is on a separate line and a script is it's own file. Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 Boardergrl is correct. Lisp is not available in AutoCAD LT unless the functionality has been added by third-party software (ex. - LT Toolbox). Macros and Diesel are supported in LT. Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 You'll find an example of using AutoCAD script and Diesel here at Cadding & Coding. http://cadingandcoding.blogspot.com/2008/08/autoclock-autocad-digital-cum-analog.html Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 Re: AutoCAD LT 2011 and macro length. From AutoDesk... "You can create a macro of any length, without requiring any special characters at the end of a line. The Properties pane in the Customize User Interface (CUI) Editor accepts a macro of any length." BTW, welcome Boardergrl to the CADTutor forum. While we are on the subject of LT here is a link to another great resource about this oft overlooked program: http://ltunlimited.typepad.com/ Make sure to check out the Archives list on the right hand side of the page. Quote
Boardergrl Posted November 19, 2010 Author Posted November 19, 2010 Unfortunetly this is using a macro to start a script. There is no DIESEL in the script, which is what I am wondering about. Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 I'm getting confused. I thought you said (re: your first post) you created a script but could not get it to use diesel. Now you say there is no Diesel in the script and instead you want to use a macro to start a script. A script, by definition, is a macro so it would only stand to reason that a macro could start a script. Now my head is spinning. Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 Just to confuse things more this quote from Chris McVey of Resource Engineering, Inc. mentions Diesel, macro and script all in one paragraph. "Another tip for power LT users: User variables USERI1-5 and USERR1-5 will be stored in the drawing. These can be read with DIESEL. This is handy to create a macro button that calls a script. This macro can read the value of these variables and pick the correct script based on that value. It makes your macro "smart" and allows on button to do multiple things. Add to that a check on dimscale, cvports, etc and you begin to get some powerful macro tools." Quote
Boardergrl Posted November 19, 2010 Author Posted November 19, 2010 Sorry. I was replying to the "You'll find an example of using AutoCAD script and Diesel here at Cadding & Coding." reply. In that example there is no DIESEL in his script. But, I want to use DIESEL in a script. He had a macro that used some DIESEL and then called a script. This is giving me an idea. Uh OH. I will create a macro that calls a script when lots of non-DIESEL code is used and then goes back to the macro. Hmmm. I'm gonna try that. Quote
Boardergrl Posted November 19, 2010 Author Posted November 19, 2010 I did a test to see if I could click on a menu button which started a script. The script did a few things, created a layer & made a circle. When the script is done it goes back to the macro, which then changed the color of the layer created in the script. It worked. So I did the same thing with my long macros. Click a menu, opens a script, goes back to macro to do my DIESEL, then goes to another script, which finishes the whole thing. I don't mind two separate scripts as long as my users only have to click one menu button. Here is the macro code, ^C_script;cleanup1.scr;$M=$(getvar,extmin);$(getvar,extmax);;^C_script;cleanup2.scr;, all other code is in the scripts. WooHoo. Now I will try my bigger macro which will involve creating probably five scripts. Quote
ReMark Posted November 19, 2010 Posted November 19, 2010 It appears all is right with your world for the moment. Nice to hear. Quote
Dana W Posted November 21, 2010 Posted November 21, 2010 Lisp is not available but a script is. There is a difference. A script is more like a macro, but each command is on a separate line and a script is it's own file. Thank you. I have been Lispless for some years now using LT, due to tight budgeted boss (translation = Wife). Also have been a bit Listless in investigating new tools due to simple work requirements, so I was not sure of the difference. I had assumed Script was generic for 'program code file', which is pretty much what a Lisp is, sorta, kinda. 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.