Results 1 to 2 of 2

Thread: Change All Layers' Plot Style Setting

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2013-02
    Posts
    1
    Login to Give a bone
    0

    Default Change All Layers' Plot Style Setting

    I'm trying to write some code that will
    1) set the current plot style table to "BCR Plot Style.stb"
    2) change all layer properties to plot style name "Grayscale"

    Code:
    (defun c:grayscale ()
    
    (vl-load-com)
      
     (vla-put-StyleSheet
        (vla-get-ActiveLayout
      	(vla-get-ActiveDocument (vlax-get-acad-object))
        )
        "BCR Plot Style.stb"
      )
    
        (setq layers (vla-get-layers
       (vla-get-ActiveDocument (vlax-get-acad-object))
            )
      )
      (vlax-for l layers
        (progn
     	(vla-put-plotstylename l "Grayscale")
        )
      )
     )
    
      )


    This routine works after I go into the layer properties manager, highlight all layers, change the plot style to "Grayscale" and then back to "Normal".
    It's like it hasn't recognized "Grayscale" as a valid option until it has been manually set.

    Is there some way I can make AutoCAD "recognize" Grayscale as a valid option from the beginning?
    I feel like this would be a tblsearch or something similar, but would appreciate any suggestions.

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

    Default Re: Change All Layers' Plot Style Setting

    Your desired plot style is not initially listed in the dictionary list. By manually changing it, AutoCAD is adding it to the list. You could change your code to use the command line version of the layer command. It allows the setting of unloaded plot styles.
    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

Similar Threads

  1. Batch Plot Style Change
    By OCD in forum AutoCAD Plotting
    Replies: 7
    Last Post: 2019-03-18, 04:09 PM
  2. 2012: Can I change plot style with lisp or script?
    By dolan.raynor in forum AutoCAD General
    Replies: 3
    Last Post: 2013-07-18, 01:19 PM
  3. setting the plot style
    By rstiles in forum AutoLISP
    Replies: 5
    Last Post: 2012-02-10, 07:54 PM
  4. Setting Plot Style Table in Lisp
    By fletch97 in forum AutoLISP
    Replies: 11
    Last Post: 2007-01-30, 09:43 PM
  5. CHANGE PLOT STYLE TABLE
    By eng5 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-03-08, 01:09 PM

Tags for this Thread

Posting Permissions

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