Script for Export

Discussion in 'AutoCAD' started by Juan Silva, Nov 13, 2004.

  1. Juan Silva

    Juan Silva Guest

    Hi everyone,

    I work with Architectural Desktop 2005 and sometimes I need to convert
    drawings to 2000 format. I prefer using the Export to AutoCAD 2000 command.
    I wrote the following script to automate the process and it works well, but
    it adds the prefix ACAD- to all the converted drawings:

    filedia
    0
    aecexporttoautocad2000

    filedia
    1

    The reason it has to add the prefix is because Windows would not allow it to
    overwrite a file while it's open, so it has to rename the file. I thought
    if I could save it to another folder I wouldn't have to rename it. So I
    added a line as follows:

    filedia
    0
    aecexporttoautocad2000
    (strcat "c:/temp/" (getvar "dwgname"))
    filedia
    1

    But its not working. I'm guessing that the strcat can't be used in this
    situation. Can anyone tell me how this should be written so I can save the
    file to a different folder?

    Thanks,
    Juan
     
    Juan Silva, Nov 13, 2004
    #1
  2. Hello, Juan!

    You can SAVEAS.
    It works for me.

    ;------------------------------------
    FILEDIA
    0
    SAVEAS
    2000

    Y
    FILEDIA
    1
    ;-----------------------------------

    You wrote on Fri, 12 Nov 2004 17:16:14 -0800:

    JS> I work with Architectural Desktop 2005 and sometimes I need to convert
    JS> drawings to 2000 format. I prefer using the Export to AutoCAD 2000
    JS> command. I wrote the following script to automate the process and it
    JS> works well, but it adds the prefix ACAD- to all the converted drawings:

    JS> filedia
    JS> 0
    JS> aecexporttoautocad2000

    JS> filedia
    JS> 1

    JS> The reason it has to add the prefix is because Windows would not allow
    JS> it to overwrite a file while it's open, so it has to rename the file.
    JS> I thought if I could save it to another folder I wouldn't have to
    JS> rename it. So I added a line as follows:

    JS> filedia
    JS> 0
    JS> aecexporttoautocad2000
    JS> (strcat "c:/temp/" (getvar "dwgname"))
    JS> filedia
    JS> 1

    JS> But its not working. I'm guessing that the strcat can't be used in
    JS> this situation. Can anyone tell me how this should be written so I can
    JS> save the file to a different folder?

    With best regards, Anatoliy Kurgan.
     
    Anatoliy Kurgan, Nov 13, 2004
    #2
  3. Juan Silva

    ECCAD Guest

    Try this sequence:

    filedia
    0
    (setq filename (strcat "c:/temp/" (getvar "dwgname")))
    aecexporttoautocad2000
    filename
    filedia
    1

    Bob
     
    ECCAD, Nov 13, 2004
    #3
  4. Juan Silva

    Juan Silva Guest

    I already got a the code I needed from someone else, but I just wanted to
    point out that the SAVEAS and the Batch Conversion program only work
    correctly with plain AutoCAD. With Architectural Desktop they cause ARX
    errors to appear when the files are opened with older versions of
    Architectural Desktop. The Exporttoautocad2000 command does not generate
    these errors (although it gets rid of all the ADT info).

    I wish Autodesk would generate a batch conversion program for ADT; one that
    doesn't generate the ARX errors and doesn't convert the AEC info in
    primatives.

    Juan
     
    Juan Silva, Nov 15, 2004
    #4
  5. Juan Silva

    Juan Silva Guest

    Thanks, this looked very promising, but unfortunatelly it didn't work. I
    get the following error: "Can not write to directory." I tried the
    commands, one at a time and I get the error after I type filename. When I
    get out of the export command I can type (princ filename) and it shows me
    the correct path, c:/temp/drawing1.dwg. While in the export command if I
    type the full path c:/temp/drawing1.dwg, then it works fine. It seems like
    the exporttoautocad2000 command does not allow strings to be called up.

    Juan
     
    Juan Silva, Nov 15, 2004
    #5
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.