See the top rated post in this thread. Click here

Results 1 to 10 of 12

Thread: Setting Plot Style Table in Lisp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Setting Plot Style Table in Lisp

    Afternoon -

    I need to build into my lisp a way to set the appropriate plot style table and make it active.

    I've searched through the forums here and no one really gave an answer, so please do not post links to other posts!

    I've tried the following list with nothing working.....

    (vla-RefreshPlotDeviceInfo objLayout)
    (vla-Put-StyleSheet objLayout "MyStyle.stb")

    ThisDrawing.ActiveLayout.StyleSheet = "MyStyle.stb"

    (vl-load-com)
    (vla-put-PrinterStyleSheetPath (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))) "MyStyle.stb")

    I've attached a pic of the tool itself from the options dialog box but I need a way of doing this from the command line for the lisp routine.

    Any suggestions?
    Attached Images Attached Images

  2. #2
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,720
    Login to Give a bone
    1

    Default Re: Setting Plot Style Table in Lisp

    So are you trying to set "default" STB file (for use with R14 and previous drawings - as your photo shows), or are you trying to set the current STB file for a particular layout?

    IF the former...

    Code:
     (setq o (vla-get-Output (vla-get-Preferences (vlax-get-acad-object))))
     (vla-put-PlotPolicy o 0)
     (vla-put-DefaultPlotStyleTable o "monochrome.stb")
    IF the latter.....

    See this post for an example of setting the "stylesheet" for multiple layouts in multiple drawings.

    If you just want to operate on the current layout, then here is a lisp example:

    Code:
      (vla-put-StyleSheet
        (vla-get-ActiveLayout
      	(vla-get-ActiveDocument (vlax-get-acad-object))
        )
        "monochrome.stb"
      )
    Last edited by rkmcswain; 2007-01-30 at 02:36 AM.
    R.K. McSwain | CAD Panacea |

  3. #3
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Re: Setting Plot Style Table in Lisp

    I am getting the following error on both routines.....

    "Automation Error. Invalid input"

    What's that?

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,449
    Login to Give a bone
    0

    Default Re: Setting Plot Style Table in Lisp

    Quote Originally Posted by fletch97
    I am getting the following error on both routines.....

    "Automation Error. Invalid input"

    What's that?
    Have you run the following function?
    Code:
    (vl-load-com)
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    I could stop if I wanted to
    Join Date
    2004-12
    Location
    California
    Posts
    283
    Login to Give a bone
    0

    Default Re: Setting Plot Style Table in Lisp

    Nope but I just added it in and I got the same error for the second routine and basically the same error for the first routine except it says "invalid argument" instead of "input".

    Any Ideas?

  6. #6
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473
    Login to Give a bone
    0

    Default Re: Setting Plot Style Table in Lisp

    Quote Originally Posted by fletch97
    Nope but I just added it in and I got the same error for the second routine and basically the same error for the first routine except it says "invalid argument" instead of "input".

    Any Ideas?
    If you did a staight copy and paste of RK's code, does monochrome.stb exist?

    Or if you changed it, can Autocad find the one you are trying to set?

    Just a guess, though.

    HTH
    Tim Creary
    S&D
    DILLIGAF

Similar Threads

  1. Change All Layers' Plot Style Setting
    By parker.depriest356295 in forum AutoLISP
    Replies: 1
    Last Post: 2013-02-05, 07:05 PM
  2. setting the plot style
    By rstiles in forum AutoLISP
    Replies: 5
    Last Post: 2012-02-10, 07:54 PM
  3. Unable to edit plot style table though plot dialog box
    By mike.smith696451 in forum Land Desktop - General
    Replies: 5
    Last Post: 2006-12-20, 03:11 PM
  4. Replies: 1
    Last Post: 2006-10-13, 04:58 PM
  5. Plot style Table
    By rputhenv in forum AutoCAD Plotting
    Replies: 5
    Last Post: 2005-03-05, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •