Skip to main content
edited tags; edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Changed double quote to single quote to fix syntax error
Source Link
EnE_
  • 605
  • 1
  • 7
  • 19

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource("C'C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C'C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C'C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C'C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C'C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C'C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource("C'C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource('C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource('C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource('C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource('C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource('C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource('C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource('C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

formatted code
Source Link
Chad Cooper
  • 12.7k
  • 4
  • 47
  • 87

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

I am having trouble replacing the data source on CAD files using arcpy.

Everything I have tried runs into this error:

Runtime error type 'exceptions.ValueError' : Layer: Unexpected error

Here is a list of arguments I have tried:

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1.dxf', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/CAD_File_1', 'CAD_WORKSPACE', 'Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf/Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf.Polyline')

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.Polyline')

It appears to take more time to think about going wrong when I put the 'CAD_File_1*' part in the 'Dataset_Name' section, that is to the right of 'CAD_WORKSPACE'. But it still fails.

I have noticed that it treats the CAD file as a Feature Dataset and the particular feature type, in this case Polyline, as the Feature Class which may be the issue.

I have also tried this when pointing at a 'Polyline' layer:

layer.replaceDataSource("C:/CAD_DIR/', 'CAD_WORKSPACE', 'CAD_File_1.dxf)

It doesn't produce the same error or in fact any error but the data does not update.

edited title
Link
EnE_
  • 605
  • 1
  • 7
  • 19
Loading
Source Link
EnE_
  • 605
  • 1
  • 7
  • 19
Loading