Author Topic: Program Continuation  (Read 4709 times)

0 Members and 1 Guest are viewing this topic.

bjisa

  • Guest
Program Continuation
« 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?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Program Continuation
« Reply #1 on: June 21, 2007, 05:33:35 PM »
The simple answer No.

But it might be able to be done.  What did you have in mind (specifics)?

Welcome to theSwamp.  :-)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

bjisa

  • Guest
Re: Program Continuation
« Reply #2 on: June 21, 2007, 05:37:00 PM »
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.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Program Continuation
« Reply #3 on: June 21, 2007, 07:05:59 PM »
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?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Program Continuation
« Reply #4 on: June 21, 2007, 09:52:11 PM »
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.
« Last Edit: June 21, 2007, 09:56:23 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bjisa

  • Guest
Re: Program Continuation
« Reply #5 on: June 22, 2007, 12:27:10 PM »
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?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Program Continuation
« Reply #6 on: June 22, 2007, 12:44:12 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Program Continuation
« Reply #7 on: June 22, 2007, 01:21:03 PM »
Can't you just throw your routine into a script?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Program Continuation
« Reply #8 on: June 22, 2007, 01:40:20 PM »
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. :?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

bjisa

  • Guest
Re: Program Continuation
« Reply #9 on: June 22, 2007, 02:12:48 PM »
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.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Program Continuation
« Reply #10 on: June 22, 2007, 02:19:06 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

bjisa

  • Guest
Re: Program Continuation
« Reply #11 on: June 22, 2007, 02:30:00 PM »
Yes that could work but do you use the new command to open a .dwt template file?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Program Continuation
« Reply #12 on: June 22, 2007, 02:41:01 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

bjisa

  • Guest
Re: Program Continuation
« Reply #13 on: June 22, 2007, 02:46:56 PM »
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

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Program Continuation
« Reply #14 on: June 22, 2007, 02:48:46 PM »
"_.new" should open the built in version
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Program Continuation
« Reply #15 on: June 22, 2007, 03:04:54 PM »
How about creating a button with something like this:

Quote
^C^C(setvar 'tilemode 0);(command "_.-INSERT" "yourdrawingnamewithpathusingdoublebackslashes" '(0 0 0) "1" "1" "0");

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC