Author Topic: Closing a file with a saved view  (Read 2823 times)

0 Members and 1 Guest are viewing this topic.

diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Closing a file with a saved view
« on: October 28, 2013, 04:38:32 PM »
I need help on building a LISP that can be executed when a file is close.
Don’t you hate when you open a drawing and it is saved on the last part in where the last user left out?
I want to created a LISP to close a file with a preset saved view; the saved view is a fit view of the utter side of our title block.

Thank you…

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Closing a file with a saved view
« Reply #1 on: October 28, 2013, 06:53:57 PM »
You can start here:  Close Reactor
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.

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Closing a file with a saved view
« Reply #2 on: October 28, 2013, 08:08:33 PM »
I would recommend using a reactor triggered by the save operation, otherwise you will need to save the drawing through the reactor callback function, which may not be desired if the user does not wish to save changes when closing.

Here is a recent example of such functionality: UCS to WCS on Save

Bhull1985

  • Guest
Re: Closing a file with a saved view
« Reply #3 on: October 29, 2013, 09:26:43 AM »
This isn't the fanciest way, nor am I sure it'd do exactly what he's wanting....buuuuut I would do this with a script attached to the target window of autocad
You could use this as your script, after doing an "id" on the two corners of a window that would encompass your title block. Do an 'id' on two opposite corners of a window that would encompass it, then use those points as the corners of a zoom window...bam, done upon opening any drawing. As long as you're messing with the same set of drawings or any that use the same titleblock, you wouldn't need to remove the attached script, but upon going to a different project or opening a non-related drawing, you'd probably want to detach or remove the script so that acad behaves as expected.

Code: [Select]
zoom
window
pt1
pt2
[carriage return goes here but no text]


I've been trying to find out how to place an image directly into this post but have failed in finding out how to do so. The button that I've pressed just adds html tags and doesn't bring up a dialog that leads to an inline image, but if you check out what's attached here then you will see where to put the script name so acad automatically runs it upon opening a dwg, as well as the above script in notepad with a .scr extension that allows it to be used by autocad.
HTH


p.s. Oh okay, good it did insert my image as I was hoping :)


diego65

  • Newt
  • Posts: 51
  • Learning LISP is a cool thing
Re: Closing a file with a saved view
« Reply #5 on: November 05, 2013, 09:57:13 AM »
Thank you Cab for the link information...

Joselo...

andy_lee

  • Newt
  • Posts: 147
Re: Closing a file with a saved view
« Reply #6 on: August 01, 2015, 08:14:18 AM »
I would recommend using a reactor triggered by the save operation, otherwise you will need to save the drawing through the reactor callback function, which may not be desired if the user does not wish to save changes when closing.

Here is a recent example of such functionality: UCS to WCS on Save

Hi ,Lee , I can't open this link.  :cry:
andy.
Best regards.

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Closing a file with a saved view
« Reply #7 on: August 01, 2015, 08:21:16 AM »
I would recommend using a reactor triggered by the save operation, otherwise you will need to save the drawing through the reactor callback function, which may not be desired if the user does not wish to save changes when closing.

Here is a recent example of such functionality: UCS to WCS on Save

Hi ,Lee , I can't open this link.  :cry:

http://www.cadtutor.net/forum/showthread.php?82315-Set-UCS-to-world-co-ordinates-when-closing-drawing.&p=561459&viewfull=1#post561459

andy_lee

  • Newt
  • Posts: 147
Re: Closing a file with a saved view
« Reply #8 on: August 01, 2015, 09:09:24 AM »
I would recommend using a reactor triggered by the save operation, otherwise you will need to save the drawing through the reactor callback function, which may not be desired if the user does not wish to save changes when closing.

Here is a recent example of such functionality: UCS to WCS on Save

Hi ,Lee , I can't open this link.  :cry:

http://www.cadtutor.net/forum/showthread.php?82315-Set-UCS-to-world-co-ordinates-when-closing-drawing.&p=561459&viewfull=1#post561459

Hi Lee , Thank you very much.
andy.
Best regards.