Yes, I can confirm that it is treated as an illegal character in a DWG attribute name. I've filed a request with our developers (PR#80236) to investigate this and let me know what they find.
Apologies for any inconvenience this is causing. If that character is valid, we might be able to give you a workaround by editing one
of the metafiles for the format (save you having to wait for and then
reinstall a newer FME) but I can't guarantee that. We'll see what the
developers say.
Hi Mark,
Thanks for your reply! I thought it was a limitation in the dwg format but if there's some workaround I'd be very interested!
OK, well this is acknowledged as an issue and planned for fixing in 2018.x (so not the main release, but a "service pack").
In the meantime, the only thing you can do is edit the metafile, but be aware that it's not really best practice to do this. You do it at your own risk (as does anyone else reading these instructions). What I would try to do with this is...
1. Read all these instructions first (and the "However" part below) and make backup copies of any edited files (just in case)
2. Open the file <FME Install>/metafile/autocadTypes.fmi in a text editor. Notice that it references commoninvalidchars.fmi
3. Open the file <FME Install>/metafile/commoninvalidchars.fmi.
4. Copy the ATTRIBUTE_INVALID_CHARS line from the commoninvalidchars file
5. Paste that line into the autocadTypes file, to replace the INCLUDE line
6. Remove the - character from the string of invalid characters. Restart FME.
What that **should** do is let AutoCAD writers support that character. So in the output schema it shouldn't get replaced.
However... there is also a built in check in the reader that we can't workaround. So if you convert DWG to DWG then the reader will replace - with _ (and if you use Generate Workspace then writer schema will be a copy of that). But what you should be able to do is manually edit the writer schema to use - characters instead and then rename the incoming attributes (a BulkAttributeRenamer might help there).
I know it's a bit of a pain. Sorry about that. But I'm hopeful we'll get a proper fix in place fairly shortly.
OK, well this is acknowledged as an issue and planned for fixing in 2018.x (so not the main release, but a "service pack").
In the meantime, the only thing you can do is edit the metafile, but be aware that it's not really best practice to do this. You do it at your own risk (as does anyone else reading these instructions). What I would try to do with this is...
1. Read all these instructions first (and the "However" part below) and make backup copies of any edited files (just in case)
2. Open the file <FME Install>/metafile/autocadTypes.fmi in a text editor. Notice that it references commoninvalidchars.fmi
3. Open the file <FME Install>/metafile/commoninvalidchars.fmi.
4. Copy the ATTRIBUTE_INVALID_CHARS line from the commoninvalidchars file
5. Paste that line into the autocadTypes file, to replace the INCLUDE line
6. Remove the - character from the string of invalid characters. Restart FME.
What that **should** do is let AutoCAD writers support that character. So in the output schema it shouldn't get replaced.
However... there is also a built in check in the reader that we can't workaround. So if you convert DWG to DWG then the reader will replace - with _ (and if you use Generate Workspace then writer schema will be a copy of that). But what you should be able to do is manually edit the writer schema to use - characters instead and then rename the incoming attributes (a BulkAttributeRenamer might help there).
I know it's a bit of a pain. Sorry about that. But I'm hopeful we'll get a proper fix in place fairly shortly.
Thank you so much! It definitely solved the issue for now.