VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why can I not find a block if it is a wblock

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
172 Views, 3 Replies

Why can I not find a block if it is a wblock

I am currently trying to pull information from all of a certain blocks
attributes so that I may input it in a database. Since this particular block
is the room name and number (I'm sure you can see were this is going), I
would like to get the attributes from each occurrence of this block in the
drawing. So here is the problem
If block.name = blockname then
end if
statement don't work. I can get it to display the blocks name in a message
box
msgbox (vbcr& block.name)
By using the if statement above if I change blockname to a block that was
created in the drawing it will work but not with one that is a wblock.
If you have any information on a fix, please help.
Thanks,
Travis
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Travis,

You might double check your equality test:

If Ucase(ObjBlockref.name) = Ucase(strBlockName) then

End If

Cheers,
Kenneth Hutson
San Antonio, Texas


"Travis Williams" wrote in message
news:865DF470F035FA039C389AB5CDC0CC59@in.WebX.maYIadrTaRb...
> I am currently trying to pull information from all of a certain blocks
> attributes so that I may input it in a database. Since this particular
block
> is the room name and number (I'm sure you can see were this is going), I
> would like to get the attributes from each occurrence of this block in the
> drawing. So here is the problem
> If block.name = blockname then
> end if
> statement don't work. I can get it to display the blocks name in a message
> box
> msgbox (vbcr& block.name)
> By using the if statement above if I change blockname to a block that was
> created in the drawing it will work but not with one that is a wblock.
> If you have any information on a fix, please help.
> Thanks,
> Travis
>
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

On Sat, 19 Oct 2002 17:21:32 -0700, "Travis Williams"
wrote:

>msgbox (vbcr& block.name)
>By using the if statement above if I change blockname to a block that was
>created in the drawing it will work but not with one that is a wblock.

I don't think there is any entity which is called a wblock. Rather,
there is a command "wblock" that will create a external file (ie.a
DWG) containing the entities you select. It is important to realize
that this DWG file is essentially the same as any other autocad DWG
file.

Joe Dunfee
Message 4 of 4
farnaz
in reply to: Anonymous

Joe is right. A wblock is not in fact a block. It is like any other DWG file. So u should look up in the files for that one.
U can even open it as an independent drawing file.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost