Script is going crazy. Asking for shape file I don't need

Script is going crazy. Asking for shape file I don't need

Anonymous
Not applicable
1,262 Views
6 Replies
Message 1 of 7

Script is going crazy. Asking for shape file I don't need

Anonymous
Not applicable

I have written a script to insert a drawing into another one just for the text style.  Then the script will load

a lisp file, then invoke the lisp file. I had it working but now it keeps asking for a shape file. I don't need a shape file and don't know why it started going weird.

Here is the script:

Insert
C:\bed
0,0

 

erase
last

load

t2.lsp

t2

Any ideas?

 

Thanks

0 Likes
Accepted solutions (1)
1,263 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

 

Sorry, I made a mistake!! 

 

0 Likes
Message 3 of 7

dlanorh
Advisor
Advisor

Autocad wouldn't ask for something it didn't need. Check the drawing you are loading and see if it contains the shape file it says is missing, if it doesn't check if it should e.g. check linetypes and text style fonts. When you insert one drawing into another it copies over all the linetypes, layers, text styles etc. You may be inadvertantly importing a linetype or text style where the linetype or font, needs a shape file and that shape file is missing from the drawing you are inserting. Erasing the drawing won't erase the imported linetypes, layers etc.

 

Failing that there are 4 options :

1. Set up a drawing template that contains all the linetypes, layers, text styles etc you will need and use this as the default new drawing template. Purging once the drawing is completed is easier that continually loading something you haven't got. (highly recommended).

2. Throw the script away and use Lee Macs Steal lisp HERE to import your text style.  (recommended)

3. Backup the script,  then erase the last line, and run it. If the error occurs repeat, again erasing the new last line until the error doesn't occur. This will tell you where this is going wrong.

4. Add lines to your script to set the new text style as current, then purge the drawing of everything you don't need before running the lisp.

 

The problem may be in the lisp, but you haven't posted that so can't check it.

I am not one of the robots you're looking for

0 Likes
Message 4 of 7

Paul_Gander
Advocate
Advocate
Accepted solution

The LOAD command is for shape files, not lisp. Use the lisp command (load "t2.lsp") or add the file to your startup suite instead.

Message 5 of 7

Moshe-A
Mentor
Mentor

@Anonymous wrote:

I have written a script to insert a drawing into another one just for the text style.  Then the script will load

a lisp file, then invoke the lisp file. I had it working but now it keeps asking for a shape file. I don't need a shape file and don't know why it started going weird.

Here is the script:

Insert
C:\bed
0,0

 

erase

 

 


when you inserting a block inside you specified the block name (c:\bed) OK...you specified the insertion base point

OK than we have an empty line which is as pressing enter in script language

but what about XScale\YScale factors?

what about the block rotation angle?

 

don't you want to fulfil INSERT option there?

 

and another remark:

for you (an others) to easy read the script keep each command and it's options in one line

of course where it's possible (for autocad script it does not matter)

when enter is required, it will span (noting to do)

 

Moshe

0 Likes
Message 6 of 7

Anonymous
Not applicable

Thanks everybody for the help. I downloaded the steal.lsp but couldn't get it to work. That looks like a real good lisp so I will try again later.

 

I then went back and edited my script file and correctly typed the (load "lisp") command and that got it to work. I am still tweakiing it but am not being asked for shape files and the lisp is being loaded. 

0 Likes
Message 7 of 7

cschnarr
Enthusiast
Enthusiast

@Paul_Gander Thanks Paul!!

I have been chasing an answer to this issue for three months. I am struggling to understand how Lisp interprets the commands to load. I never know if I should use LOAD, MENULOAD, or APPLOAD. My problem was, I was trying to load Lisp files using (command "load" "mylispfile"). You wrote this post, which finally helped me to see not to use "COMMAND" to initiate the load, but just use "LOAD".

 

So now by editing my lisp to (load "mylispfile") it works perfectly. In all the searches I did for "How to load a lisp file using a lisp file" nobody ever pasted your simple explanation.

 

You have a new best friend! 😁

0 Likes