Results 1 to 3 of 3

Thread: Modify text styles in a tablestyle

  1. #1
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Modify text styles in a tablestyle

    Hello again gang,

    I have been trying to purge an errant text style from a bunch of drawings here. I've traced it to a table style. Easy enough to edit the table style in the template, but for all the existing drawings... its a pain.

    I'm looking for a lisp routine that will:


    1. Check for the existence of tablestyle "MVVA Standard"
    2. Change the text style used in data fields from Style A to Style B
    3. Change the text style used in header fields from Style C to Style D
    4. Change the text style used in title fields from Style E to Style F


    It's simply beyond my capabilities I'm afraid. Any guidance is as always, much appreciated.

    -JP

  2. #2
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Re: Modify text styles in a tablestyle

    OK... well the code below seems to work (the text styles in the tablestyle dialog box change as does the text in the existing tables). However, I am still unable to purge the errant styles until I delete the tables.

    Code:
    (vl-load-com)
    (defun c:CreateTableStyle()
        ;; Get the AutoCAD application and current document
        (setq acad (vlax-get-acad-object))
        (setq doc (vla-get-ActiveDocument acad))
    
        ;; Get the Dictionaries collection and the TableStyle dictionary
        (setq dicts (vla-get-Dictionaries doc))
        (setq dictObj (vla-Item dicts "acad_tablestyle"))
       
        ;; Create a custom table style
        (setq key "MVVA STandard"
              class "AcDbTableStyle")
        (setq custObj (vla-AddObject dictObj key class))
    
        ;; Set the name and description for the style
        (vla-put-Name custObj "MVVA Standard")
        (vla-put-Description custObj "MVVA Standard Table Style")
    
        ;; Sets the bit flag value for the style
        (vla-put-BitFlags custObj 1)
    
        ;; Set the text height and style for the Title row[/QUOTE][/QUOTE]
        (vla-SetTextStyle custObj (+ acDataRow) "MVVA 1-8")
        (vla-SetTextStyle custObj (+ acHeaderRow) "MVVA 1-8 Light Bold")
        (vla-SetTextStyle custObj (+ acTitleRow) "MVVA 3-16 Light Bold")
    
      (princ)
    )

  3. #3
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Re: Modify text styles in a tablestyle

    One more small bit of info.

    The text styles must be stored in the table object(s) because I can change them to a different table style altogether (one that does not use the errant text style) and I still can't purge the styles from the drawing.

    *sigh*

Similar Threads

  1. Merge Text Styles ie LAYMRG but for text styles
    By dustin692884 in forum AutoLISP
    Replies: 11
    Last Post: 2018-05-01, 11:59 AM
  2. Modify Wall Styles on Multiple Drawing Files
    By CADdancer in forum ACA General
    Replies: 3
    Last Post: 2009-06-23, 08:19 PM
  3. Sharing standard Dimension styles, text styles, hatch patterns, etc
    By dhavalpatel_us337373 in forum AutoCAD General
    Replies: 1
    Last Post: 2007-02-02, 08:34 PM
  4. Setup Correct Layers,Dim Styles,Text Styles
    By rhayes.99001 in forum AutoLISP
    Replies: 7
    Last Post: 2007-01-23, 05:49 PM
  5. Door styles to modify
    By Matt Mercer in forum ACA General
    Replies: 0
    Last Post: 2005-04-29, 02:59 AM

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
  •