Skip to main content

Dear fme users, I'm here to ask your most valuable help. I have hundreds of .dwg files in a directory and I need to process all of them adding 6 attributes to each drawing, the values of these attributes must be taken from the file name. I managed to build a workflow that assigns the attribute values to 6 columns but I can't figure out how to convert this values as recognized attributes by the output file produced with a standard writer.

Small example:

Input file:

  • name: ATTRIBUTE1_ATTRIBUTE2.dwg
  • no attributes

Output file:

  • same name
  • two attributes: number one - ATTRIBUTE1 number two - ATTRIBUTE2

Thanks a lot for your help.

 

Hi @pierangelo

I suggest you to enable the format attribute fme_basename from Reader:

Use the transformer AttributeSplitter to split the attribute fme_basename.

This transformer will create a list of value:

 

 

Next step use the transformer AttributeManager to create two attributes and receive the values from List created before:

I hope that it will be help you.

 

Thanks in Advance,

Danilo

 


@danilo_fme Thanks for your answer. I do apologize if I wasn't able to explain myself: I've already created the attributes with the AttributeManager, but I'm not able to have them written in the .dwg output files because the 6 columns I added are not recognized as attributes of a .dwg drawing. I need an output file to drop it inside AutoCAD so that the file will become automatically a block with the 6 attributes created inside fme.

The reader points to a directory and imports all the drawings stored in it, then I add 6 columns which are filled in the AttributeManager. As far as I understand, the problem can be solved appending 6 empty rows below each imported file and filling them in the right way so that each row will be correctly recognized as an attribute of the .dwg output file.

So the questions are: how do I add 6 empty features (rows) for each file imported from the directory? is there a more elegant way to define attributes inside a .dwg drawing (i. e. AutoCAD command: DEFATT), maybe with the DWGStyler?

Thanks again.


@danilo_fme Thanks for your answer. I do apologize if I wasn't able to explain myself: I've already created the attributes with the AttributeManager, but I'm not able to have them written in the .dwg output files because the 6 columns I added are not recognized as attributes of a .dwg drawing. I need an output file to drop it inside AutoCAD so that the file will become automatically a block with the 6 attributes created inside fme.

The reader points to a directory and imports all the drawings stored in it, then I add 6 columns which are filled in the AttributeManager. As far as I understand, the problem can be solved appending 6 empty rows below each imported file and filling them in the right way so that each row will be correctly recognized as an attribute of the .dwg output file.

So the questions are: how do I add 6 empty features (rows) for each file imported from the directory? is there a more elegant way to define attributes inside a .dwg drawing (i. e. AutoCAD command: DEFATT), maybe with the DWGStyler?

Thanks again.

You’re referring to AutoCAD ‘attribute definition’ elements that get imbedded in blocks. I’m unsure in FME writes these feature types. Someone else can possibly verify this? You could alternatively create all the blocks in one dwg then writeblock them out however this is tedious and not ideal if you have a lot of them.


You’re referring to AutoCAD ‘attribute definition’ elements that get imbedded in blocks. I’m unsure in FME writes these feature types. Someone else can possibly verify this? You could alternatively create all the blocks in one dwg then writeblock them out however this is tedious and not ideal if you have a lot of them.

Yes, can someone please tell me if FME writes these feature types?

To explain better the question I'll add a picture.

I made a .dwg file configured as the ones I wish to create with FME to understand better how FME reads this kind of drawings (basically I made a circle and add some attributes to the drawing with the command DEFATT).

The left side shows how FME reads the attribute defined in Autocad, on the right side I've selected the circle. As you can see there are some differences (e.g. autocad_original_entity_type is set to Autocad_attribute on the left and to Autocad_circle on the right).

Is there a way to add rows (configured with the values shown on the left) to each file I read from a directory?


Reply