ScriptPro <acet:cFolderName> problem

Discussion in 'AutoCAD' started by anthonyholland, Sep 30, 2004.

  1. I am trying to use the <acet:cFolderName> keyword when I store plt files I generate. I get errors when running the script, it appears that the backslashes are getting stripped from the path. Here is the script that works with a letter pathed to store the files in one directory.

    (command ".tilemode" "1")
    (setq expert (getvar "EXPERT"))
    (setvar "EXPERT" 2)
    (command "._psetupin" "Z:/Engineering/Electrical/Plot Scripts/UPS_ELEC_D_PLT" "UPS_PLT")
    (setvar "EXPERT" 0)
    (command ".filedia" "0")
    (command "-plot" "n" "model" "UPS_PLT" "hp designjet 750c (e/a0) color" "y" "p:<acet:cBaseName>.plt" "n" "y")
    (command ".filedia" "1")

    I want to change the plot command to something like this one to store them in the current drawing path instead.

    (command "-plot" "n" "model" "UPS_PLT" "hp designjet 750c (e/a0) color" "y" ""<acet:cFolderName>\\<acet:cBaseName>.plt"" "n" "y")

    Any help would be appreciated. I have a vba script that will create a plotfile directory if it doesn't exist if I can get it to see the drawing path correctly.

    Thanks,
    Anthony
     
    anthonyholland, Sep 30, 2004
    #1
  2. At a rough guess you are trying to use a variable name as a fixed string -
    I think your file name has to be something like (strcat "p:\"
    <acet:cBaseName> ".plt") - on the assumption that <acet:cBaseName> is the
    name of a variable - where does this come from anyway? The acet presumable
    means that it is from Express Tools but I don't think that Express tools has
    anything to do with "plot to file" location but I could be wrong....
     
    George Drayton, Oct 1, 2004
    #2
  3. the <acet:xxxx> are built is system variables from ScriptPro. I found them in the documentation.

    ScriptPro Keywords

    Keywords can be used to specify the current file name and its directory. When ScriptPro runs, it will replace each keyword with the correct value before processing the script. This is done for each drawing file after it has been opened so that the keywords are always replaced with the correct values from the current drawing.

    <acet:cFolderName> Specifies the drawing file folder name (directory name).
    <acet:cBaseName> Specifies the base file name without a directory or extension.
    <acet:cExtension> Specifies the extension for the drawing file (.dwg, .dwt, or .dxf)
    <acet:cFileName> Specifies the base name with the extension. This will have the same value as the DWGNAME system variable.
    <acet:cFullFileName> Specifies the full file name with path and extension.

    These keywords can be used anywhere in your script and are not case-sensitive. Where appropriate, you should enclose the keywords in double quotes to accommodate long file and directory names. For example, the following script segment will save the drawing in the same directory but with 02 appended to the original name. The quotes are used to assure that even if the directory or the file name includes spaces, AutoCAD will interpret them as part of the file name. (The SCR-SAVEAS-2000 command is described in more detail in the ScriptPro Saving Commands section.)

    scr-saveas-2000 <acet:cFolderName><acet:cBaseName>02.dwg
     
    anthonyholland, Oct 4, 2004
    #3
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.