get block attributes

get block attributes

Anonymous
Not applicable
603 Views
7 Replies
Message 1 of 8

get block attributes

Anonymous
Not applicable
I have a block on my drawing called "Title".

I can get a userform to display all the information in my block when I select it on screen using an AcadEntity.

How would I go about, or is it even possible to fill my userform with the block data immediatley when the form starts up without user doing anything?
0 Likes
604 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Do you only have 1 instance of the "Title" block in a given drawing?

--
Matt W
"Yesterday I found out what doughnuts are for. You put them on doughbolts.
They hold dough airplanes together. For kids, they make erector sets out of play-dough"
0 Likes
Message 3 of 8

Anonymous
Not applicable
Yeah, there is only one instance
0 Likes
Message 4 of 8

Anonymous
Not applicable
Can you post the code you have so far?

--
Matt W
"Yesterday I found out what doughnuts are for. You put them on doughbolts.
They hold dough airplanes together. For kids, they make erector sets out of play-dough"
0 Likes
Message 5 of 8

Anonymous
Not applicable
This is what I have right now, I have to pick the block

Sub dgetattributes()

Dim varpick As Variant
Dim objent As AcadEntity
Dim objBlock As AcadBlocks
Dim objAttrib As AcadAttribute
Dim objBlock1 As AcadBlockReference
Dim varattribs As Variant

With ThisDrawing.Utility
.GetEntity objent, varpick

Set objBlock1 = objent

varattribs = objBlock1.GetAttributes


txtcontract.Text = varattribs(10).TextString

txtProject.Text = varattribs(0).TextString + ", " + varattribs(1).TextString
txtContractor.Text = varattribs(4).TextString

frmAddjob.Show

End With

End Sub
0 Likes
Message 6 of 8

Anonymous
Not applicable
This should get you pointed in the right direction - I hope. 🙂

--
Matt W
"Yesterday I found out what doughnuts are for. You put them on doughbolts.
They hold dough airplanes together. For kids, they make erector sets out of play-dough"
0 Likes
Message 7 of 8

Anonymous
Not applicable
thanks, That helped me out a great deal
0 Likes
Message 8 of 8

Anonymous
Not applicable
You're welcome.
Glad I could help.

--
Matt W
0 Likes