.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

block attributes

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jdsmit
871 Views, 2 Replies

block attributes

How do i get the values of the attributes of a named block in vb.net??

I have a block called "version" with attrubutes "versionnr" and "scale"

I need to read them by opening drawing.

I hope that someone can help me.

 

2 REPLIES 2
Message 2 of 3
cwelkusl
in reply to: jdsmit

To access the attributes of a block, use the AttributeCollection property of a BlockReference.  Once you've found your "VERSION" block:

 

If acBlockRef was the block reference,

 

For Each acAttribID As ObjectID In acBlockRef.AttributeCollection

   Dim acAttribRef As AttributeReference = acTrans.GetObject(acAttribID, OpenMode.ForRead)

   Select Case acAttribRef.Tag.ToUpper

 

        Case "VERSIONNR"

             'Do Something

 

        Case "SCALE"

             'Do Something

Next acAttribID


@jdsmit wrote:

How do i get the values of the attributes of a named block in vb.net??

I have a block called "version" with attrubutes "versionnr" and "scale"

I need to read them by opening drawing.

I hope that someone can help me.

 


 

 

Chris Welk
Urban Systems Ltd.
Engineering Technologist (Civil)/CADD Applications Developer
Message 3 of 3
jdsmit
in reply to: jdsmit

Thanks a lot

It works great

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost