Author Topic: document manager  (Read 12494 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
document manager
« on: October 11, 2010, 08:02:51 AM »
Hello there!

I ask just to prevent inventing the wheel again.
I always work with two screens and lovepaperless working, since I travel a lot with my work. SO i always have acad running on one screen and the information i need to design on the other screen, mostly pdf. So everytime i start working i need to open all the documents related to that deg I'm working on. I thought about storing the paths of the document in the deg and open them with a lisp.

I assume others have the same demand for a thing like that and therefore the code might be written already.

Thanks in advance

Bernd

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: document manager
« Reply #1 on: October 11, 2010, 08:08:16 AM »
A nice idea - if one did not exist, I'd be willing to spend some time putting one together perhaps  :-)

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: document manager
« Reply #2 on: October 11, 2010, 08:24:09 AM »
A nice idea, I am facing the same problem.

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: document manager
« Reply #3 on: October 11, 2010, 09:04:33 AM »
You can add hyperlinks to objects. Just put some objects (ie texts describing the needed documents) somewhere outside the drawing, add a hyperlink to those objects and CTRL+click - voila!
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: document manager
« Reply #4 on: October 11, 2010, 09:13:54 AM »
You can add hyperlinks to objects. Just put some objects (ie texts describing the needed documents) somewhere outside the drawing, add a hyperlink to those objects and CTRL+click - voila!

second that.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Amsterdammed

  • Guest
Re: document manager
« Reply #5 on: October 11, 2010, 10:00:48 AM »
I though more about to open the files the first time with getfiled and store the location in non graphic data and then have a command to reopen them the next time, so no big thing at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: document manager
« Reply #6 on: October 11, 2010, 10:16:02 AM »
Okay, quick questions:
Would this progy automatically open the files (all, some, or last)? ...what happens if the file doesnt exist? What happens if the files are not needed any longer (5 yrs down the road)--a persistent reactor (if you decide to go that route) would be a real pain.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Amsterdammed

  • Guest
Re: document manager
« Reply #7 on: October 11, 2010, 10:25:25 AM »
no reactor. Dictionary and you open it on command., so no reactor needed You can show them in a list first and you select what you want to open, and of course you look if the are still there

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Re: document manager
« Reply #8 on: October 11, 2010, 10:59:27 AM »
like a simple list box? ...cool.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

deegeecees

  • Guest
Re: document manager
« Reply #9 on: October 11, 2010, 11:09:28 AM »
Like a command to store open files, then write those paths to xdata. Then a command to pull that info into a listbox for retrieval. Sounds like a good idea.

Amsterdammed

  • Guest
Re: document manager
« Reply #10 on: October 11, 2010, 11:14:13 AM »
a command to open the files in the first place wit getfiled, so you already have the path. then sore it  and get it back with a listbox to select

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: document manager
« Reply #11 on: October 11, 2010, 01:18:25 PM »
Quickly scribbled together:

Code: [Select]
(defun c:docset ( / file lst )
  (vl-load-com)
  ;; © Lee Mac 2010

  (if
    (while (setq file (getfiled "Select File to Add to Drawing" (cond ( file (vl-filename-directory file) ) ( "" )) "" 16))
      (setq lst (cons file lst))
    )
    (vlax-ldata-put "DocManagerDocs" "docs" (acad_strlsort lst))
  )

  (princ)
)

(defun c:docget ( / _OpenFiles data )
  (vl-load-com)
  ;; © Lee Mac 2010

  (defun _OpenFiles ( files / Shell )
    (setq Shell (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application"))

    (mapcar
      (function
        (lambda ( file )
          (if
            (vl-catch-all-error-p
              (vl-catch-all-apply
                (function vlax-invoke) (list Shell 'Open file)
              )
            )
            (princ (strcat "** Error Opening: " file " **"))
          )
        )
      )
      files
    )

    (vlax-release-object Shell)
  )

  (if (setq data (vlax-ldata-get "DocManagerDocs" "docs"))
    (_OpenFiles
      (vlax-ldata-put "DocManagerDocs" "docs"
        (vl-remove-if-not 'findfile data)
      )
    )   
  )

  (princ)
)

DocSet, stores filename data in drawing dictionary, continuous file selection prompts until user hits cancel.

DocGet, opens stored files.

I'm sure it could be improved upon,

Lee

stevesfr

  • Newt
  • Posts: 54
Re: document manager
« Reply #12 on: October 11, 2010, 01:52:39 PM »
Lee, it boms here thus:

Command: appload
docset.lsp successfully loaded.


Command: ; error: bad argument type: numberp: nil

Steve
Can't remember what I'm supposed to forget.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: document manager
« Reply #13 on: October 11, 2010, 02:10:18 PM »
I can't seem to reproduce that Steve, furthermore, the code doesn't use any functions which are supplied predominantly with numbers, so I'm a little perplexed at that  :-(

Amsterdammed

  • Guest
Re: document manager
« Reply #14 on: October 11, 2010, 02:25:42 PM »
It works with no problem here....
thanks!!