View Full Version : Balloon & Autocad Table
grobnik
2011-07-13, 12:32 PM
Hi to everybody,
Pls somebody knows if is there a way to insert a balloon for a cell contained in an Autocad table ?.
I'm transferring some data from Excel to an Autocad table, and I would like to add some comments reported inside a single Excel cell.
I'm using VBA routine for transferring data from Excel to Autocad, but if some other tools that I can integrate with VBA will be use useful.
My Autocad version it's 2005.
Thank you.:)
Change a block name and row and column number
Option Explicit
Sub demo()
Dim ID As Long
Dim blkDef As AcadBlock
Dim oTable As AcadTable
Dim varPt As Variant
Dim blkName As String
blkName = "Balloon"
Set blkDef = ThisDrawing.Blocks(blkName)
ID = blkDef.ObjectID
ThisDrawing.Utility.GetEntity oTable, varPt, "Select Table: "
AddLegendBlock oTable, 1, 0, blkName
End Sub
Public Sub AddLegendBlock(ByVal oTable As AcadTable, row As Long, column As Long, bname As String)
Dim ID As Long
Dim blkDef As AcadBlock
Set blkDef = ThisDrawing.Blocks(bname)
ID = blkDef.ObjectID
oTable.RegenerateTableSuppressed = True
oTable.SetCellType row, column, acBlockCell
oTable.SetCellAlignment row, column, acMiddleCenter
oTable.SetBlockTableRecordId row, column, ID, True
oTable.RegenerateTableSuppressed = False
End Sub
grobnik
2011-07-13, 06:19 PM
Hi fixo,
Thank you for your support, I don't understood well the code, but "brutally" copy and paste I got an error on the below sentence
ID = blkDef.ObjectID
the error is in the attached image.
If I understood well you create a block which contain the comment ? correct ? and how it's tied with the table ?
So If you have few minutes to spent could you explain me more the routine functionality.
thank you
Or you need to insert tooltips?
my bad :)
Try
Dim r, c
r = 1
c = 0
oTable.SetToolTip r, c, "Put" & vbLf & "your" & vbLf & "comment" & vbLf & "here"
grobnik
2011-07-14, 06:49 AM
Or you need to insert tooltips?
my bad :)
Try
Dim r, c
r = 1
c = 0
oTable.SetToolTip r, c, "Put" & vbLf & "your" & vbLf & "comment" & vbLf & "here"
Thank you again, but seems that doesn't works with Autocad 2005 !
I'll search again.
After the executing this code click cell 1,0 and hover 1 second
it's working good in 2009
I can't test it in 2005 sorry
grobnik
2011-07-14, 12:07 PM
After the executing this code click cell 1,0 and hover 1 second
it's working good in 2009
I can't test it in 2005 sorry
Thank you again for your support, but with Autocad 2005 the tooltip property is not supported by table object.
Thank you !
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.