TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: bjisa on June 21, 2007, 05:18:36 PM
-
Is there a command that will allow a lisp program to continue running (pick up where it leaves off) after a new template is opened?
-
The simple answer No.
But it might be able to be done. What did you have in mind (specifics)?
Welcome to theSwamp. :-)
-
I'm trying to write a program which will setup my drawing for me but I need to take old information from a different drawing, copy it, open a new template and paste the information onto the model space. I need the new template because it has my standard border and title block on the layout. I'm trying to make it easier to do with all one command.
-
The problem with trying to do this in lisp is you are going into more than one drawing. Lisp doesn't like that. One way you might be able to do it is
Change SDI to 1
Change LispInit 1
Issue the copyclip command
Issue the new command, with it defaulting to your template (have to make sure you code for the prompts)
Then make sure you are in model space
Issue pasteclip
Change SDI back to
Does that sound like what you want to do?
-
I'm trying to write a program which will setup my drawing for me but I need to take old information from a different drawing, copy it, open a new template and paste the information onto the model space. I need the new template because it has my standard border and title block on the layout. I'm trying to make it easier to do with all one command.
This process may not require the template drawing to be opened.
You may want to INSERT the template as a block & gather information from that block, then delete & purge the block.
You may want to open the template using ObjectDBX & gather info that way.
What exactly do you need from the template? Please be specific.
PS Welcome to TheSwamp.
-
The "sdi" and "lispinit" commands work great with only one drawing open but there's a problem when multiple drawings are open. I can't have multiple drawings open at the same time if I'm switching "sdi" to 1 from 0 so the program will error. Is there anyway to get around this?
-
The "sdi" and "lispinit" commands work great with only one drawing open but there's a problem when multiple drawings are open. I can't have multiple drawings open at the same time if I'm switching "sdi" to 1 from 0 so the program will error. Is there anyway to get around this?
Only if you code it up the way CAB says to, or have it check to see if there are more than one drawing open, and if so tell the user to close all but one.
-
Can't you just throw your routine into a script?
-
I feel like we are all shooting at shadows until bjisa shares with us the data he need from the template & what he is doing with it. :?
-
My template is just a border and block title block that is on the layout portion and has all my layers setup inside the model. I'm trying to get the routine to copy an old drawing which is just drawn on the model space and isn't a template and insert or paste the information into my template's model space so I can make the process alot more quick instead of having to manually open the old drawing copy the information and then open my template and paste it into the model.
-
Can you just use the new command, and use your template as the template to create it with? Then just insert the old drawing, as insert will only bring in what is in model space.
-
Yes that could work but do you use the new command to open a .dwt template file?
-
Yes that could work but do you use the new command to open a .dwt template file?
I think so. I don't use templates, but I just did a little test, and it created a new drawing with the title block in paper space.
-
I can't get the new command to open a .dwt file because my company has changed the new command to open up their owned designed menu. I'll just keep working with it and see what happens. Thanks
-
"_.new" should open the built in version
-
How about creating a button with something like this:
^C^C(setvar 'tilemode 0);(command "_.-INSERT" "yourdrawingnamewithpathusingdoublebackslashes" '(0 0 0) "1" "1" "0");