Results 1 to 3 of 3

Thread: Help, Table column width

  1. #1
    Member
    Join Date
    2010-03
    Posts
    3
    Login to Give a bone
    0

    Default Help, Table column width

    I've been searching the forums trying to come up with a way to adjust the column width to not word wrap and use a single line of text. Ive mod'ed this routie to scale text to the drawing scale. I get stuck on the column width wants a numeric value...

    (defun c:LISTBLK (/ ss name block blocks insPt table row)
    (vl-load-com)
    (or *acdoc*
    (setq *acdoc* (vla-get-ActiveDocument (vlax-get-acad-object)))
    )
    (or *blocks*
    (setq *blocks* (vla-get-Blocks *acdoc*))
    )

    ;; Select blocks
    (prompt "\nSelect blocks to list or <All>")
    (or (setq ss (ssget '((0 . "INSERT"))))
    (setq ss (ssget "_X" '((0 . "INSERT")))
    )
    )
    (if ss
    (progn

    ;; Build a list of dotted pairs (blockName . numberOfReferences) from the selection set
    (vlax-for x (setq ss (vla-get-ActiveSelectionSet *acdoc*))
    (if (not (vlax-property-available-p x 'Path))
    (setq name (vla-get-EffectiveName x)
    blocks (if (setq block (assoc name blocks))
    (subst (cons name (1+ (cdr block))) block blocks)
    (cons (cons name 1) blocks)
    )
    )
    )
    )
    (vla-delete ss)

    ;; Prompt for inserrtion point
    (initget 1)
    (setq insPt (trans (getpoint "\nInsertion point: ") 1 0))

    ;; Create the table
    (setq table (vla-addtable
    (vla-get-modelspace *acdoc*)
    (vlax-3d-point insPt)
    (+ 2 (length blocks)) ; number of rows (including title and header)
    3 ; number of colums
    0.432632 ; cell height
    1.730527 ; row width
    )
    )

    (vla-put-HorzCellMargin table 0.060000)
    (vla-put-VertCellMargin table 0.060000)
    (vla-put-TitleSuppressed table :vlax-false)
    (vla-put-HeaderSuppressed table :vlax-false)
    (vla-SetTextHeight table acTitleRow (setq DS (getvar "dimscale")G:TS (* 0.1875 DS)))
    (vla-SetTextHeight table (+ acDataRow acHeaderRow) (*(getvar "dimscale")(getvar "dimtxt")))


    ;; Fill the titel and the header
    (vla-setText table 0 0 "Bill of Materials")
    (vla-setcolumnwidth table 0 2) ; 0 is first column
    (vla-setText table 1 1 "QTY.")
    (vla-setcolumnwidth table 1 2)
    (vla-setText table 1 2 "Description")
    (vla-setcolumnwidth table 2 25)
    (vla-setText table 1 0 "Item")

    ;; fill the following rows from the list contents
    (setq row 2)
    (foreach item blocks
    (vla-settext table row 1 (cdr item)) ; references count
    (vla-settext table row 2 (car item)) ; block name
    (setq row (1+ row))
    )
    )
    )
    (princ)
    )

  2. #2
    Member
    Join Date
    2010-03
    Posts
    3
    Login to Give a bone
    0

    Default Re: Help, Table column width

    Is column width something that cant be scaled, or single line text not a option, Im trying to find this last ajustment in the code to allow this BOM to work with all scales.

    I would like to thank you for any input in this matter.

  3. #3
    Member
    Join Date
    2010-03
    Posts
    3
    Login to Give a bone
    0

    Default Re: Help, Table column width

    Maybe somthing along the lines of (vla-setautoscale

Similar Threads

  1. table column width when cell contains field
    By brian.muir in forum AutoCAD Tables
    Replies: 0
    Last Post: 2014-04-02, 04:53 AM
  2. width table column
    By clovis in forum AutoLISP
    Replies: 1
    Last Post: 2012-01-24, 05:46 PM
  3. I can't adjust table column width
    By GreyHippo in forum AutoCAD Tables
    Replies: 0
    Last Post: 2009-04-01, 08:48 PM
  4. Panel Schedule Column Width
    By yeagiy in forum AMEP General
    Replies: 2
    Last Post: 2007-09-12, 03:37 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
  •