edit one block reference , not all

edit one block reference , not all

Anonymous
Not applicable
665 Views
3 Replies
Message 1 of 4

edit one block reference , not all

Anonymous
Not applicable
I am developing a form which allows the user to enter a wall's length and then builds the wall by inserting the appropriate number of 4 ft drywall panels. An 18ft wall will result in 4 4ft panels and one 2ft panel. My routine inserts the block named 'ex-pa' 5 times. 'ex-pa' is a drawing representing a drywall panel that contains 2 parallel lines of length 48". What I want to do is select the block reference of the 5th inserted block and change the length of the two lines inside it to 24in. However, when I change the line length of the 5th panel, it changes the length in all 5 panels.

The enclosed code (patched together from various postings in this discussion group) attempts to loop thru each block ref and assign a unique length (nor) to each line so that I can see that I am editing a specific block reference. But all block refs end up with the same line dimensions. How do I change a single block ref's entity geometry?
0 Likes
666 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
> How do I change a single block ref's entity geometry?

You don't. A block reference is literally a reference to a single set
of geometry. That's why all of your block inserts are changing to
match. Create a second block definition and use that one for your
fifth insert.

--
http://www.acadx.com
Win an autographed copy of
"Mastering AutoCAD 2000 Objects"
by Dietmar Rudolph

"rcswofford" wrote in message
news:f03c36a.-1@WebX.maYIadrTaRb...
0 Likes
Message 3 of 4

Anonymous
Not applicable
First of all I've been trying to find a way to iterate through the Entities
of a block reference but if you look at the Object Hierachy of a
"AcadBlockReference" it contains no support for the Items property. I
understand that it would be a bad thing to change the Entities of the block
but how about being able to simply read the Entities in the block would be
nice! This is were VBA fails and ObjectARX excels.

"Frank Oquendo" wrote in message
news:F902108AE1A0CC6BA1AF276A89F86C9B@in.WebX.maYIadrTaRb...
> > How do I change a single block ref's entity geometry?
>
> You don't. A block reference is literally a reference to a single set
> of geometry. That's why all of your block inserts are changing to
> match. Create a second block definition and use that one for your
> fifth insert.
>
> --
> http://www.acadx.com
> Win an autographed copy of
> "Mastering AutoCAD 2000 Objects"
> by Dietmar Rudolph
>
> "rcswofford" wrote in message
> news:f03c36a.-1@WebX.maYIadrTaRb...
>
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
I'm not sure I understand your complaint. There is no method for accessing items
other than attribute references in either VBA or ObjectARX. The
AcDbBlockReference class only has three subentity access functions:
attributIterator, openAttribute and openSequenceEnd.

To inspect the entities that make up a block insert, you must open the
corresponding AcDbBlockTableRecord object which equates to the AcadBlock in VBA.
*That's* where you'll find your Items collection and rightly so since a block
reference does not contain any geometry, only a reference to the geometry found
in it's definition.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"

"Chad Schmidt" wrote in message
news:24AAC0D421D4769CAB8F223FB7196760@in.WebX.maYIadrTaRb...
> First of all I've been trying to find a way to iterate through the Entities
> of a block reference but if you look at the Object Hierachy of a
> "AcadBlockReference" it contains no support for the Items property. I
> understand that it would be a bad thing to change the Entities of the block
> but how about being able to simply read the Entities in the block would be
> nice! This is were VBA fails and ObjectARX excels.
0 Likes