Skip to main content
Question

export block information


zzupljanin
Contributor
Forum|alt.badge.img+4

Hey everybody,

Is it possible to export all block names from .cad file to txt file. The CAD is empty(!) therefore there are no features, but block definitions are preserved for every block and I'd like to extract them.

Thanks.

17 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 23, 2017

Do you have the template file that was used to create the empty CAD file?

If so, you can read that template file (using the DWG reader) and extract the block names (have to use the setting not to explode blocks and expose the autocad_block_name format attribute).


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 23, 2017
erik_jan wrote:

Do you have the template file that was used to create the empty CAD file?

If so, you can read that template file (using the DWG reader) and extract the block names (have to use the setting not to explode blocks and expose the autocad_block_name format attribute).

Thanks @erik_jan,

 

 

We're aware of that, and usually we do have it and use method that you described. But for this, we have nothing...

 

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 23, 2017

I dont think its possible as long as there are no features, so a solution can be to create all the blocks into a new dwg with features and read the new dwg...


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 23, 2017
itay wrote:

I dont think its possible as long as there are no features, so a solution can be to create all the blocks into a new dwg with features and read the new dwg...

Hey @itay

 

 

Thanks for your reply.

 

Do you mean manually? If so, that could be a lengthy problem for 150+ blocks we currently have.

 

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 23, 2017
zzupljanin wrote:
Hey @itay

 

 

Thanks for your reply.

 

Do you mean manually? If so, that could be a lengthy problem for 150+ blocks we currently have.

 

 

No using FME! naturally, just link the dwg definitions into 150 point features and write it to a new dwg.

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 23, 2017
itay wrote:

I dont think its possible as long as there are no features, so a solution can be to create all the blocks into a new dwg with features and read the new dwg...

Brilliant,

 

 

though, could you be more specific of what transformers should I use?

 


jneujens
Forum|alt.badge.img
  • March 23, 2017
zzupljanin wrote:
Brilliant,

 

 

though, could you be more specific of what transformers should I use?

 

To create the point features? Just use a creator! Set the geometry object to 'point' and choose the number of points. The example below will create 150 points on the same location. Then use each point as the insertion point for each block you have.

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 23, 2017
jneujens wrote:
To create the point features? Just use a creator! Set the geometry object to 'point' and choose the number of points. The example below will create 150 points on the same location. Then use each point as the insertion point for each block you have.

 

 

Hey @jneujens,

 

 

and how to add them their own autocad_block_name parameter. Should I use loop or something

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 23, 2017
zzupljanin wrote:
Hey @jneujens,

 

 

and how to add them their own autocad_block_name parameter. Should I use loop or something
That's the labour intensive part, you could create a csv with the block name and ID 1 till 150 and use a joiner to add the block name to the points (use the creator att Creation Instance Attribute as id) after that is a matter of using the dwgstyler to create the new DWG

david_r
Celebrity
  • March 23, 2017

I won't pretend being an expert at AutoCAD, but would something like this using the AutoCad core console work for you?

http://stackoverflow.com/a/31936912

It's not based on FME, however.


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 24, 2017
david_r wrote:

I won't pretend being an expert at AutoCAD, but would something like this using the AutoCad core console work for you?

http://stackoverflow.com/a/31936912

It's not based on FME, however.

Hi @david_r,

 

 

yes it would, but we don't have AutoCAD...

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 24, 2017
zzupljanin wrote:
Hey @jneujens,

 

 

and how to add them their own autocad_block_name parameter. Should I use loop or something
@itay, that just doesn't make sense. If I manualy create a csv file of block names than the goal would be fulfilled (It's the main task of this question). Then I won't be needing FME.

 

 

Please, prove me wrong.

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • March 24, 2017
zzupljanin wrote:
Hey @jneujens,

 

 

and how to add them their own autocad_block_name parameter. Should I use loop or something
Well if that is the goal, then you are correct I understood that you need more that just the blocks names.

 

You can also download a trial of AutoCAD and try some commands there for exporting the names.

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 24, 2017

@zzupljanin

I tried it out, I removed all objects from a template dwg file wich contains block definitions.

You can use a schema reader and u get as many features as there are blocks.

It reads all the names into "fme_feature_type_name" even though there are no objects in the dwg.

(creating points or other objects is not useful as you would need to know the block names to merge them)


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 24, 2017

to illustrate it..

zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 24, 2017
gio wrote:

to illustrate it..
Schema reader!! Great idea.

 

Though wouldn't it give you name of layers (not the block name). At least that's what I get.

 

I'm missing something here.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • March 24, 2017

Yes, you are right.

My template had indeed layers where the object resided and then name is same as blockname....

So no solution..srry..:(

All other solutions require AutoCAD I'm afraid.

I found no way to find block information from unused blocks using fme.

Maybe a trial version and give the blocks an object?


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