AutoCAD Script & Lisp Confirmation & Understanding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, So this is a lot, and if anyone can help me I would be really really grateful, so thank you in advance.
So recently I have been looking into Lisps and Scripts for AutoCAD, trying to automate some repetitive tasks which I understand can be automated over a large batch of drawings, I simply need to learn how to write these up and use them first.
While looking into the Lisps and Scripts, I seem to understand them that Lisps are like importable, more powerful commands for AutoCAD, say I want to Delete every hatch, layout or specific block. The lisp is able to find and delete these quickly, or even if I have a Variable Setup which will change the PSLT,MSLT,LTS and FILLMODEs etc to different values. All useful things for quickly setting up and deleting from new and existing drawings.
I've came to understand how to briefly use Lisps in singular drawings, using commands and assigning the lisps to commands with (defun C:InsertCommandNameHere ()
So the next stage is to try and use this lisp across multiple drawings, I've found a program by ESurvey called CAD_Batch_Runner.exe, haven't installed it yet however I already feel like an issue with the Defun command will occur, asking me to type in every command before I can actually use it. I also tried to installed ScriptPro 2.0 but my computer doesn't support it for some reason, ideally I would need a Batch-Lisp Runner and/or a Batch-Script Runner that is free
How would I convert a script like this;
(defun C:VariableSetup ()
(command "MSLTSCALE" 0 )
(command "PSLTSCALE" 0 )
(command "LTSCALE" 15 )
(command "FILLMODE" 1 )
(command "PDFFRAME" 1 )
(command "IMAGEFRAME" 1 )
)
into a scriptable format, and as a second one, how would I convert this Lisp which deletes all hatching into a script
Next is my understanding and issues with Scripts. I understand them to function similar to AutoCAD Macro Commands, inputting keyboard functions and possible using lisps inside themselves by typing the lisp command? However I can not get any script I have to work correctly, and I am unsure if scripts are written the same as LISPS, do they have a different formatting and if so, does anyone know the specific names for Lisp Formatting and Script Formatting so I can research these further? Whenever I use my scripts also, it always gives me a blank type box or error. This is my current script I found to disable one of my layers, but it does not work;
Does anyone have any idea how I can use a Lisp across multiple drawings, or am I limited to using Scripts as my batch processing. And alongside this, is it possible to link my Scripts to Lisps, so that the script can access my premade lisps instead of converting every Lisp to an executable Script Format?
If you have read all this, thank you, and if you are wanting to help me, also thank you so so much.