cart: empty [ Login ]

InvalidName: error with layer names of files in reference?

1 2  next > 
JC
10/4/2023 3:09 PM
Good day, First try with the CAD library, so maybe I am missing something obvious. I have DWG files that have typically one reference which is the border. All files open correctly, but when I perform a dxfModel.validate I receive a list of errors about invalid names (containing "|"). The errors all seem to be related to layer names of my referenced files, as the names are in <RefFile>|<Layer name> format (as they are displayed when I open the file with AutoCAD. Is there anything special to do so that those names are accepted? Because of those errors, the dwgWriter does not want to save my model. Thanks and regards, Jean
Wout
10/5/2023 9:43 AM
Looks like a bug, I'll look into it later today or tomorrow. - Wout
Wout
10/5/2023 11:45 AM
Can you attach the DWG or DXF file? Because AutoCAD does not allow entering the "|" character in a layer name. Maybe it has a special meaning in certain circumstances, I'm not sure. - Wout
JC
10/5/2023 12:34 PM
Good morning, I did check with one of our drafters and he mentioned that those names (<ref file>|<layer>) for layers are generated by AutoCAD when you attach reference files. I tried detaching and reattaching our border and the layers appeared in the layer panel in AutoCAD. He also mentioned that AutoCAD does not allow you to change them - so you are correct they have special meaning in that case. Is there a workaround? Maybe if I copy the content of the referenced files in the main drawing and detach them programmatically it would allow me to save? This is not our standard practice for our cad files, we normally use reference whenever possible. Thanks for your support! Jean
Wout
10/5/2023 12:38 PM
Well, I could remove the name check, but I think I need to investigate deeper first on what the circumstances exactly are, because if I just create a DXF file, and edit the file by hand in a text editor and insert a "|" character, AutoCAD will refuse to open it. So it will open it under some condition that I'm not aware of, and I'll have to program it into the validation check. - Wout
JC
10/5/2023 12:49 PM
Good morning, I did a little test that might help you in your investigations. I tested exporting to DXF from AutoCAD and the layer names were present with the "|" character: (ex: "HA_A1|HA_Border"). I tried to open it from AutoCAD and it did not complain. It may be an AutoCAD version issue where previous version encoded those names differently and did not use the special character. I have AutoCAD 2022. Hope this help, Thanks and regards, Jean
Wout
10/5/2023 12:57 PM
Well, it's most likely something in the DxfLayer.Flags that determines the exact behavior, or even something inside the extended data or extension dictionary. Can't really tell without seeing the file. - Wout
JC
10/5/2023 1:42 PM
Good day, Attached is the DWG file, with its reference + the generated DXF. Let me know if you need anything else, Regards, Jean
Wout
10/6/2023 7:47 AM
It looks like when the IsExternallyDependent flag is set the table records like layer, line type etc follow this naming scheme, so I've disabled the name validation in this case. Which CadLib version are you using? 4.0/6.0 win/6.0 multi-platform/.NET standard? I'll recompile this specific version for now (I've just updated 4.0 and 6.0 windows trial versions). - Wout
JC
10/6/2023 11:34 AM
Good morning, I am using the 4.0 library at the moment. I'll be away for a week, but will try with your new version when I am back. Thanks! Jean
1 2  next >