1 Attachment(s)
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.
http://forums.augi.com/attachment.ph...d=102608&stc=1
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
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