Freerefill Posted April 24, 2009 Posted April 24, 2009 I'm not positive where to ask this, so I thought the General forum would be a good place to start. I've recently taken on some challenges which involve manipulating the data sent to AutoCAD via methods other than the simple, easy one.. that is to say, LISP. Script files have proven a worthy adversary, however their limitations are apparent. There is one thing I've been playing with, though, that has been very promising by my limited experience with it has made the whole process very.. well, limiting, and that thing is a .bat file, or, in other words, using the Windows command prompt as a shell of AutoCAD and manipulating data in there, instead of in AutoCAD itself. In a nutshell, AutoCAD can send commands from the AutoCAD command prompt to the Windows command prompt using external commands (START, SHELL), but can the process be reversed? Can the Windows command prompt feed commands back into an open instance of AutoCAD? The closest I've found so far is running AutoCAD from the command line and using a batch file on startup, but that opens a new instance, which is no good. My experience with the Windows prompt is excrutiatingly limited (I've only been playing with it for a week) so perhaps the question is silly, but it would be sillier to not ask, I think. Quote
ReMark Posted April 24, 2009 Posted April 24, 2009 And the point would be??? Why not look at manipulating the AutoCAD drawing file by first saving the drawing as a DXF file then using Notepad to find and change data? Then open the editted DXF in AutoCAD and save it back as a DWG file. Example: You could find and replace text strings, change the diameters of circles, reposition lines or change their lengths. Quote
Freerefill Posted April 24, 2009 Author Posted April 24, 2009 Thank you for the suggestion, if I can find a way to sort through all that data autonomously using a .bat file, I'm sure I can extract the list of layouts. As for the point, well, there are two reasons, and one follows the other. Reason the First: AutoCAD LT does not allow LISP functions, so autonomous manipulation is severely limited. Reason the Second: No one, as far as I know and have googled, has come up with a way to create a script which will perform some operation on multiple layout tabs in AutoCAD LT. In any regular version of AutoCAD it's easy: just cobble together a loop and (layoutlist). However, loops aren't allowed in LT. They are, however, allowed in a .bat file. If I can extract the layout list from a .dwg and put it into a format that can be understood/manipulated by a .bat file, I can add it to my existing work, thereby allowing me to operate across all layout tabs autonomously. And just FYI, even if there is a way to accomplish this in LT and I simply haven't found it yet, it doesn't take away from the hack value inherent in what I'm trying to accomplish. In short, it's fun. :3 Quote
ReMark Posted April 24, 2009 Posted April 24, 2009 Speaking of .bat files it sounds like you would have enjoyed MS-DOS. Quote
AlinOz Posted April 24, 2009 Posted April 24, 2009 FYI: trust me when I say it can be done, but it is probably something only a programming Guru could do. Take for example DRC range of software add-ons for LT (http://www.drcauto.com). Drc has been taking LT to all new levels of productivity for a long time now, adding in the 'lost' features from AutoCAD (like giving back Lisp and VBA) and adding their own application on top of LT. This stuff is written by a very clever man (Gary D'Arcy) in Sydney Australia and it IS 100% legal (although Autodesk wished it wasn't and keeps trying to put up new blocks in their path). Be aware, some of these types of so-called LT add-ons are not legal and Autodesk has every right to nail them. They work on the basis that you get yourself a 30 day license of AutoCAD and their software will just re-enable the modules - that's illegal!!! Maybe their Slingshot or Toolkit package might be what you're looking for to enable you to work with it successfully??? P.S. this is not a sales entry - I just worked for them about 15 years ago and know that this is some pretty good stuff and it may be a cost effective solution... Quote
rkent Posted April 24, 2009 Posted April 24, 2009 http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618 Download scriptpro, free from Autodesk. Watch for word wrap. Quote
Patrick Hughes Posted April 24, 2009 Posted April 24, 2009 And just FYI, even if there is a way to accomplish this in LT and I simply haven't found it yet, it doesn't take away from the hack value inherent in what I'm trying to accomplish. In short, it's fun. :3 I think LT allows you to use diesel expressions so you may be able to perform a combination batch script/diesel evaluation thing. I've not done a lot with diesel macros so I can't really say how much power they will provide. Quote
AlinOz Posted April 25, 2009 Posted April 25, 2009 I know it used to handle Diesel expressions but from my recollection (it's been about 10 years) Diesel doesn't handle variables at all making it very 'unfriendy'. Autodesk didn't really want LT to compete with AutoCAD as it was their flagship product so it's been severely knobbled... LT was developed to address seperate market altogether without detracting from its 'Big Brother's'. Sure, today's LT is more advanced than R14 in many areas, but when it comes to programability, it's been deliberately set up to make it next to impossible. As for rkent's suggestion, these apps only apply appear to support the full product - not 'little brother' LT Quote
TigerByTheTail Posted August 17, 2009 Posted August 17, 2009 I'm new to the forum and to LT, but I used Map and LISP for about 11 years. Been playing around with scripts and diesel. You can use limited user variables USERI1-5 and USERR1-5. Can't use USERS1-5 (strings), but you can use environmental variables with SETENV and GETENV. 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.