Web AppBuilder (developer edition) 2.16 - which way to go in developing custom widget to display DWG file?

3240
11
Jump to solution
07-29-2020 06:03 AM
MichaelLev
Occasional Contributor III

I need to develop a custom widget for Web AppBuilder (developer edition) 2.16

in order to display a DWG file (2d or 3d) in 3D scene.

The DWG will always be in ITM coordinates (Israel TM grid, that is EPSG:2039) even if not specified.

The DWG contains Lines, Polygons and Points. Most of the time the other layers except lines will be empty.

What choice is more preferred/applicable -

1. Convert to 3 shape files (for lines, polygons and points) and display them?

2. Convert to KML and display it (is there a way to display 2d/3d KML?)?

3. Display the DWG directly (is a way to do it?) ?

I assume the only applicable way is 1, but I want to know more in order to be sure -

- Is conversion from DWG needed at all?

- Converting to KML is easy, but maybe KML 2D/3D could not be added to 3D scene?

- Or maybe there are more suitable ways to go by?

Help will be greatly appreciated.

Michael

1 Solution

Accepted Solutions
MichaelLev
Occasional Contributor III

Dear Majdoleen,

I got confused, and I'd appreciate it if you elaborate on the way you are going.

In addition, in case it could help - I elaborate here on my way: I have succeeded to accomplish my task, by developing 2 independent widgets in the Web AppBuilder -

  1. "Convert DWG" custom widget - Displays explorer dialog to choose DWG in the PC and then uses my Fme Cloud to convert from DWG into zipped shapefile which the user downloads to his PC.
    This widget code is based on FME web app code example FME Server Playground - Upload File In Session.
    Important: transformation from DWG to shapefile (translating coordinates from Israel TM into geographic coordinates) succeeded in FME Workbanch but failed in cloud (they had some bug in the the cloud linux). I opened question in FME cloud community and got necessary help from an FME expert 
  2. "Add Shapefile" custom widget - Displays explorer dialog to choose zipped shapefile in the PC, adding it to the 3D map.
    This widget is based on ESRI web app code example Create a FeatureLayer from a shapefile.

I had to split into 2 independent widgets, since

  1. Win10 disables any "communication" between my web app and the explorer "save file" dialog
    (I could possibly upload from FME zip url into my Amazon S3 cloud [complicated, have not tried such thing yet], and add to the map by specifying Amazon S3 url of zipped shapefile, but I failed in adding to the map by Amazon S3 url of the zip)
  2. It makes sense, since the 2nd widget could be used independently to add several existing zipped shapefiles to the 3D map.

I already saw that my task is not completed yet - I need additional development efforts in at least the next 2 areas:

  1. My current DWG is simple and includes only lines. Maybe I'll have to improve for more complicated DWG, especially if it has things beyond the 3 geometries (Points, Lines and Plolygons), especially colors.
  2. I'll have to continue to see that the final 3D map could be either saved with all the added data, and/or how can the user remove some of the added shapefiles, if he wants to.

Michael

View solution in original post

0 Kudos
11 Replies
CarlosNantes
New Contributor III

Michael, same question asked here: https://community.esri.com/thread/251590-displaying-dwg-file-over-the-arcgis-js-map-viewer 

I've provided some steps there that may help you approach this problem.

MichaelLev
Occasional Contributor III

Dear Carlos,

Thank you!

I'm in midst of doing it by another way - using fme cloud server (and workspace buit in fme workbench). I'll update you when I've come to conclusions.

Michael

MajdoleenO_A__Awadallah
Occasional Contributor III

Dear Michael,

I am trying to do it with the same way that you are looking for, I have the workbench, and it is successfully published to fme server, but I couldn't figure out how to use the link and develop a tool to use it in JS map. I am looking for your findings, if you wish I can share with you the workbench.

Best

Majdoleen

MichaelLev
Occasional Contributor III

Dear Majdoleen Awadallah,

Does your workbench create the correct output as you expect (I mean, there are 2 aspects: 1. To create the wanted file format, 2. Covert coordinate systems, if needed)?

If positive, Then you need to

- link the source to e.g. 'SourceDataset_ACAD' user variable name,

- link the result to e.g. 'FME_SHAREDRESOURCE_DATA' server variable

Then after publishing it to fme server (I use fme cloud) you need to learn and adapt the code in

FME Server Playground - Upload File In Session

so it will fit within your web application.

Do you develop web application or Web AppBuilder custom widget? Do you use 2D or 3D ?

I'm doing the 2nd option with 3D Scene.

I managed to activate the exaple code within my web app and my fme cloud with my input and output formats and coordinate systems (I don't need to insert the result file into a map in my example web app), and now in midst of developing and debugging the custom widget stuff, where I'll have to insert the result into the 3D web scene.

Advice: Referring the fme stuff - I have asked questions in fme community (of e.g. fme cloud) and got serious help. In addition, if the company you work in has licence for the fme workbench, you are entitled help from the fme-agency that sold the workbench to your company.

Michael.

MajdoleenO_A__Awadallah
Occasional Contributor III

Thank you for your reply,

Our workbench is published to our FME server and  the output is .json file, (we used this json in a workflow tool in geocortex) without converting the coordinate system. we are using Geocortex as a web mapping application, we managed to develop a tool that can import and display AutoCAD file (.dwg) in the geocortex map using FME server. but now we are trying to develop the same tool for our management portal which built using Cityworks application using JS map, I gave more details regarding the cityworks in this post.

Is their any JS code that can display the.json file into the map?

May you please give me more details regarding the approached that you used?

Thank you in advance

Best

Majdoleen

MichaelLev
Occasional Contributor III

I know nothing concerning geocortex, and Cityworks application. I'm pretty newbie to this area (learned few month on ArcGis Pro, and works 2.5 months on building custom widgets on esri Web AppBuilder.

The approach I'm using - the company I work in, decided to supply to their customers web applications built with esri Web AppBuilder, and I'm developing custom widgets to add needed useful features.

Now I'm within developing custom widget for inserting Autocad DWG file into a Scene, nad have not yet completed it. I'll get the zip of the shape file from fme cloud, but I have not yet implemented how to put it inside the Scene.

I have not yet managed with json maps...

If I may suggest - I suggest that you split your problems, and ask specific and focused questions in the relevant communities. Create a specific question per problem, so that e.g. the esri or fme programmers that scan the communities will get clear understanding from each question's title.

If to think "top down" - I can't evaluate if the whole approach you are following is the preferred one or not - I understand that there are several companies supplying solutions - geocortex, Cityworks, and of course esri.

I have not the knowledge to understand which way to go. Perhaps you ask also about which "top" approach is the preferred one? Perhaps you are a only little step from your goal and all you need is some help from Cityworks experts?

P.S.

Maybe as FME serves to convert between many formats, besides Citywoks experts, also FME people will know which format is applicable to be displayed in Cityworks.

Sorry I don't know to help more,

Michael

MajdoleenO_A__Awadallah
Occasional Contributor III

Thank you Michael, Your input is very useful, I will take care of your suggestion and try to split the problem. I will add that both Geocortex and Cityworks are using Esri platform map. Cityworks html map is built using ESRI API.

 Also, I will be happy to update you with my findings once it works with me.

Thank you in advance.

Best

Majdoleen

MichaelLev
Occasional Contributor III

Indeed I know nothing about Geocortex and Cityworks - Maybe they are perfect to be used by the customers of the company you work in and develop on those systems.

I can only suggest that you ask in the esri community whether someone is familiar with those 2 systems and can help with your code mission (a question per system or one for both).

I assume what I wrote here is trivial, but maybe it'll help.

Michael

MichaelLev
Occasional Contributor III

Dear Majdoleen Awadallah,

Today when I'm trying search how to import from my fme cloud url containing zipped shapefile into my 3D Scene, I saw in Create a FeatureLayer from a shapefile a code examplle which uses Generate to generate features from a CSV file, shapefile, or GeoJson file. Maybe this example could help you?

I'm currently am trying to see if this example can help me.

Michael