Hi Arash,
Can you share the workspace? If you run with feature cache (run to this) to last transformer, then Save as > Template and upload the fmwt file here
I assume you are using DWGStyler to give the block its symbology
Just before the writer, inspect the table data and the visual preview. Inspect one feature in the feature information window. What is the autocad_layer and autocad_block_name values ?
Another idea would be to see if these 2 attribtues are being created before the DWG styler. Attribute manager might help creating an extra attribute to put dummy values in... or "Set" the value to be another existing attribute column. Then debug along the process if the autocad attributes are getting mixed somehow
Hi @j.botteril,
I solved the problem. but my solution is not optimal. First I write the autocad file and then I have to enter the autocad file in another workbench to clean up the layers.
my FME workbench is not up to date, so I don't have a feature cache function.
Hi @j.botteril,
I solved the problem. but my solution is not optimal. First I write the autocad file and then I have to enter the autocad file in another workbench to clean up the layers.
my FME workbench is not up to date, so I don't have a feature cache function.
you can also add Data "Inspector" transformer within your workflow. It should launch another app window for you to inspect. This helps you debug problems mid workflow and manage attribute handling changes
Hi Arash,
Can you share the workspace? If you run with feature cache (run to this) to last transformer, then Save as > Template and upload the fmwt file here
I assume you are using DWGStyler to give the block its symbology
Just before the writer, inspect the table data and the visual preview. Inspect one feature in the feature information window. What is the autocad_layer and autocad_block_name values ?
Another idea would be to see if these 2 attribtues are being created before the DWG styler. Attribute manager might help creating an extra attribute to put dummy values in... or "Set" the value to be another existing attribute column. Then debug along the process if the autocad attributes are getting mixed somehow
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
Hi @annette2 ,
I checked your shared workbench. In Writer you entered "gastest" as the layer name. in the first step try to create two attributes with the name "autocad_layer" and "autocad_block_name".
in the second step give your layers in "autocad_layer" and name of symbols in "autocad_block_name". Please make sure that the attribute values of autocad_bolck_name are identical to the layer of DWG_tamplate.
in the third step in your Writer in Advance enter your DWG template and do without the DWG Styler.
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
@annette2 @jamesb16otterill Although I selected as layer name in Writer column of autocad_layer, in my result all layer of DWG Template is written as layer name.
what is strange to me, when I read my result again in FME as fme_feature_type I have exactly those layers that I need, but when I open the file with Autocad, it it contains layers from my DWG template.
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
I see this too. All the block names are added as layers, even though I have purge applied at writer level.
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
I will test your suggestion. I tried creating the attributes after the DWGStyler and it didn't work but maybe the order was the issue. I will let you know how I get on.
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
Unfortunately if I just apply autocad_layer and autocad_block_name via an AttributeCreator and remove the DWGStyler the block is not written, just the point object. See attached workspace template with caches and block file.
I had expected a block could be assigned in this manner too but it is not working in this manner.
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
Hello @annette2 ,
you did everything correctly. I don't understand why the problem occurs. :(
@jamesb16otterill @arash_hokm I can also unfortunately reproduce. It seems to happen whenever you apply the block from a template with the DWGStyler.
I have tried to override the autocad_layer name by adding an AttributeCreator after the DWGStyler but that also didn't work. It occurs whether you or not you do a fan out. It creates both the layer name chosen and a second layer name that uses the block name. The blocks are found in the latter. And another issue is that even though I have set purge at writer level it creates empty layers for all the blocks :(
Have I missed something? I attach the fmwt file with cached source and block files.
I tried to apply the block without using the DWGStyler and just the main writer template without success.
@arash_hokm what work around did you use in the second workspace. I really don't want to have to do this as it would add unneeded complexity.
Any input welcome.
Annette
I thought so too. I have opened a ticket.
Hello @annette2 ,
I created a batch file for this. my batch file automatically runs two FME procedure in one step. so I was able to directly solve the problem.
Hi @arash_hokm, @jamesb16otterill, and @annette2,
It looks like we have an existing issue with the AutoCAD DWG/DXF writer not purging unused objects as expected, tracked internally as (FMEENGINE-59967). The current workaround for this is to use the RealDWG writer instead if that may be an option for your workflows (Windows only).
The other issue I ran into when looking into the linked workspaces is that it seems that the affected blocks definitions are created in layers other than 0. For most of the blocks provided, they are created in layers with the same name as the block. One possible workaround is to edit the template block definitions so that they all sit on layer 0. For example, Noordpijil is created in layer 0, so it writes correctly to the target layer.
It looks like FME is writing to the block definition's original layer rather than to the target layer. I've filed this issue for our development team (FMEENGINE-73591) as well.
Lastly, I wanted to add that the AttributeCreator workspace just needs an additional attribute created before the block name to write out blocks: autocad_entity = autocad_insert , and it should work in case that provides another option.
Sorry to hear that you've run into these issues! I've linked this Q&A to both internal issues so I'll inform you all here when these have been addressed.