I have searched around, and the answers I have found do not work for me.
Using ACAD 2004 VBA, I have attached XData to some entities, with the application name like this:
Dim DataType as Integer
Dim Data as Variant
DataType(0) = 1001
Data(0) = "MyApplication"
.
.
...
I figured it out.
In the VB code, you can set the ForeColor property to something like vbRed and it will work. There is a list of the vb Colors in help. Each one has a hex color value, but they didn't work, so I used the vbColor....
In AutoCAD VBA, anyone know how to change the color of a Label?
I would assume it is the ForeColor property, but when I look at the predefined choices, they are shades of gray. A look at the Palette tab in the ForeColor property, shows nothing. No colors or anything is in there.
Maybe that is...
Sorry, forgot to mention I wasn't "binding" the combo box data to anything in particular. It is more or less filled in insode the code, using AddItem.
So no Excel data to use. Does it have to get its data from "a table", to use the ColumnHeads property?
In VBA, a regular ole Combo Box control has a ColumnHeads property to display Column Headers (if you make it true).
Is there a way to put the text in the header? If you make this property true, it puts a blank row (no text) in there at the top.
I did the following (I guess it works all the time):
Dim blockObj As AcadBlock
Dim mtextObj As AcadMText
Dim insertPoint(0 To 2) As Double
Dim txwid As Variant
Dim txht as Variant
Dim txstr as String
Dim minExt As Variant
Dim maxExt As Variant
Dim junk as Variant
'set text data
insertPoint(0)...
Any way on ACAD 2004 VBA to find the number of text lines in an MText "paragraph", or do ya just have to figure it out somehow by using the bounding box and text height?
Nevermind. I am working now.
Since I know the name, and am working with only one block, I just kill it like the code says (DeleteRefs part).
I'm good, and thanks again.
The only problem I still have is that the code you referenced assumes you just picked the entity (I guess). I do not want to pick it. I am currently looking in the Blocks collection, and if it is in there, delete it.
Apparently I need to somehow get the actual object from the AcadBlockReference...
I am using AutoCAD 2004, and trying to delete a block in VBA.
I get an error that the block or object is referenced. In looking thru the help files, I noticed that the Blocks Collection does not have a delete function. But I don't want to delete the whole collection, just a block. Basically...