Author Topic: getfiled for multiple dwg selection  (Read 3710 times)

0 Members and 1 Guest are viewing this topic.

Nick-LTC

  • Guest
getfiled for multiple dwg selection
« on: April 12, 2007, 12:17:07 PM »
Does anybody know of a way or routine to select multiple dwg name from getfiled or a vla command?
Thanks in advance!!
Nick

FengK

  • Guest
Re: getfiled for multiple dwg selection
« Reply #1 on: April 12, 2007, 12:32:49 PM »
if you don't mind using 3rd-party tool (free in this case), doslib has a dos_getfilem function which does what you want. there are many other functions in doslib. you can download doslib from http://www.mcneel.com

Nick-LTC

  • Guest
Re: getfiled for multiple dwg selection
« Reply #2 on: April 12, 2007, 12:51:53 PM »
Thanks Kelie
I have looked at dos_lib but have not found any help/support to learn how to apply them.
Is there a "dummy" way to learn how to incorporate them into lisp routines?
Nick

JohnK

  • Administrator
  • Seagull
  • Posts: 10653
Re: getfiled for multiple dwg selection
« Reply #3 on: April 12, 2007, 12:52:13 PM »
Have you tried to: get a directory from the user and then list all dwgs in directory for the user to select from a list dialog?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Nick-LTC

  • Guest
Re: getfiled for multiple dwg selection
« Reply #4 on: April 12, 2007, 12:58:05 PM »
Thanks se7en
thats sounds like it could work, but seems like it may take a bit of programming to approach the getfiled look and feel.  I might try it when I get some spare time, (yeah like that ever happens :lol:)
Nick

JohnK

  • Administrator
  • Seagull
  • Posts: 10653
Re: getfiled for multiple dwg selection
« Reply #5 on: April 12, 2007, 01:06:38 PM »
Well lets see if we cant save you a bit of time...
Try this on for size.
Code: [Select]
( (lambda ( / path)
    ;; Example:
    ;; build a list of files in user selected path
    ;;
    ;; By: Se7en
    ;;         4/12/2007 12:03:11 PM
    ;;
    (defun BrowseForFolder ( / sh folder folderobject result)
      ;;
      ;; From: Tony Tanzillo
      ;; Newsgroups: autodesk.autocad.customization
      ;;
      ;; (setq folder (BrowseForFolder))
      ;;
      (vl-load-com)
      (setq sh
            (vla-getInterfaceObject
              (vlax-get-acad-object) "Shell.Application"))

      (setq folder
            (vlax-invoke-method sh 'BrowseForFolder 0 "" 0))

      (vlax-release-object sh)

      (if folder
        (progn
          (setq folderobject (vlax-get-property folder 'Self))
          (setq result (vlax-get-property FolderObject 'Path))
          (vlax-release-object folder)
          (vlax-release-object FolderObject)
          result
          )
        )
      )
    (if (null (setq path (BrowseForFolder)))
      ;; just in case you didnt specify a path
      nil
      (vl-directory-files path "*.dwg" 1))) )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Nick-LTC

  • Guest
Re: getfiled for multiple dwg selection
« Reply #6 on: April 12, 2007, 02:43:04 PM »
Thanks se7en
I just got back to check, tried it a little it gave me the list. Now I will try to apply it with a list box, when I get a little time.
Nick

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: getfiled for multiple dwg selection
« Reply #7 on: April 12, 2007, 03:31:55 PM »
A little more info on dos_getfilem ...
[ http://www.theswamp.org/index.php?topic=8932.0 ]
TheSwamp.org  (serving the CAD community since 2003)

Patrick_35

  • Guest
Re: getfiled for multiple dwg selection
« Reply #8 on: April 12, 2007, 03:59:26 PM »
Hi
You can try that

Code: [Select]
(setq she (vlax-create-object "userAccounts.CommonDialog"))
(vlax-put she 'filter "Fichiers Texte (*.txt)| *.txt |Tous les fichiers (*.*)|*.*")
(vlax-put she 'filterindex 2)
(vlax-put she 'flags (+ 4 8 512 2048 4096 131072 2097152))
(vlax-put she 'initialdir (getvar "dwgprefix"))

(if (eq (vlax-invoke she 'showopen) -1)
  (vlax-get she 'filename)
)

(vlax-release-object she)

You can add 524288 at the flags for windows interface, but it's don't work correctly :| , or i don't find how work with it.

@+

FengK

  • Guest
Re: getfiled for multiple dwg selection
« Reply #9 on: April 13, 2007, 02:40:10 AM »
Is there a "dummy" way to learn how to incorporate them into lisp routines?
Nick
1. download appropriate version of doslib;
2. save doslib##.arx (where ## is 16 or 17) to a folder, should be one of the support paths;
3. add (arxload "doslib##.arx") to your acad200#doc.lsp, where # is 4,5,6 or 7.

now all doslib functions should be available in vlisp.

hth.






Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: getfiled for multiple dwg selection
« Reply #10 on: April 13, 2007, 03:40:29 AM »
Nick, there is another way to load Dos_Lib you may find easier.

DownLoad and Install the package. Remember where it installs.
Start AutoCAD.
Open explorer and find the Doslibxx.ARX to suit your version,
drag the ARX  into the AutoCAD and drop it on the screen (to load it)
type at the command line (dos_demandload nil) [AutoCAD has just been told to Autoload DosLib WHEN needed.]
Type (dos_ver)
Close AutoCAD
Reopen AutoCAD
type (dos_help)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Nick-LTC

  • Guest
Re: getfiled for multiple dwg selection
« Reply #11 on: April 13, 2007, 11:27:17 AM »
Thanks everyone
I now have the dosLIB installed and working in a lisp routine.  It is something I have needed for years and all it took was one little question to this forum to overturn years of frustration.  I am a happy camper.

 :-D :-) 8-) :lol: :roll: :laugh: ;-)
Nick