Cannot add lasd to map using python script in 10.2.2

1614
2
11-13-2014 02:03 PM
MarkNigrelli
New Contributor

I created a python script which creates a las dataset and adds it to the map. It worked fine in 10.1. I just installed 10.2.2 and now it gives me an error when I run the script. Is there something wrong with my script or did something change between 10.1 and 10.2.2 in terms of programmatically adding a lasd layer to a map?

Here's the offending subset of my script:

        arcpy.management.CreateLasDataset(InputLAS, OutputLASD, "NO_RECURSION", "", "", "", "RELATIVE_PATHS")

        Output_LASD_Layer = arcpy.CreateUniqueName("OutputLASD.lasd")

        arcpy.management.MakeLasDatasetLayer(OutputLASD, Output_LASD_Layer)

        addlayer = arcpy.mapping.Layer(Output_LASD_Layer)

        addlayer.name = Output_LASD_Layer_String

        arcpy.mapping.AddLayer(DataFrame, addlayer)

I get a value error:

Traceback (most recent call last):

  File "Script.py", line 138, in <module>

    addlayer = arcpy.mapping.Layer(Output_LASD_Layer)

  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\mixins.py", line 389, in __init__

    super(LayerMixin, self).__init__(lyrfile)

  File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\_base.py", line 47, in __init__

    for arg in args))

ValueError: Object: CreateObject Layer invalid data source

Tags (3)
0 Kudos
2 Replies
ErikNilsson
New Contributor

Hi,

Did you find a solution to add lasd-files to ArcMap? I have tried different approaches in 10.6 but haven't found a solution yet.

0 Kudos
JoeBorgione
MVP Emeritus

Eric-  given this original thread is 5 years old and refers to a version of software on which the sun has set, you may what to:

Start a new thread

and/or

Provide more details with respect to what you have tried, what are the desired results, and what are the actual results or error messages your are receiving.

That should just about do it....
0 Kudos