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

BlockReference attributes

7 REPLIES 7
Reply
Message 1 of 8
DiogoSantos
601 Views, 7 Replies

BlockReference attributes

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

7 REPLIES 7
Message 2 of 8

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 😉

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 8
DiogoSantos
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

 

 

 

Message 4 of 8
DiogoSantos
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

Message 5 of 8

Hi,

 

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

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 6 of 8
Hallex
in reply to: DiogoSantos

Try run BATMAN command from the command line

and check / edit attribute properties before

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 7 of 8
DiogoSantos
in reply to: DiogoSantos

Hello,

 

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

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

Message 8 of 8

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 ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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