Solved

Custom and complex line types of DWG files

  • 2 December 2022
  • 4 replies
  • 113 views

Badge

Hi folks,

 

I have some CAD files (dwg, dxf) that have custom line type information (so line types, the engineer defined by himself/herself.

 

I know that the DWG format has some attributes to be exposed that indicated a "DASHED" line etc.

I can read out lets say the linetype "FENCELINE" or any custom made linetype in an exposed attribute (I guess it is called "Autocad_resolved_linetype").

 

  1. problem: While the complex linetypes are defined in the "acad.lin" files, the custom linetypes a user can create are just visible in AutoCAD. Is there a way to display those custom/complex linetypes to get this automated somehow?
  2. problem: I know the "LinePatterner" helps creating the simple line types. But how can I created a complex line pattern? Something with circles or characters in between?

customlinepatternMany thanks if somebody can share his/her knowledge 😄

 

Best,

Ferid

icon

Best answer by jovitaatsafe 15 December 2022, 00:56

View original

4 replies

Userlevel 1
Badge +11

Hi @fungergis​,

Is there a reason you're looking to display custom AutoCAD linetypes outside of AutoCAD? And what program(s) do you want to view it on?

 

I would not personally recommend re-creating complex linetypes in FME, as the the LinePatterner transformer uses a lot of math just to set up dashes and spaces. It would be possible to alter that workflow to insert font or other geometry like circles, but it would take understanding the LinePatterner workflow and creating the process to handle characters and geometry at different parts of the line. So it is possible but potentially quite complex. To get to the workflow in the LinePatterner, you can right-click it and select 'Edit...'. As this use case borders more on drawing/creating geometry, I think there may be easier methods outside of FME.

 

Here are two potential ideas depending on your use case:

  1. From AutoCAD, export the file to PDF and read in the PDF. I expect this will bring in the right geometry, but haven't tested this myself.
  2. Depending on how many features have custom linetypes, you can use WMFOUT in the AutoCAD command line to export a vector file, and then WMFIN to import the feature. This new feature is explode-able so you could then use EXPLODE on the feature. FME will then read in all the parts. The screenshot below is of this method viewed in the data inspector. I used the gas linetype because I didn't have a custom one on hand. The top line is the original, while the bottom is the exploded WMFIN line. There's more information here on this external Autodesk forums: https://forums.autodesk.com/t5/autocad-forum/exploding-a-linetype/td-p/2396437

 

WMFOUT_Exploded_dwg

Badge

Hi @fungergis​,

Is there a reason you're looking to display custom AutoCAD linetypes outside of AutoCAD? And what program(s) do you want to view it on?

 

I would not personally recommend re-creating complex linetypes in FME, as the the LinePatterner transformer uses a lot of math just to set up dashes and spaces. It would be possible to alter that workflow to insert font or other geometry like circles, but it would take understanding the LinePatterner workflow and creating the process to handle characters and geometry at different parts of the line. So it is possible but potentially quite complex. To get to the workflow in the LinePatterner, you can right-click it and select 'Edit...'. As this use case borders more on drawing/creating geometry, I think there may be easier methods outside of FME.

 

Here are two potential ideas depending on your use case:

  1. From AutoCAD, export the file to PDF and read in the PDF. I expect this will bring in the right geometry, but haven't tested this myself.
  2. Depending on how many features have custom linetypes, you can use WMFOUT in the AutoCAD command line to export a vector file, and then WMFIN to import the feature. This new feature is explode-able so you could then use EXPLODE on the feature. FME will then read in all the parts. The screenshot below is of this method viewed in the data inspector. I used the gas linetype because I didn't have a custom one on hand. The top line is the original, while the bottom is the exploded WMFIN line. There's more information here on this external Autodesk forums: https://forums.autodesk.com/t5/autocad-forum/exploding-a-linetype/td-p/2396437

 

WMFOUT_Exploded_dwg

Dear @jovitaatsafe​ 

 

many thanks for your reply!

 

I am working as GIS specialist in a construction company - and my colleagues are interested to view CAD files on ArcGIS Enterprise like they do in AutoCAD - preferably as close to the original DWG/DXF as possible.

 

So the workflow is that FME turns the Autocad colors to HEX codes attributewisely (which works perfectly) and writes the geometries to a geodatabase. My fellow colleagues only have to map the colors in ArcGIS Pro using the attribute values written via FME and share the data with ArcGIS Enterprise. Additionally to that, I was working on the simple line types using the "acad.lin" based patterns of DASHED, DASHDOTS etc. However, my colleagues reached out to me asking if the more complex and custom linetypes could be mapped as well.

 

I also exported the DWG/DXF to PDF or WMF but when looking closely at the data (especially when zooming), lines get distorted and look faulty. But thanks for the hint of exploding. Also thanks for the hint of editing the line patterner workflow. Really good.

Userlevel 1
Badge +11

Dear @jovitaatsafe​ 

 

many thanks for your reply!

 

I am working as GIS specialist in a construction company - and my colleagues are interested to view CAD files on ArcGIS Enterprise like they do in AutoCAD - preferably as close to the original DWG/DXF as possible.

 

So the workflow is that FME turns the Autocad colors to HEX codes attributewisely (which works perfectly) and writes the geometries to a geodatabase. My fellow colleagues only have to map the colors in ArcGIS Pro using the attribute values written via FME and share the data with ArcGIS Enterprise. Additionally to that, I was working on the simple line types using the "acad.lin" based patterns of DASHED, DASHDOTS etc. However, my colleagues reached out to me asking if the more complex and custom linetypes could be mapped as well.

 

I also exported the DWG/DXF to PDF or WMF but when looking closely at the data (especially when zooming), lines get distorted and look faulty. But thanks for the hint of exploding. Also thanks for the hint of editing the line patterner workflow. Really good.

Hi @fungergis​,

 

Thanks for the explanation!

 

On second thought, if its going into ArcGIS, it'd be better to write a proper line to ArcGIS so that you don't lose the line feature. There should be methods to represent line symbology in ArcGIS such as this Esri article in ArcPro to create a complex linetype with text characters: https://support.esri.com/en/technical-article/000024352

 

This may be a better route for going to ArcGIS than re-creating the linetype which will lose the original line geometry.

Badge

Dear @jovitaatsafe​ 

 

many thanks for your reply!

 

I am working as GIS specialist in a construction company - and my colleagues are interested to view CAD files on ArcGIS Enterprise like they do in AutoCAD - preferably as close to the original DWG/DXF as possible.

 

So the workflow is that FME turns the Autocad colors to HEX codes attributewisely (which works perfectly) and writes the geometries to a geodatabase. My fellow colleagues only have to map the colors in ArcGIS Pro using the attribute values written via FME and share the data with ArcGIS Enterprise. Additionally to that, I was working on the simple line types using the "acad.lin" based patterns of DASHED, DASHDOTS etc. However, my colleagues reached out to me asking if the more complex and custom linetypes could be mapped as well.

 

I also exported the DWG/DXF to PDF or WMF but when looking closely at the data (especially when zooming), lines get distorted and look faulty. But thanks for the hint of exploding. Also thanks for the hint of editing the line patterner workflow. Really good.

Dear @jovitaatsafe​ 

 

wow, thanks - I have to admit that I never really got into this more complex styling of linetypes in ArcGIS Pro so I turned to FME (as always) as I view it as a much more versatile. And it actually worked out since ArcGIS took over the (simple) linetypes I defined in FME via the LinePatterner.

 

Thanks a lot!

Reply