Jump to content

ScriptPro/ Autoscript not supporting LISP use?!


DWG Destroyer

Recommended Posts

Hey guys,

I have a problem that does not seem to have an answer when I search the net, but there must be one as it is so (seemingly) fundamental. My acaddoc.lsp file has a few simple routines that I have added (for example, a simple “set layer to 0”) and I am very pleased them with as they work fine 100% of the time. BUT when I go to invoke these commands in bulk dwg processing - I’ve tried both autoscript and script pro – these new routines are not recognised (acad actually returns that the command is not recognised, even though I just tested it before batch processing!) and the processing fails. I cannot seem to get past this problem - could anyone possibly shed some light on this for me? I would love to further my understanding in this area!

Cheers!

Link to comment
Share on other sites

Wow, LeeMac’s program works perfectly! That’s absolutely brilliant – thanks for your help pBe!

Alan, a simple example of what I was trying to achieve;

(defun c:VPL () (command "TILEMODE" "0" "-VPORTS" "LOCK" "ON" "ALL" ""))

Works fine by itself, but when I put it in a script to batch process via autoscript/ scriptpro (written as the following ):-

(COMMAND "VPL" )

(COMMAND "_QSAVE" )

(COMMAND "CLOSE" )

ACAD spits “VPL” back at me saying it is not a recognised command… Odd!

Link to comment
Share on other sites

Wow, LeeMac’s program works perfectly! That’s absolutely brilliant – thanks for your help pBe!

 

Alan, a simple example of what I was trying to achieve;

 

(defun c:VPL () (command "TILEMODE" "0" "-VPORTS" "LOCK" "ON" "ALL" ""))

 

Works fine by itself, but when I put it in a script to batch process via autoscript/ scriptpro (written as the following ):-

 

(COMMAND "VPL" )

(COMMAND "_QSAVE" )

(COMMAND "CLOSE" )

 

ACAD spits “VPL” back at me saying it is not a recognised command… Odd!

That's because VPL is a LISP routine, not a native AutoCAD command. Try:

 

(c:VPL)
(command "_.qsave" "_.close")

Link to comment
Share on other sites

Wow, LeeMac’s program works perfectly! That’s absolutely brilliant – thanks for your help pBe!

 

Glad it works for you :)

 

(COMMAND "VPL" )

(COMMAND "_QSAVE" )

(COMMAND "CLOSE" )

 

ACAD spits “VPL” back at me saying it is not a recognised command… Odd!

 

To answer your question: 'VPL' is not a recognised command, it is a LISP function; so you will need to call the LISP function using:

 

(c:VPL)

Link to comment
Share on other sites

  • 1 year later...

Hi again guys, I know it’s been a while but I’ve come into some more trouble with this problem! I recall Lee’s program helping me in the past, but I don’t think I ever got around to finding out how to work without it! Anyway, upon advancing a couple of acad versions in addition to my work internet connection to that program becoming blocked, and I find myself asking the question I started with once more. I can see the suggestions people have made about calling the lisp function differently (ie as Lee has described above) but in doing so I still get an unrecognised command error. Is there something else I could be doing wrong? – Cheers!

Link to comment
Share on other sites

Hi Lee,

 

Simple script, undoubtedly WRONG.

 



(C: PA)
(COMMAND "_QSAVE" )
(COMMAND "CLOSE" )

 

‘PA’ is just a simple lisp that pastes objects to 0,0,0. Obviously when I get this to work the possibilities will be endless for other batch processes...

Link to comment
Share on other sites

If you are using my Script Writer program to construct the script, try the following as the Script Line:

 

_.open *file* (if (load "PA.lsp" nil) (c:PA)) _.qsave _.close

[ Assuming your program is saved as 'PA.lsp' in your support path ]

Link to comment
Share on other sites

I was hoping to avoid using your writer if possible (no offence!), as I want to become more self-dependant! Surely what I've written should work in Autoscript?

 

Nonetheless I did have a go with your program, but it seems that copy & pasting that code into your writer will call acad to open the files ok, but will not do the pasting? When invoking PA manually it works like a charm...

 

Here's what my lisp looks like as well if you were wondering:



(defun c:PA () (command "PASTECLIP" "0,0"))


 

 

 

And normally I keep all my routines in my acaddoc.lsp file, but for this example I did save the PA command to PA.lsp just to test.

Link to comment
Share on other sites

Surely what I've written should work in Autoscript?

 

I've never used 'AutoScript' so couldn't answer that question; but, after removing the space between 'C:' and 'PA', the code looks syntactically correct.

 

Nonetheless I did have a go with your program, but it seems that copy & pasting that code into your writer will call acad to open the files ok, but will not do the pasting? When invoking PA manually it works like a charm...

 

Maybe you have altered the contents of the clipboard before running the program?

 

Though, for a simple one-line expression it would probably be easier to include the expression directly in the Script, avoiding the need to define a separate command; e.g.:

 

_.open *file* _.pasteclip _non 0,0 _.qsave _.close

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...