ArcPy CAD Polygon – CAD File to Polygon Using Feature to Polygon

arcpycadconvertpolygon

I have cad layer file and I want to use feature to polygon. I want use arcpy to do this but it dosnt work.

import acrpy
arcpy.env.MResolution = 0
arcpy.env.MTolerance = 0
arcpy.env.outputZValue = 0
arcpy.env.outputZFlag = "Disabled"
arcpy.env.ZResolution = "0 Meters"
arcpy.env.ZTolerance = "0 Meters"
arcpy.env.workspace = r"C:\Users\Moayedian.MHD\Desktop\test1\6007-6-343\cad"
land1 = r"C:\Users\Moayedian.MHD\Desktop\test1\6007-6-343\cad\land1.dxf Polygon"
output = r"C:\Users\Moayedian.MHD\Desktop\test1\6007-6-343\GiS\land1\new_land"
arcpy.FeatureToPolygon_management = (land1,output)

Best Answer

import arcpy
land1 = r"C:\Users\Moayedian.MHD\Desktop\test1\6007-6-343\cad\land1.dxf\Polygon"
output = r"C:\Users\Moayedian.MHD\Desktop\test1\6007-6-343\GiS\land1\new_land.shp"
arcpy.management.FeatureToPolygon(land1,output)
  1. Spell arcpy correctly when importing
  2. Backslash between dxf and polygon
  3. Call FeatureToPolygon correctly
  4. Add the .shp to the new_land if exporting to a shapefile in the land1 folder
Related Question