Filename Limit Again

Discussion in 'AutoCAD' started by Ibro Vehabovic, Jun 26, 2004.

  1. In February I posted the following:
    and Stephan Koster replied:> It is a bug. The filename limit is 126
    characters. The same
    How to get the DOS-filename?Thanks in advance.Ibro V.
     
    Ibro Vehabovic, Jun 26, 2004
    #1
  2. Ibro,

    This might help.

    (setq Pathe(getvar,"dwgprefix")
    filename(getvar,"dwgname")
    )

    W. Kirk Crawford
    Rochester Hills, Michigan
     
    W. Kirk Crawford, Jun 26, 2004
    #2
  3. Ibro,

    I don't know what I was thinking.

    Sorry.

    W. Kirk Crawford
    Rochester Hills, Michigan
     
    W. Kirk Crawford, Jun 26, 2004
    #3
  4. Ibro Vehabovic

    Jürg Menzi Guest

    Hi Ibro

    Use this function to get the short path/name:
    ;
    ; -- VxGetShortName
    ; Returns the short path/name used by programs that require the earlier 8.3
    ; file naming convention.
    ; Copyright:
    ; ©2004 MENZI ENGINEERING GmbH, Switzerland
    ; Arguments [Typ]:
    ; Fil = Filename "C:\\Program Files\\ScrapFolder\\ScrapInit.dll" [STR]
    ; Return [Typ]:
    ; > Short path/name [STR]
    ; > nil if file doesn't exist
    ; Notes:
    ; - Requires ScrRun.dll.
    ;
    (defun VxGetShortName (Fil / FilObj FilSys RetVal)
    (setq FilSys (vlax-create-object "Scripting.FileSystemObject")
    RetVal (cond
    ((= (vlax-invoke FilSys "FileExists" Fil) 0) nil)
    ((setq FilObj (vlax-invoke FilSys "GetFile" Fil))
    (vlax-get FilObj "ShortPath")
    )
    (T nil)
    )
    )
    (if FilObj (vlax-release-object FilObj))
    (vlax-release-object FilSys)
    RetVal
    )

    Don't forget to initialize Visual LISP extension by (vl-load-com). This
    function requires also ScrRun.dll from Windows Script Components:
    http://msdn.microsoft.com/scripting
    (WinNT4/Win9x only, included in Win2k/XP+).

    Cheers
     
    Jürg Menzi, Jun 28, 2004
    #4
  5. Jürg,
    It worked great - thanks a lot!
    Ibro V.
     
    Ibro Vehabovic, Jun 29, 2004
    #5
  6. Ibro Vehabovic

    Jürg Menzi Guest

    Hi Ibro

    Welcome...:cool:

    Cheers
     
    Jürg Menzi, Jun 29, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.