Upload CAD - Geoprocessing Service

4509
8
Jump to solution
10-08-2015 05:07 AM
shaikshavali
New Contributor II

I want to upload CAD file and view the contents of it as graphics on the client side. For this purpose, i am uploading the CAD file to a directory on the server and want to pass the file path to the geoprocessing service. The geoprocessing service was created using model builder. I used 'CAD to Geodatabase' tool to create the model and made the input CAD dataset and output dataset as model parameters.Please check the attachment of the model. The model works but when i publish the geoprocessing service, the input parameter is always constant. ArcGIS considers the CAD file as non-transportable type and always take constant path of the file.

@Input modes and parameter data types—Documentation (10.3 and 10.3.1) | ArcGIS for Server

I want to send a dynamic file path to geoprocessing service. Please help.     

I am using arcgis silverlight api at the client side.

0 Kudos
1 Solution

Accepted Solutions
Musa_SerkanArslan
New Contributor III

Finally i used another way, because i could not succeed this method. We are converting cad file to json format for necessary layers (like point, annotation and line). Then drawing features manually on client side. The result is not very well but acceptable. User upload the cad file to server. I published a geoprocessing service which convert cad file to json format. this service converts cad file to json. But if i solve the problem i will try it and compare both.

I am open for any other solutions.  

View solution in original post

8 Replies
KevinHibma
Esri Regular Contributor

You're correct that GP Server considers CAD as a non-transportable type.

You'll need to modify your workflow into a script. From there you can either use a FILE or a STRING variable as input. (Sounds more like you want to use STRING). Within the script you're responsible for passing the "cad file path" to the CAD to Geodatabase tool.

(I just tried in MB but the CAD to Geo tool seems pretty strict on the inputs, thus you wont be able to make a multi-string variable or a multi-file variable and hook it up to the point the tool will run. A script ​should​ get you around  the validation requirements of the tool.)

0 Kudos
shaikshavali
New Contributor II

Thanks for the reply kevin. You are right. The tool is pretty strict in accepting inputs.

I have created a python script that accepts string as a parameter where i send file path. It works fine in the arccatalog but when i publish the script as service and try it, the job fails. I dont undertand what to do.

Is there anything that i might be doing wrong?

0 Kudos
Musa_SerkanArslan
New Contributor III

I am also trying to do same thing. My way is like this, First i have upload cad file to a shared folder which is registered to ArcGIS server and rename it to a static name. I wrote a python script to read this file and give to CAD to Geodatabase tool as input. I have published this model but i have another problem.

My geoprocessing service is exporting cad file  same output gdb for each request. So it works for first request and  gives an error for second and others  " output dataset is already exist"

I am trying to give output workspace to Geoporcessing service arcgisjobs folder which creates a new folder for each job with an job id.

I have set output geodatabase as Scratch Workspace and selected a shared gdb.

Any help on this problem.

0 Kudos
shaikshavali
New Contributor II

Hello Musa,

Did u fix the problem? Please post here.

Thankyou

0 Kudos
Musa_SerkanArslan
New Contributor III

Finally i used another way, because i could not succeed this method. We are converting cad file to json format for necessary layers (like point, annotation and line). Then drawing features manually on client side. The result is not very well but acceptable. User upload the cad file to server. I published a geoprocessing service which convert cad file to json format. this service converts cad file to json. But if i solve the problem i will try it and compare both.

I am open for any other solutions.  

SU00861536
New Contributor III

Hi, Your Approach is correct to convert the CAD (DWG/DXF/DGN) into geojson layers and load the geosjson layers on map. can you share some code so i can test the data compatibility of different versions means DWG 2000 -- to latest DWG versions. I will test it and update the same for community. @shaikshavali 

0 Kudos
Musa_SerkanArslan
New Contributor III

You can review the attached script.

0 Kudos
SU00861536
New Contributor III
0 Kudos