Author Topic: Last File Saved ?  (Read 2498 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Last File Saved ?
« on: August 31, 2013, 05:58:23 AM »
Is there a way to access the name and location of the last saved file by another application.  For example I want to read a text file identified with the "getfiled" function, however the user had the opportunity to edit and saveas in another application since the file was selected with the "getfiled" function.  :realmad: It seems the logical thing would be to compare the last file saved to the one retreived with getfiled, and use the appropriate one.


Bruce

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Last File Saved ?
« Reply #1 on: August 31, 2013, 06:09:36 AM »
I don't think that's possible in "every" instance. It depends a great deal on the "other" application. Does it save something like a recent files list to registry? Or does it implement an ActiveX server (with methods for obtaining it's saved file list) so you can link to it from Lisp?

Even if one or more of those can be answered positively, how are you to be sure that the user didn't saveas and then do something else directly afterwards? E.g. opened file A (the one you had from getfiled), then saveas to name B, but immediately open C and save that?

Perhaps you'd need to figure out if your design can be changed so as to circumvent this issue entirely.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Last File Saved ?
« Reply #2 on: August 31, 2013, 06:19:42 AM »
irneb,

The file could have been opened by any ascii-text editor the user may have ie. word-pad, note-pad, excell etc.  It would not be possible to then open another file as this editing session (point files) is done while the lisp is still active.  The user would have to essentially cancel out of the lisp function to start the process over again to open another file.

I will disable the ability to edit the point file then allow an import function to operate without restarting function. (anf re-identifying the file with getfiled)

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Last File Saved ?
« Reply #3 on: August 31, 2013, 08:05:30 AM »
If the text files reside in the same directory you could possibly use a combination of the vl-directory-files and vl-file-systime functions to determine the most recently modified file to be used by your application.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Last File Saved ?
« Reply #4 on: August 31, 2013, 03:05:11 PM »
Thanks guys, I have separated the two so the user has to select the file to be edited separately from the point file to insert.  This way will  definitely prevent the issues being currently experienced.   

Though there might be some system (Microsoft) variable that listed the last file saved.... (apparently not)

Lee, I see Bricsys has incorporated one of your functions as a vle function in the soon to be released Ver. 14, keep up the great work...   :kewl:

Bruce
« Last Edit: August 31, 2013, 03:13:39 PM by snownut2 »

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Last File Saved ?
« Reply #5 on: August 31, 2013, 05:26:07 PM »
Lee, I see Bricsys has incorporated one of your functions as a vle function in the soon to be released Ver. 14, keep up the great work...   :kewl:

Thank you Bruce -
I am truly honoured to have been able to contribute to the VLE functions and have the pleasure of working with Torsten  :-)

LE3

  • Guest
Re: Last File Saved ?
« Reply #6 on: September 04, 2013, 10:05:16 AM »
Lee, I see Bricsys has incorporated one of your functions as a vle function in the soon to be released Ver. 14, keep up the great work...   :kewl:

Thank you Bruce -
I am truly honoured to have been able to contribute to the VLE functions and have the pleasure of working with Torsten  :-)

Good!, is there a url link for that?

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Last File Saved ?
« Reply #7 on: September 04, 2013, 05:23:07 PM »
Lee, I see Bricsys has incorporated one of your functions as a vle function in the soon to be released Ver. 14, keep up the great work...   :kewl:

Thank you Bruce -
I am truly honoured to have been able to contribute to the VLE functions and have the pleasure of working with Torsten  :-)

Good!, is there a url link for that?

file:///C:/Program%20Files%20%28x86%29/Bricsys/Lisp%20Developer%20Support%20Package.htm

Try this, Under "VLE LISP  /  Utility Functions" the alert function.....

Bruce

LE3

  • Guest
Re: Last File Saved ?
« Reply #8 on: September 04, 2013, 05:37:19 PM »
^
Thanks.
That is not a link

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Last File Saved ?
« Reply #9 on: September 04, 2013, 07:17:40 PM »
Sorry bout that dah....try this

http://www.lt-extender.com/LT-Extender/downloads/public/Lisp Developer Support Package.rar

This is a download with the  CHM file for (Bricscad help for Developers) similar to ACAD's.  This is a stand alone type of Help file, not sure if Bricsys intends to include it with Ver.-14 or not, since their compiler is a separate download, this may well be also.

Since Torsten had posted this link in the Bricscad Developer Forum a little while ago, I assuming it is OK to post here.

For some reason only part of the line is showing up as a link, you need to cut & paste the entire line.

« Last Edit: September 04, 2013, 07:50:42 PM by snownut2 »