Skip to main content

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.

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).


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...

 

 


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...


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.

 

 


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.

 

 


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?

 


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.

 

 


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
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

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.


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...

 


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.

 


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.

 

 


@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)


to illustrate it..

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.

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?


Reply