How to extract autocad table block cells to image

How to extract autocad table block cells to image

Anonymous
Not applicable
1,159 Views
4 Replies
Message 1 of 5

How to extract autocad table block cells to image

Anonymous
Not applicable

I want to extract blockcells

I extract textCells by AcadTable.GetCellValue(row, column)

but I don't know how to extract blockCell Image

0 Likes
Accepted solutions (1)
1,160 Views
4 Replies
Replies (4)
Message 2 of 5

Ed__Jobe
Mentor
Mentor

It's not an image of a block its an AcadBlockReference object. Is that what you want to get, or a raster image of the block?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 5

Ed__Jobe
Mentor
Mentor
Accepted solution

Here's an example of how you might get the block definition of the table cell, where a table has a block inserted in the first cell.

Sub tableTest()
    Dim tb As AcadTable
    Dim c As LongPtr
    Dim pp As Variant
    ThisDrawing.Utility.getEntity tb, pp, "Select a table"
    c = tb.GetBlockTableRecordId(0, 0)
    Dim blk As AcadBlock
    For Each blk In ThisDrawing.Blocks
        If blk.ObjectID = c Then
            Debug.Print blk.Name
        End If
    Next
    
End Sub

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 4 of 5

Anonymous
Not applicable

Thank you for reply me

 

It's really helped me, but I want raster image of block. How can i do this?? 

0 Likes
Message 5 of 5

norman.yuan
Mentor
Mentor

In short answer, no, you cannot do it with pure VBA. 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes