Problem using GETFILED

Problem using GETFILED

Anonymous
Not applicable
793 Views
21 Replies
Message 1 of 22

Problem using GETFILED

Anonymous
Not applicable
With AutoCAD 14, if I type the following at the command prompt:

(setq a (getfiled "Select a Drawing file" "" "dwg" 8))

I get the dialog box to select the file. As long as I do not change the
directory or folder
AutoCAD returns the filename that I selected with no path.

If I do the exact same thing in AutoCAD 2000, I get the full path.

How can I get the filename only?

Thanks
Dennis
0 Likes
794 Views
21 Replies
Replies (21)
Message 21 of 22

Anonymous
Not applicable
Pretty slick little tool isn't it? That's how I found the ACET functions.
The Express Tools has far more many tools than the documentation would have
us believe.

--
Get free software and more at:
http://msnhomepages.talkcity.com/protectionfault/foquendo

"David Doane" wrote in message
news:01bf7018$223e56a0$8c57d2d0@lms-1...
> OK. Found the APROPOS window. Never use Vlide. I just saw another post
> concerning it and took a look-see.
> --
> Dave
>
> Frank Oquendo wrote in article
> <[email protected]>...
> > It shows up in my APROPOS window when I search on ACET. You just feed it
> the
> > full path and it returns only the filename: (acet-filename-path-remove
> > (findfile "acad.exe")) yields "acad.exe" whereas findfile returns the
> full
> > path. I'm using ACETUTIL.ARX ver 1.35. You can check your version by
> calling
> > (acet-util-ver)
> >
> > --
> > Get free software and more at:
> > http://msnhomepages.talkcity.com/protectionfault/foquendo
> >
> >
> > "David Doane" wrote in message
> > news:01bf7002$9fb8d800$1d57d2d0@lms-1...
> > > Frank,
> > >
> > > Where did you come up with ACET-FILENAME-PATH-REMOVE, and how is it
> used?
> > > It isn't in the listing that I have.
> > > --
> > > Dave D
>
0 Likes
Message 22 of 22

Anonymous
Not applicable
This version works on all platforms:

(car (dos_getfilem "Select Drawings" "C:\\DRAWINGS\\" "Drawing Files
(*.DWG)|*.DWG"))

Dale

"David Doane" wrote in message
news:01bf7012$d97048c0$8c57d2d0@lms-1...
> Well, ain't you the hotsy-totsy?
>
> Like I've said before, if you're as tight with everything else as you are
> with your code, when you break wind only the dogs can hear it.
>
> So using your little tech-ni-que, and exhibit might look like:
>
> ;;;For drawing name only in any drawing directory:
>
> (defun c:getfila ()
> (if (setq a (getfiled "Select a Drawing file" "" "dwg" 8))
> (progn
> (while (wcmatch a "*[\\/]*") (setq a (substr a 2)))
> (princ a)
> )
> (prompt "\nYou canceled. ")
> )
> (princ)
> )
>
> ;;;For R14 behavior with GetFileD:
>
> (defun c:getfilb ()
> (if (setq a (getfiled "Select a Drawing file" "" "dwg" 8))
> (progn
> (if (wcmatch a (strcat (getvar "dwgprefix")"*"))
> (while (wcmatch a "*[\\/]*") (setq a (substr a 2)))
> )
> (princ a)
> )
> (prompt "\nYou canceled. ")
> )
> (princ)
> )
>
> Of course you will probably cut that by two-thirds as well.
>
> I'm goin' back to sleep .......
> --
> Dave D
>
>
>
> Michael Puckett wrote in article
> <[email protected]>...
> > (defun strip-path (str)
> > (if (wcmatch str "*[\\/]*") (strip-path (substr str 2)) str)
> > )
> >
> > e.g.
> >
> > (strip-path "c:\\acad\\sample\\yadayadayada\\drawing.dwg")
> >
> > returns "drawing.dwg"
> >
> > __________________________________
> >
> > Michael Puckett
> > [email protected]
> > > Not < an Autodesk hall monitor.
> > Imagination makes all things possible.
> > __________________________________
> >
> > "Dennis S. Nunes" wrote in message
> > news:[email protected]...
> > With AutoCAD 14, if I type the following at the command prompt:
> >
> > (setq a (getfiled "Select a Drawing file" "" "dwg" 8))
> >
> > I get the dialog box to select the file. As long as I do not change the
> > directory or folder
> > AutoCAD returns the filename that I selected with no path.
> >
> > If I do the exact same thing in AutoCAD 2000, I get the full path.
> >
> > How can I get the filename only?
> >
> > Thanks
> > Dennis
> >
> >
> >
> >
> >
0 Likes