Skip to content

justnnf/ExB-JSON-Import-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Experience Builder Draw Import for ArcGIS Pro

This project provides a Python Toolbox (.pyt) and core logic script for ArcGIS Pro that allows users to import sketches and drawings exported from the ArcGIS Experience Builder Draw Widget. It converts the web-based JSON format into native, high-quality graphics within an ArcGIS Pro Graphics Layer.


Features

  • Comprehensive Geometry Support: Imports Points, Polylines, Polygons, and Text elements.
  • High-Fidelity Symbol Styling: Uses the ArcGIS Pro CIM (Cartographic Information Model) to replicate web styles:
    • Points: Supports vector markers and embedded images (Base64/URL).
    • Lines & Polygons: Supports various dash patterns, stroke widths, fill colors, and transparency.
    • Text: Preserves font family, size, halos, rotation, and alignment, including automatic text wrapping.
  • Structured Organization: Automatically organizes imported graphics into groups by Geometry Type and Style for a cleaner Contents pane.
  • Coordinate Management: Detects and applies the spatial reference (WKID) defined in the source JSON.
  • Summary Reporting: Provides a detailed breakdown of total elements imported (Points, Lines, Polygons, and Text) in the geoprocessing messages.

Installation

  1. Download the Files: Save both ExperienceBuilderDrawImport.pyt and exb_draw_import_core.py into the same folder on your local machine.
  2. Add to ArcGIS Pro:
    • Open your ArcGIS Pro project.
    • In the Catalog pane, right-click on Toolboxes.
    • Select Add Toolbox.
    • Browse to and select ExperienceBuilderDrawImport.pyt.

Usage

  1. Export from Web: In your ArcGIS Experience Builder application, use the Draw widget to export your sketches to a JSON file.
  2. Run the Tool: In the ArcGIS Pro Catalog pane, expand the toolbox and double-click the Import Experience Builder Draw JSON tool.
  3. Set Parameters:
    • Input Experience Builder JSON: Browse to your exported JSON file.
  4. Execute: Click Run.
    • The tool identifies the active map.
    • A new Graphics Layer is created with a timestamped name.
    • Check the geoprocessing messages for a summary of the import.

Technical Details

  • Requirements: Designed for ArcGIS Pro 3.x (utilizing Python 3 and the V3 CIM specification).
  • Graphics Layer Advantage: Instead of creating Feature Classes, this tool uses a Graphics Layer to allow for mixed geometry types and unique, per-element styling that matches the "sketch" nature of the source data.
  • Image Handling: For Picture Marker Symbols, the core script extracts image data to temporary files to ensure they render correctly within the Pro environment.

Project Structure

  • ExperienceBuilderDrawImport.pyt: The ArcGIS Python Toolbox file defining the tool interface, parameters, and basic execution flow.
  • exb_draw_import_core.py: The core logic engine responsible for JSON parsing, geometry conversion, and complex CIM symbol mapping.

About

A custom python toolbox for ArcGIS Pro to import JSON exports from Experience Builder.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages