Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Block Attrbutes and VBA

491 views
Skip to first unread message

Bill Hazelwood

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
I am having some difficulty editing existing attribute values in a block in
my drawings. In all the examples in the help files they create a block and
add attributes to that block and then edit the values of the attributes. I
can't seem to find a way to drill down the object list to get to a specific
attribute that I want to change.

Has anyone had any experience with this? Can you help?

Thanking you in advance
Bill Hazelwood
bhaze...@katlyn.com

Rudy Tovar

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
Hello Bill, I'm Rudy.

Buried attributes, huh?

Did you create the blocks, then add attributes?

If so, it will not work. The attribute is buried within the block.

Assoc. value 70 must be set to 2.

This is done when you create the entities, then add an attribute. After
this you make the block by selecting the attribute and it's components,
having given it a name.

To entmake the blocks the following show an example of how the code would
look:


(entmake '((0 . "BLOCK")(2 . "DETECTOR")(70 . 2)(10 0.0 0.0 0.0)(8 .
"0")))
(entmake '((0 . "ATTDEF") (10 -1.25489 -8.53126 0.0) (40 . 4.0) (1 .
"S.D.") (50 . 0.0) (41 . 0.8)
(51 . 0.0) (7 . "ROMANS") (71 . 0) (72 . 1) (11
-0.0358389 -6.53126 0.0) (210 0.0 0.0 1.0)
(3 .
"Description:__________________________________") (2 . "T") (73 . 0) (74 .
2)
(70 . 0) (8 . "0")))
(entmake '((0 . "CIRCLE") (10 0.0 0.0 0.0) (40 . 2.98661) (8 . "0")))
(entmake '((0 . "POLYLINE")(67 . 0)(70 . 1)(8 . "0")))
(entmake '((0 . "VERTEX") (10 -0.375 0.0) (40 . 0.75) (41 . 0.75) (42
1.0)(8 . "0")))
(entmake '((0 . "VERTEX") (10 0.375 0.0) (40 . 0.75) (41 . 0.75) (42
1.0)(8 . "0")))
(entmake '((0 . "SEQEND")))
(entmake '((0 . "ENDBLK")))


--
Ru...@whainc.com
Job Captain/MIS Assist./Programmer

Bill Hazelwood <bhaze...@katlyn.com> wrote in article
<7j17il$hv...@adesknews2.autodesk.com>...

Bill Hazelwood

unread,
Jun 1, 1999, 3:00:00 AM6/1/99
to
The attributes were initially created with the block. The block was then
inserted into the drawing. Now I want to change the value of that attribute.
In addition I would like to use VB. AutoLISP is not one of my strong suits.

Bill


Rudy Tovar wrote in message <01beac5d$cd70a480$1b09...@mail.whainc.com>...

Bill Hazelwood

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
This is a response to my own question. I have figured out a way to
accomplish what I need, in VB/VBA. For those who have been following and are
interested here it is;

Dim blkX As Object
Dim attX As AcadAttribute
Dim blkXs As AcadBlock
Dim intX As Integer

Set blkXs = ThisDrawing.Blocks("TitleBlock")
For intX = 1 To blkXs.Count - 1

If TypeOf blkXs.Item(intX) Is AcadAttribute Then
Set attX = blkXs.Item(intX)

If attX.TagString = "X" Then
attX.TextString = "B"
attX.Update
End If
End If
Next intX

where ThisDrawing.Blocks("TitleBlock") is the name of the Block that
contains the Attribute and
where attX.TagString = "X" is the name of the Attribute within the Block and
where attX.TextString = "B" is the new value of the Attribute

Thanks
Bill Hazelwood


Bill Hazelwood wrote in message <7j17il$hv...@adesknews2.autodesk.com>...

Rudy Tovar

unread,
Jun 2, 1999, 3:00:00 AM6/2/99
to
Place your question under

autodesk.autocad.customization.vba

I'm sure you'll get the answer you're looking for there.


--
Ru...@whainc.com
Job Captain/MIS Assist./Programmer

Bill Hazelwood <bhaze...@katlyn.com> wrote in article

<7j1cfd$jf...@adesknews2.autodesk.com>...

0 new messages