Results 1 to 4 of 4

Thread: Get vla-ObjectID or ename for table cell

  1. #1
    Member
    Join Date
    2015-01
    Posts
    43
    Login to Give a bone
    0

    Default Get vla-ObjectID or ename for table cell

    Is there any way to get the ename or vla-Object reference for an individual cell in a table? I can get them for the table and I can get the column/row of the cell & the value & attributes of the cell, but I can't find anyway to get a vla-Object reference to the cell itself.

    I'm writing a routine that adds a row to the table, increments a sequential mark in the first cell and then opens the second cell for editing via textedit: (command "TEXTEDIT" CellEnameVar pause)

    Any help will be greatly appreciated.

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Get vla-ObjectID or ename for table cell

    Hi,

    Cells don't have any ObjectID but the acad_table object does have so I think you don't need and objectID with your goal of the program since you are after adding columns / rows to table object.

  3. #3
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Get vla-ObjectID or ename for table cell

    here is add rows

    Code:
    (setq tbl (vlax-ename->vla-object (car (entsel "\nPick object"))))
    (setq rws (vla-Get-Rows tbl))
    (vla-InsertRows tbl rws (vla-GetRowHeight tbl (1- rws)) 1)   ;; add 1 number of rows

  4. #4
    Member
    Join Date
    2015-01
    Posts
    43
    Login to Give a bone
    0

    Default Re: Get vla-ObjectID or ename for table cell

    Thanks for your help. What I was looking for was a way to automatically increment the value in the first cell of the added row and then open the second cell of the added row in the TABLEDIT command so the user could directly enter text into the cell. The only thing I can't do is open the second cell for direct editing.

    This is the work-around I came up with:
    - This second cell is always top left justified with 1/8" height ROMAND text

    - I use vla-GetCellExtents for the top-left justification point and vla-getcolumnwidth for the width of the text body

    - I then create an empty MTEXT string with the above values and pass that to the MTEDIT command

    - After the user has finished adding text (which is sitting directly over the cell) I get the value of that text and put it into the cell with vla-SetText and then delete the MTEXT.

    It's a hack but it works fairly seamlessly.

Similar Threads

  1. Replies: 0
    Last Post: 2013-10-31, 08:42 PM
  2. 2013: Table cell highlighting
    By chrisjfetter in forum AutoCAD Tables
    Replies: 4
    Last Post: 2013-01-08, 09:13 AM
  3. 2012: Table cell won't keep alignment
    By Noto81 in forum AutoCAD General
    Replies: 3
    Last Post: 2012-12-19, 04:39 PM
  4. Edit table cell
    By jagnag1359425 in forum AutoCAD LT - General
    Replies: 4
    Last Post: 2012-03-22, 05:11 PM
  5. Table Cell Formatting
    By fmertz.118882 in forum AutoCAD General
    Replies: 5
    Last Post: 2007-10-15, 07:56 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
  •