TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Guest on July 18, 2007, 09:52:55 AM

Title: Select Multiple Files
Post by: Guest on July 18, 2007, 09:52:55 AM
Is there a VLisp command for selecting mutliple files, similar to vl-directory-files?
Title: Re: Select Multiple Files
Post by: jbuzbee on July 18, 2007, 09:55:41 AM
Can you use it in a sentence?  :-P

Sorry, I mean how would you use it?
Title: Re: Select Multiple Files
Post by: MP on July 18, 2007, 09:58:23 AM
Not sure I know what you mean, but perhaps dcl_MultiFileDialog.

{ shrugs }
Title: Re: Select Multiple Files
Post by: CADaver on July 18, 2007, 10:06:08 AM
I use a function from Robert McNeel's DOSLIB functions  HERE  (http://www.en.na.mcneel.com/doslib.htm)

Looks sorta like this:
Code: [Select]
(dos_getfilem "Select File" (getvar "DWGPREFIX") "Drawing Files (*.DWG)|*.DWG")
I'm sure someone here can code up a lispy replacement, I think I saw one somewhere.
Title: Re: Select Multiple Files
Post by: Guest on July 18, 2007, 10:31:13 AM
I use a function from Robert McNeel's DOSLIB functions  HERE  (http://www.en.na.mcneel.com/doslib.htm)

Looks sorta like this:
Code: [Select]
(dos_getfilem "Select File" (getvar "DWGPREFIX") "Drawing Files (*.DWG)|*.DWG")
I'm sure someone here can code up a lispy replacement, I think I saw one somewhere.

That's what I was looking for.
Thanks!

*I was just thumbing throw the DosLib help.  Wonder how I missed that one.  :?*
Title: Re: Select Multiple Files
Post by: Mark on July 18, 2007, 10:39:14 AM
Not sure I know what you mean, but perhaps dcl_MultiFileDialog.

Is that equivalent to the doslib function dos_getfilem?
Title: Re: Select Multiple Files
Post by: CADaver on July 18, 2007, 10:56:33 AM
I use a function from Robert McNeel's DOSLIB functions  HERE  (http://www.en.na.mcneel.com/doslib.htm)

Looks sorta like this:
Code: [Select]
(dos_getfilem "Select File" (getvar "DWGPREFIX") "Drawing Files (*.DWG)|*.DWG")
I'm sure someone here can code up a lispy replacement, I think I saw one somewhere.

That's what I was looking for.
Thanks!

*I was just thumbing throw the DosLib help.  Wonder how I missed that one.  :?*
I use it to XREF a couple dozen files all at once, it's one of my fav's.
Title: Re: Select Multiple Files
Post by: Guest on July 18, 2007, 10:58:52 AM
I use it to XREF a couple dozen files all at once, it's one of my fav's.

What version of ACAD are you running?  You can xref multiple files at once in '07 and '08.  I think you could even do it back in '05, but I'm not 100% sure about that.
Title: Re: Select Multiple Files
Post by: MP on July 18, 2007, 10:59:01 AM
Not sure I know what you mean, but perhaps dcl_MultiFileDialog.

Is that equivalent to the doslib function dos_getfilem?

Yep. I wouldn't have suggested it but I was under the impression you were already using OpenDCL, so it's already at your disposal.

Examples:

Code: [Select]
(dcl_MultiFileDialog
    (list
        "Drawings (*.dwg)|*.dwg"
        "Templates (*.dwt)|*.dwt"
    )
    "Select the drawings(s):"
    "c:\\"
)

Or ...

Code: [Select]
(dcl_MultiFileDialog
    (list "Drawings (*.dwg,*.dwt)|*.dwg;*.dwt")
    "Select the drawings(s):"
    "c:\\"
)

:)
Title: Re: Select Multiple Files
Post by: Guest on July 18, 2007, 11:00:15 AM
Not sure I know what you mean, but perhaps dcl_MultiFileDialog.

Is that equivalent to the doslib function dos_getfilem?

Yep. I wouldn't have suggested it but I was under the impression you were already using OpenDCL, so it's already at your disposal.

Examples:

Code: [Select]
(dcl_MultiFileDialog
    (list
        "Drawings (*.dwg)|*.dwg"
        "Templates (*.dwt)|*.dwt"
    )
    "Select the drawings(s):"
    "c:\\"
)

Or ...

Code: [Select]
(dcl_MultiFileDialog
    (list "Drawings (*.dwg,*.dwt)|*.dwg;*.dwt")
    "Select the drawings(s):"
    "c:\\"
)

:)

Do you have to add the FILE DIALOG BOX to the project?
Title: Re: Select Multiple Files
Post by: CADaver on July 18, 2007, 11:08:03 AM
I use it to XREF a couple dozen files all at once, it's one of my fav's.

What version of ACAD are you running?  You can xref multiple files at once in '07 and '08.  I think you could even do it back in '05, but I'm not 100% sure about that.
About half our staff is still running R2002 <edit> and dcl_MultiFileDialog is not available.
Title: Re: Select Multiple Files
Post by: MP on July 18, 2007, 11:13:55 AM
Do you have to add the FILE DIALOG BOX to the project?

No -- dcl_MultiFileDialog is a self reliant bonus function included in the OpenDCL arx run time.

PS: If you're using an older version of Object/OpenDCL the function would be named odcl_MultiFileDialog.

:)
Title: Re: Select Multiple Files
Post by: CADaver on July 18, 2007, 01:30:54 PM
Do you have to add the FILE DIALOG BOX to the project?

No -- dcl_MultiFileDialog is a self reliant bonus function included in the OpenDCL arx run time.

PS: If you're using an older version of Object/OpenDCL the function would be named odcl_MultiFileDialog.

:)
Ahh cool, thanks, I'll look.
Title: Re: Select Multiple Files
Post by: LE on July 18, 2007, 01:54:25 PM
And as a last resource, or if one of these days.... here is the C# alternative

Code: [Select]
[CommandMethod("GETMFILES")]
public void getmfiles()
{
    OpenFileDialog dlg = new OpenFileDialog("Title: Open Drawings", "", "dwg", "Your Dialog Name", OpenFileDialog.OpenFileDialogFlags.AllowMultiple);
    if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
    string[] files = dlg.GetFilenames();
    foreach (string f in files)
    {
        //do your stuff here
    }
}
Title: Re: Select Multiple Files
Post by: Mark on July 18, 2007, 02:47:06 PM
Not sure I know what you mean, but perhaps dcl_MultiFileDialog.

Is that equivalent to the doslib function dos_getfilem?

Yep. I wouldn't have suggested it but I was under the impression you were already using OpenDCL, so it's already at your disposal.
Nice! Screen shot please. :-)
Title: Re: Select Multiple Files
Post by: MP on July 18, 2007, 03:13:17 PM
Nice! Screen shot please. :-)

(http://www.theswamp.org/screens/mp/dcl_mutifiledialog.png)

AutoCAD 2008 / OpenDCL 4.0 RC3 / Vista Ultra / Medium icon mode.

{  reduced colors to 256 after screen grab, it looks richer than this actually }
Title: Re: Select Multiple Files
Post by: MP on July 18, 2007, 03:36:04 PM
Another piccy, same specs as before except detail view with multiple files selected ...

(http://www.theswamp.org/screens/mp/dcl_mutifiledialog2.png)
Title: Re: Select Multiple Files
Post by: LE on July 18, 2007, 06:41:38 PM
About half our staff is still running R2002

I have not read anywhere if it is going to be available for pre - 2004 AutoCAD versions.... maybe it will - the arx binaries I have seen are for 2004-2008
Title: Re: Select Multiple Files
Post by: CADaver on July 18, 2007, 06:59:27 PM
About half our staff is still running R2002

I have not read anywhere if it is going to be available for pre - 2004 AutoCAD versions.... maybe it will - the arx binaries I have seen are for 2004-2008
By the end of the year we hope to be fully embedded with R2008
Title: Re: Select Multiple Files
Post by: LE on July 18, 2007, 07:07:37 PM
By the end of the year we hope to be fully embedded with R2008

That it is going to be good! - I just started with a2007 jumping from a2005, have my copy of a2008 and do not know when I am going to start with that....  :-(

Note to the people from OpenDCL... Where is the information about what AutoCAD and verticals products OpenDCL will be supporting? - Thank you - in the mean time I'll go and check their new site.
Title: Re: Select Multiple Files
Post by: Kerry on July 18, 2007, 07:11:58 PM
Note to the people from OpenDCL... Where is the information about what AutoCAD and verticals products OpenDCL will be supporting? - Thank you - in the mean time I'll go and check their new site.

http://www.opendcl.com/HelpFiles/main.html
Title: Re: Select Multiple Files
Post by: LE on July 18, 2007, 07:13:16 PM
Note to the people from OpenDCL... Where is the information about what AutoCAD and verticals products OpenDCL will be supporting? - Thank you - in the mean time I'll go and check their new site.

http://www.opendcl.com/HelpFiles/main.html

Perfect! thanks.