Skip to main content

Hi,

 

I’m trying to generically read some tables and distribute them into different DWG Object Data layers. For this, I have a mandatory attribute containing the output layername.

I use a SchemaScanner with a Group By on this attribute to generate the schemas and finally write everything using a dynamic DWG Object Data Writer.

But it doesn’t work, I get a Layer 'XXX' is not defined

But(bis) if I use another DWG writer (e.g. RealDWG) with the exact same configuration, it does work.

I guess the difference comes from the Object Data table definition? But I have no idea how to do that.

 

I’ve tried to sort schemas and features to make sure that the schemas arrive before the features but it doesn’t change anything.

When using the RealDWG Writer, if the parameter Output Schema Before Data Feature is set to No, I get the same error, but once set to Yes, the file is written without problem.

 

What should I change when working with a AutoCAD Object Data Writer?

 

Any help appreciated.

 

Best Regards,

 

Julien

 

FME versions:

  • Form 2023.1.1.1

 

Process overview

 

SchemaScanner configuration
AutoCAD Object Data Writer configuration

 

Oh I hate this one - it always trips me up - still!

I’ve found it’s often been an issue between a mismatch in the fme_feature_type_name and the layername. You need to make sure that your “layername” and fme_feature_type_name are the same. Any you should make sure that you schema feature also have the layername attribute.

I’ve found that this behaviour it a little inconsistent between formats. I must admit I don’t think I’ve tried it with the AUTOCAD_OD froamt though, so it could definitely be an issue with the writer.   

 


Thanks for your quick answer! It does seem to be something like this, but the cached data doesn’t show any difference between the two. However the error says Layer 'MY_LAYER' is not defined while my attributes  “layername” and “fme_feature_type_name“ are my_layer. But it feels more like a logging thing than the problem here. 

In the meantime I’ve tried a workspace from scratch (generic feature reader and Autocad OD writer with schemascanner) and I don’t get this problem, so at some point I introduce something in my other workspace, I just need to figure out what.

 

While writing I fiddled around and I think I found the problem; a fanout on the output filename seems to introduce the error.


While writing I fiddled around and I think I found the problem; a fanout on the output filename seems to introduce the error.

Oh fanout, plus dynamic schema - This is guaranteed 3 hours of head against wall banging. So easy to break.


Is there any way of doing this safely and consistently? Or any resource I could read? I never realized fanout was a problem with dynamic writers.


Is there any way of doing this safely and consistently? Or any resource I could read? I never realized fanout was a problem with dynamic writers.

I don’t think there’s a problem - it’s just one of those things where if you have a schema feature and data features then you always need to be pretty careful

 

  1. both schema and data feature need to have the attribute used in the fanout
  2. both schema and data features need to have the correct attribute/value used for the feature type name
  3. The schema feature always needs to be first
  4. If you’re using the featureWriter then you can also use GroupBy which adds another place where things can go wrong. Do both Schema and Data features have the correct Group By attribute.
  5. If feature caching breaking the order of the features?! 

It’s just one of those things which perhaps the errors could be a little more helpful. For example it would be nice to know is the schema feature was the issue or my data features. An error could be - “you’re trying to write a data feature with a feature type name of X, but no schema with that name was found - the defined shcemas are X, Y and Z”.

And then each format seems to give different errors so it’s never clear if it’s the format being difficult or you’ve just missed something this time. It’s just one of those typical FME problems which which is often solved by trial and error mixed with a bit of intuition - then once you finally you have it working and you want to make a small change and you break it again and then the laptop ends out of the window...