Skip to main content
Solved

Reading DWG block attributes, how to access?


havmoejbv
Contributor
Forum|alt.badge.img+15

I have some DWG files with data drawn as blocks with attributes. When I look at these in Data Inspector, I notice that the block attributes shows up in two ways:

I've read through https://knowledge.safe.com/articles/59335/autocad-dwg-block-attribute-extraction.html and see that while I can access the attribute info from the attribute lists (top marking) it would be a lot easier to just grab the info as shown at the bottom. The problem is I can't find this via e.g. the attribute exposer. Anyone got a good idea?

(Demo DWG attached)

Best answer by itay

Hi @havmoejbv,

I have just used your DWG and managed to successfully write the TEKST attribute value into a CSV.

I used an AttributeExposer and a CSV writer with the TEKST attribute added to it.

Hope this helps,

Itay

View original
Did this help you find an answer to your question?

3 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • Best Answer
  • October 4, 2018

Hi @havmoejbv,

I have just used your DWG and managed to successfully write the TEKST attribute value into a CSV.

I used an AttributeExposer and a CSV writer with the TEKST attribute added to it.

Hope this helps,

Itay


havmoejbv
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • October 4, 2018
itay wrote:

Hi @havmoejbv,

I have just used your DWG and managed to successfully write the TEKST attribute value into a CSV.

I used an AttributeExposer and a CSV writer with the TEKST attribute added to it.

Hope this helps,

Itay

Oh, that's interresting. Even though the TEKST attribute doesn't show in the list of attributes in AttributeExposer, it can be added, and seems to be working as normal after that. I didn't even think of trying that. Thanks!

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 4, 2018

@havmoejbv

the attribute_info{} is a list. (which you can explode or list index etc.)

In the list the object is known as a ..info{}.name and its value as ..info{}.value

The object is a AutoCAD text object, which explains the TEKST being available as an attribute.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings