Results 1 to 3 of 3

Thread: Help Setting Table Column Style Property

  1. #1
    Member
    Join Date
    2013-06
    Posts
    4
    Login to Give a bone
    0

    Post Help Setting Table Column Style Property

    Can anyone tell me how to set the Column Style Property in a table via code? LISP/VBA is preferred, but I'll work with whatever I can get.

    I've got a bunch of Sheet List Tables linked to the sheet set, and I need to apply a different Column Style to each column. By hand, I can set the column style to anything I've set up in the Table Style, but I'd like to automate the process.

    Through code, I can apply it as an override to each individual cell, but that doesn't help when the table gets updated, and new sheets are added. The added rows at the bottom of the table will inherit the default column style (the "data" style), without any overrides.
    Note that, in the attached image, I've changed the attribute on a single cell, but the Column Style property gets applied to the entire column.

    Can anyone point me in the right direction? I've looked through the LISP and VBA documentation and couldn't find a way to access this setting.

    Attached Images Attached Images

  2. #2
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,500
    Login to Give a bone
    0

    Default Re: Help Setting Table Column Style Property

    Not a lot of Tables used here, so to take a stab in the dark...

    For LISP - if you're adding the rows yourself consider the InsertRoAndInherit() Method, of if post-processing following a Sheet Set Event, perhaps simply a call to either SetCellDataType() or SetDataFormat() Methods.

    You might consider comparing a customized Table against a non customized table in terms of DXF and/or MgdDbg to know more.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    I could stop if I wanted to
    Join Date
    2003-07
    Posts
    345
    Login to Give a bone
    0

    Default Re: Help Setting Table Column Style Property

    You may be able to override the style using something like this, or you may need to alter the table style rather than the actual table.

    Code:
    (setq obj (vlax-ename->vla-object (car (entsel "\nPick table object"))))
    (vla-setcolumnwidth objtable 0 15) ; 0 is first column
    (vla-setcolumnwidth objtable 1 30)
    (vla-setcolumnwidth objtable 2 60)
    ; the setcolumnstyle may be a variable that can be set
    ; need a dwg to test

Similar Threads

  1. Replies: 1
    Last Post: 2017-11-13, 01:09 PM
  2. Replies: 1
    Last Post: 2008-05-16, 05:57 AM
  3. Setting Plot Style Table in Lisp
    By fletch97 in forum AutoLISP
    Replies: 11
    Last Post: 2007-01-30, 09:43 PM
  4. Replies: 1
    Last Post: 2006-12-12, 07:36 AM
  5. Replies: 1
    Last Post: 2006-10-13, 04:58 PM

Posting Permissions

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