Skip to main content
Solved

Reading constant properties from an AutoCAD block

  • November 20, 2018
  • 6 replies
  • 44 views

jneujens
Forum|alt.badge.img

Is it possible to read constant properties from an Autocad block?

Constant properties are never changing in a block and can be displayed.

 

This is an example:

It shows 1 block, with some dynamic attributes ('12 345'). The 'N' is a constant property, so there is no attribute defining it.

My questions is: is there somehow a way to read this information?

I am aware it is possible to explode the block and extract this autocad_text entity, but that is not the solution I am after.

 

Best answer by daveatsafe

Hi @jneujens,

The 'N' is part of the graphical content of the block, rather than an attribute, so there is no way to extract it without exploding the block.

However, the N will always be present if the block LEMD is placed, so you can infer its presence from autocad_block_name. I assume that if there is a corresponding 'S' block, it will have a different name.

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

6 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 20, 2018

@jneujens

 

If you read the block and explode it into entities.

The elements can be read. You can see this in the Feature Information Window.

To access these properties, you need to expose the relevant schema attributes.

 

The "N" in the block is a text object: autocad_text_string (encoded: UTF-16LE): N.

Apart from the text value itself I see no way to select it, you probably have to test or regexp the text strings to do that.


jneujens
Forum|alt.badge.img
  • Author
  • November 20, 2018
gio wrote:

@jneujens

 

If you read the block and explode it into entities.

The elements can be read. You can see this in the Feature Information Window.

To access these properties, you need to expose the relevant schema attributes.

 

The "N" in the block is a text object: autocad_text_string (encoded: UTF-16LE): N.

Apart from the text value itself I see no way to select it, you probably have to test or regexp the text strings to do that.

In the question I already literally stated I aware of this solution. Because of external constraints it is not possible to explode the block.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • November 20, 2018

Hi @jneujens,

The 'N' is part of the graphical content of the block, rather than an attribute, so there is no way to extract it without exploding the block.

However, the N will always be present if the block LEMD is placed, so you can infer its presence from autocad_block_name. I assume that if there is a corresponding 'S' block, it will have a different name.


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • November 20, 2018
jneujens wrote:

In the question I already literally stated I aware of this solution. Because of external constraints it is not possible to explode the block.

True but you could add another reader to read that layer a second time, this time exploding the block; then use a NeighborFinder to transfer the information from the exploded block (which you then discard) onto the unexploded version.


jneujens
Forum|alt.badge.img
  • Author
  • November 21, 2018
gio wrote:

@jneujens

 

If you read the block and explode it into entities.

The elements can be read. You can see this in the Feature Information Window.

To access these properties, you need to expose the relevant schema attributes.

 

The "N" in the block is a text object: autocad_text_string (encoded: UTF-16LE): N.

Apart from the text value itself I see no way to select it, you probably have to test or regexp the text strings to do that.

Mark2AtSafe ♦♦ Absolutely true, but in some cases that slows down the process more than I would like to unfortunately.

 

Thanks for both answers though!

jneujens
Forum|alt.badge.img
  • Author
  • November 21, 2018
daveatsafe wrote:

Hi @jneujens,

The 'N' is part of the graphical content of the block, rather than an attribute, so there is no way to extract it without exploding the block.

However, the N will always be present if the block LEMD is placed, so you can infer its presence from autocad_block_name. I assume that if there is a corresponding 'S' block, it will have a different name.

DaveAtSafe Probably yes, although I do not always know what to expect beforehand...

 

 

Thanks for the clarification!

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