.NET

Reply
Contributor
DiogoSantos
Posts: 17
Registered: ‎06-19-2012
Message 1 of 8 (272 Views)

BlockReference attributes

272 Views, 7 Replies
07-13-2012 01:51 AM

Hello,

 

I have a blockreference in a dwg that is a like a form, for example:

Written By: Diogo
Author: Diogo

Date: 13-07-2012
State: Check-in

 

In autocad this is a block, and on the attributes of the blockreference I only can edit State and Author, and i would like to get all values. Because i want to fill those values of Written By, Author, Date and State by code. I can reach the attribute collection of the block but i only can see the State and Author.

 

Can you please help me?

 

Thanks and kind regards,

Diogo

*Expert Elite*
Alfred.NESWADBA
Posts: 9,417
Registered: ‎06-29-2007
Message 2 of 8 (239 Views)

Re: BlockReference attributes

07-14-2012 01:07 PM in reply to: DiogoSantos

Hi,

 

>> [...] but i only can see the State and Author.

Is it possible, that the other attributes are constant? Upload a drawing with a sample-block ... that makes guessing faster :smileywink:

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Contributor
DiogoSantos
Posts: 17
Registered: ‎06-19-2012
Message 3 of 8 (218 Views)

Re: BlockReference attributes

07-16-2012 10:10 AM in reply to: DiogoSantos

Hello,

 

No this are not constant attributes because when I do something like this

BlockReference br = (BlockReference)btr.GetBlockReferenceIds(false, false)[0].GetObject(OpenMode.ForWrite);

AcadBlockReference abr = (AcadBlockReference) br.AcadObject;

Object[] objs = abr.GetConstantAttributes();

 

The objs has a length of 0.

 

And when I double click on the blockreference in the autocad I can only edit is State and Author.

 

Thanks and kind regards,

Diogo

 

 

 

Contributor
DiogoSantos
Posts: 17
Registered: ‎06-19-2012
Message 4 of 8 (212 Views)

Re: BlockReference attributes

07-16-2012 11:15 AM in reply to: DiogoSantos

And one more thing, if I go to menu Insert -> AutoCAD attributes and click on hide all attributes the values of state and author disappear but Written By and Date still continue with its values

*Expert Elite*
Alfred.NESWADBA
Posts: 9,417
Registered: ‎06-29-2007
Message 5 of 8 (209 Views)

Re: BlockReference attributes

07-16-2012 11:32 AM in reply to: DiogoSantos

Hi,

 

can you upload a drawing having one or two of these BlockReferences inserted?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 6 of 8 (194 Views)

Re: BlockReference attributes

07-17-2012 03:00 AM in reply to: DiogoSantos

Try run BATMAN command from the command line

and check / edit attribute properties before

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Contributor
DiogoSantos
Posts: 17
Registered: ‎06-19-2012
Message 7 of 8 (188 Views)

Re: BlockReference attributes

07-17-2012 03:27 AM in reply to: DiogoSantos

Hello,

 

I'm sorry but I cannot upload any of these drawings by restricted reasons :smileysad:

Some more new information:

I've converted the block to a xml file and those values on the block that I cannot modify they don't appear in the parameterdefinition in the xml file, but they appear as all other attributes in the tag text, and the attributes that I can modify as something like this %STATE%, and the other I get "Written By:", "Diogo", "Date:", "13-07-2012". Is it possible that they explode the block edit the text values and then join all together? I'm guessing don't know if it is possible

 

Thanks and kind regards,

Diogo

*Expert Elite*
Alfred.NESWADBA
Posts: 9,417
Registered: ‎06-29-2007
Message 8 of 8 (182 Views)

Re: BlockReference attributes

07-17-2012 06:17 AM in reply to: DiogoSantos

Hi,

 

>> I'm sorry but I cannot upload any of these drawings by restricted reasons

Then take two of these BlockReferences, copy&paste them into a new drawing plus modify the attributes-content. Look if the problem you have with your code also occurs now and then send the new drawing (as imho now there are not any more restrictive data in it).

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!