Author Topic: Rename directory with vlisp?  (Read 6137 times)

0 Members and 1 Guest are viewing this topic.

laidbacklarry

  • Guest
Rename directory with vlisp?
« on: October 04, 2011, 11:37:20 AM »
I know this can be done with dos_rendir from doslib, but we'd like to port all doslib functions (that we use) to lisp. This  is the only one we're stuck on... Thanks for any help

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Rename directory with vlisp?
« Reply #1 on: October 04, 2011, 11:39:57 AM »
vl-file-rename

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Rename directory with vlisp?
« Reply #2 on: October 04, 2011, 11:45:04 AM »
e.g.

(vl-file-rename "c:\\docs\\rtfm" "c:\\docs\\lol-ok")
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

laidbacklarry

  • Guest
Re: Rename directory with vlisp?
« Reply #3 on: October 04, 2011, 11:51:18 AM »
Thanks, guys...

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Rename directory with vlisp?
« Reply #4 on: October 04, 2011, 12:47:59 PM »
e.g.

(vl-file-rename "c:\\docs\\rtfm" "c:\\docs\\lol-ok")
  :-D
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Rename directory with vlisp?
« Reply #5 on: October 04, 2011, 02:03:56 PM »
If you do a search HERE you come up empty if you search for vl-file-rename *shrug*
TheSwamp.org  (serving the CAD community since 2003)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Rename directory with vlisp?
« Reply #6 on: October 04, 2011, 02:05:53 PM »
Code: [Select]
vl-file-rename
 
 
 
Renames a file

(vl-file-rename old-filename new-filename)Arguments

old-filename
A string containing the name of the file you want to rename. If you do not specify a full path name, vl-file-rename looks in the AutoCAD default drawing directory.

new-filename
A string containing the new name to be assigned to the file.

NoteIf you do not specify a path name, vl-file-rename writes the renamed file to the AutoCAD default drawing directory.
Return Values

T, if renaming completed successfully; nil if renaming failed.

Examples

_$ (vl-file-rename "c:/newauto.bat"
"c:/myauto.bat")TNoteIf the target file already exists, this function fails.
Please send us your comments about this page

Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Rename directory with vlisp?
« Reply #7 on: October 04, 2011, 02:16:45 PM »

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Rename directory with vlisp?
« Reply #8 on: October 04, 2011, 03:01:21 PM »
So RTFM would have been absolutely useless to the OP.
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Rename directory with vlisp?
« Reply #9 on: October 04, 2011, 04:18:18 PM »
The rtfm was offered purely for levity, hope it was taken same. Unfortunately Autodesk authors their help much like the Microsoft docs, insomuch as sometimes things are implied or just left out. For example the MoveFolder method of the File System Object can be used to rename a folder but the docs don't reveal that. Chocolate chips cookies for every one in the thread.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Rename directory with vlisp?
« Reply #10 on: October 04, 2011, 04:20:53 PM »
The rtfm was offered purely for levity, hope it was taken same. Unfortunately Autodesk authors their help much like the Microsoft docs, insomuch as sometimes things are implied or just left out. For example the MoveFolder method of the File System Object can be used to rename a folder but the docs don't reveal that. Chocolate chips cookies for every one in the thread.
What's that, you were able to do something with a command that isn't document? Yeah, that's just an undocumented feature we didn't think you plebeians would care to know about.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

jaydee

  • Guest
Re: Rename directory with vlisp?
« Reply #11 on: October 04, 2011, 04:39:16 PM »
Something else u might want to consider

http://www.bulkrenameutility.co.uk/Screenshots.php

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Rename directory with vlisp?
« Reply #12 on: October 04, 2011, 04:46:38 PM »
No hate, but not sure how this:



will help the OP pen alternates for doslib functions.

On another note, that interface gave me an aneurysm. :doa:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Rename directory with vlisp?
« Reply #13 on: October 04, 2011, 05:07:57 PM »
The rtfm was offered purely for levity, hope it was taken same.
Then I apologize, I took offense to it.

OK, I'll leave now ... *grin*
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Rename directory with vlisp?
« Reply #14 on: October 04, 2011, 05:11:09 PM »
My fault, I don't know the audience anymore, so the apologies are mine to make; sorry all.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Maverick®

  • Seagull
  • Posts: 14778
Re: Rename directory with vlisp?
« Reply #15 on: October 04, 2011, 05:38:24 PM »
My fault, I don't know the audience anymore, so the apologies are mine to make; sorry all.

Accepted.  *skips off humming Queen's "Bicycle"*

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Rename directory with vlisp?
« Reply #16 on: October 04, 2011, 05:48:08 PM »
Accepted.  *skips off humming Queen's "Bicycle"*

*takes long bong hit*

"I love you man".
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Rename directory with vlisp?
« Reply #17 on: October 05, 2011, 02:33:16 AM »
On another note, that interface gave me an aneurysm. :doa:
:lmao:

The one I use is makes me "slightly" less nauseas.  ;)

Though not "strictly" part of this thread, I generally use it to rename those DWF/PDF files I generate from publish. I love the Preview idea to see the changes before you actually perform them, makes for less mistakes.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.