Pfad für Plotterkonfigurationsdatei

Hallo,
kann man den Suchpfad für die Plotterkonfigurationsdatei immer auf das Projektverzeichnis setzen.
In acad gibt es hierfür das lsp-Programm linkplotstyle.
Besten Dank im Voraus.

Comments

  • Hallo,

    I'm not familiar with lisp. But here is al link to a PlotCfgPath solution with VBA (in German only, sorry):

    Hope this helps.

    Best regards
    Peter
  • many thanks for the fast help. perfect
    Best regards Jürgen
  • Hi Peter,

    thanks for the link, interesting post and a nice idea.

    Here is the same using LISP
    [code]; SetPlotCfgPath
    ; Sets the Plot Config Path relative to the current drawing
    (defun SetPlotCfgPath ( / dwgpath)
        ; find current drawing path
        (setq dwgpath (getvar "DWGPREFIX"))
        ; Set Plot config path to the drawing path
        (setvar "PlotCfgPath" dwgpath)
        (prin1) ; make a quiet exit
    )[/code]

    BricsCAD makes it easy as most settings are accessible via setvar. This function wouldn't work in AutoCAD.

    You could take this a little further to include the path to Plot Styles, and give the option of using a folder relative to the current drawing
    [code]; SetDwgPlotPaths
    ; Sets the Plot Config &  Plot Style Path relative to the current drawing
    ; Can also set a folder to use
    (defun SetDwgPlotPaths ( / dwgpath plotcfgfolder plotstylefolder plotcfgpath plotstylepath)
        (setq
            dwgpath (getvar "DWGPREFIX") ; find current drawing path
           
            ; set Plot Config folder.
            ; leave blank  "" if you want to use the current drawing folder
            ; enter foldername "plotconfig" to use a subfolder relative to the current drawing folder
            ; prefix "..\\" to the folder name if you want to use a folder relative to the parent folder
            plotcfgfolder "plotconfig"
           
            ; set Plot Style folder.
            ; leave blank  "" if you want to use the current drawing folder
            ; enter foldername "plotstyle" to use a subfolder relative to the current drawing folder
            ; prefix "..\\" to the folder name if you want to use a folder relative to the parent folder
            plotstylefolder "plotstyle"
           
            plotcfgpath (strcat dwgpath plotcfgfolder) ;set plot config path
            plotstylepath (strcat dwgpath plotstylefolder) ;set plot style path
        ) ; end setq

        ; Set Plot Config path relative to the drawing path
        (if (findfile plotcfgpath) ; if the plot config path exists
            (setvar "PlotCfgPath" plotcfgpath) ; THEN set PlotCfgPath
            (princ (strcat "\nPlot Config Folder: " (chr 34) plotcfgpath (chr 34) " not found")) ; ELSE prompt user
        ) ; end if
       
        ; Set Plot Style path relative to the drawing path
        (if (findfile plotstylepath)  ; if the plot style path exists
            (setvar "PlotStylePath" plotstylepath) ; THEN set PlotStylePath
            (princ (strcat "\nPlot Style Folder: " (chr 34) plotstylepath  (chr 34)" not found")); ELSE prompt user
        ) ; end if

     (prin1) ; make a quiet exit
    ) ; end DEFUN SetDwgPlotPaths[/code]

    You would include the function you want to use in your on_doc_load.lsp and then call it using startup function
    [code]; STARTUP
    ; Automatically runs on load
    (defun S::STARTUP ()
        (SetPlotCfgPath) ; set plot config path
        (SetDwgPlotPaths) ; set plot config & style path
        (setq S::STARTUP ())
    (prin1)
    ); end DEFUN S::STARTUP[/code]

    Regards,

    Jason Bourhill

    CAD Concepts


    SetPlotConfig.lsp

  • Hi Jason,

    thank you for your great hint! Sorry, I'm in a hurry, but I will try it out on the weekend.

    Best regards,
    Peter
    IBB Ingenieurbüro Battefeld

  • Hi Jason,

    a little late, but here is my feed back: FINE, Thanks!

    Best regards,
    Peter
    IBB Ingenieurbüro Battefeld Bricscad Blog
This discussion has been closed.