Redefining Blocks

Redefining Blocks

Anonymous
Not applicable
138 Views
2 Replies
Message 1 of 3

Redefining Blocks

Anonymous
Not applicable
Help...I'm new to both AutoCAD and Visual Basic and am struggling to
learn both. I am tryin to develop a macro to help in the conversion of
drawings from another CAD application (MicroCADAM) to AutoCAD.

One of the steps in the conversion that I'm working now in VBA is to
change each block defined in the drawing to: scale the drawing entities
down by 12, change the text height and the entities' color to ByLayer.
I've done most of this by stepping through the blocks one-by-one and,
(1)inserting each at 0,0 (2) exploding that refence, and(3) modifying
the entities. Now I want to "redefine" the block with these objects.
How do I do this? I can't Add it because it already exists in the
Blocks collection. What approach should I take?

Larry
0 Likes
139 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I think you are going about this the wrong way.

If you find the block definition ,ThisDrawing.Blocks.Item("BlockName"), you
can do your modifications directly in the block. The block is a collection
of entities that you can edit, remove and add.

I hope this helps.

--
Rune Wold
System Analyst
Engineering Systems
rune@engsys.no
--

"Larry Loop" wrote in message
news:39D9F013.30CCA763@lmco.com...
> Help...I'm new to both AutoCAD and Visual Basic and am struggling to
> learn both. I am tryin to develop a macro to help in the conversion of
> drawings from another CAD application (MicroCADAM) to AutoCAD.
>
> One of the steps in the conversion that I'm working now in VBA is to
> change each block defined in the drawing to: scale the drawing entities
> down by 12, change the text height and the entities' color to ByLayer.
> I've done most of this by stepping through the blocks one-by-one and,
> (1)inserting each at 0,0 (2) exploding that refence, and(3) modifying
> the entities. Now I want to "redefine" the block with these objects.
> How do I do this? I can't Add it because it already exists in the
> Blocks collection. What approach should I take?
>
> Larry
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Oh...from what I information I could gather in the online help and Sutphin's
book, it looked like I needed to emulate the manual method of exploding a block
before I could edit its objects and then "redefine" it to have the changes take
effect. Well, back to the books.

Larry Loop

Rune Wold wrote:

> I think you are going about this the wrong way.
>
> If you find the block definition ,ThisDrawing.Blocks.Item("BlockName"), you
> can do your modifications directly in the block. The block is a collection
> of entities that you can edit, remove and add.
>
> I hope this helps.
>
> --
> Rune Wold
> System Analyst
> Engineering Systems
> rune@engsys.no
> --
>
> "Larry Loop" wrote in message
> news:39D9F013.30CCA763@lmco.com...
> > Help...I'm new to both AutoCAD and Visual Basic and am struggling to
> > learn both. I am tryin to develop a macro to help in the conversion of
> > drawings from another CAD application (MicroCADAM) to AutoCAD.
> >
> > One of the steps in the conversion that I'm working now in VBA is to
> > change each block defined in the drawing to: scale the drawing entities
> > down by 12, change the text height and the entities' color to ByLayer.
> > I've done most of this by stepping through the blocks one-by-one and,
> > (1)inserting each at 0,0 (2) exploding that refence, and(3) modifying
> > the entities. Now I want to "redefine" the block with these objects.
> > How do I do this? I can't Add it because it already exists in the
> > Blocks collection. What approach should I take?
> >
> > Larry
> >
0 Likes