Export to CAD tool ignoring CadType override

177
1
4 weeks ago
Labels (1)
Elfrio
by
New Contributor

Hi People,

I've been trying to write a script which can export shape files to an AutoCAD .dwg file. However I seem to have ran into a little issue.

I've done a calculate fields over the shape file, so every polyline has "Polyline" in the attribute table under "CadType".

Elfrio_0-1713953350075.png

Like it says in the documentation, having a field called CADType (documentation is unclear if it should be "CadType" or "CADType") should be able to override the default type in the export to CAD tool.

https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/export-to-cad.htm

  • By default, the tool generates output CAD entity geometries most analogous to the input feature geometry. Output entity types can be overridden by valid values in a field with a name or alias of CADType in the feature attributes of the input feature. For example, the default entity type for exporting feature annotation is TEXT. However, if the output features have a field named CADType with field values of POINT, CAD point entities will be generated in the CAD file rather than the TEXT field. Not all entity CAD entity types are supported for output features.

However, if I then open the .dwg file in AutoCAD. i get 2 of different types of lines ("Line" and "3D Polyline"). I only want it to export normal standard Polylines. Which is the only type it actually doesn't export

Elfrio_1-1713953750004.pngElfrio_2-1713953765509.png

I've for field names i've tried "CADType", "CadType", and "Entity". For the values I've tried "Polyline","POLYLINE" and "LWPOLYLINE" None of these seem to do the trick

Can anyone tell me what I might be doing wrong here?

 

Im running Arcgis Pro 3.1.0 on Windows 10. I am not really able to change versions.

0 Kudos
1 Reply
Elfrio
by
New Contributor

I sort of get why it probably wasn't working. I think it's not the best design.

Some of the shape files had Z values in them. Setting the arcpy.env.outputZFlag to 'Disabled' in the script that creates these shape files seems to have done the trick.

Why the override gets ignored if you do have Z values, but only for polylines, I have no idea.

 

EDIT. the outputZFlag option does get rid of the 3D Polylines. However, the Lines are still an issue. I want this drawing to contain exclusively Polylines. No Lines, nothing else. So I haven't quite been able to figure out why the override isn't actually overriding anything.

0 Kudos