RenderDraw Documentation
  • About RenderDraw
    • What is RenderDraw?
    • RenderDraw Philosophy
    • Key features and benefits
  • Introduction
  • Getting Started with RenderDraw
    • Installation
    • Adding a RenderDraw License to a user's account
    • RenderDraw Permission Sets
      • Using user access policies for automated permission set & License Assignment
    • Relating Drawings to a Salesforce Record
    • CAD Conversion
      • Setup of CAD Conversion
      • UI CAD Conversion for Salesforce for Salesforce Admins
      • Version 1
        • CAD Conversion API (Direct Use)
          • Example input for Conversion
      • Version 2 (proposal)
        • Purpose
        • Sample File Input Conversion
  • Diving deeper
    • RenderDraw Architecture
      • RenderDraw Components
      • Storage of your Drawings
        • Connecting to your drawings
      • Supported Formats
    • Relationships
      • Why Metadata Matters
        • Advanced Metadata Relationships
          • Child Lookup
          • Parent-Child Relationships
      • Record Management
        • Scene Settings
    • Performance Considerations
    • Development Resources
    • Using Components on LWR Digital Experiences
    • Utilizing Interactions within Lightning Flow
    • Fixing Common Issues
  • Usage Scenarios
    • Use Cases
      • 2D
        • Part Finder
          • Data Setup for B2B
            • Choose where you want to display your Product Catalogs
            • Setup Field on Catalog Object
            • Setup Group and Files
          • Parse PDF Catalogs to attach images
          • Base setup for initial catalog page
            • Sharing of Files
            • Clone Pages
          • Create Callouts for Parts
          • Utilize OCR to highlight callouts
          • Optionally show inventory or availability based on data
          • Create Interactions for hover and click actions
          • Create a reusable, connected Datatable
        • Custom 2D App Development using Salesforce
        • 2D Admin Guide (Clicks, not Code)
          • Setting your object up for 2D visuals
          • Setup 2D Scene Settings for a record
          • Add a background image to your scene
          • Adding Droppable Areas and Drop Zones to a Scene
          • Adding Draggable Items to a Scene
          • Relating Components to Salesforce Data
          • Add a DataSource to a 2D scene to bind data
          • Adding Layout Drawing menu to your component (Floorplan & Spatial Drawing)
          • Linking your clicks to Actions / Flows
          • Visual Rules engine
          • Hover Actions and Popovers
          • Change your Layout Drawing visuals based on Salesforce Data in a DataSource query
          • Enable users to take snapshots
          • Show additional Drawings with your 2D Canvas
          • Use Color Selection to add clickable regions to your 2D Scene
          • Use OCR to add Clickable regions to your 2D scenes.
            • Enable Azure OCR in your Remote Site settings & Metadata
            • Add Layout Areas using OCR
        • Data interaction within a Flow
          • Modifying Canvas with APEX
        • 2D User Guide
          • Take a snapshot
      • 3D
        • Admin
          • Adding Components to your Lightning Pages
          • Examples
            • Asset Management
            • Product Visualization
            • Setup for 3D Visual Configuration Scenarios
              • Salesforce CPQ
              • Conga CPQ
              • Custom Configuration Scenarios
            • 3D Product Photography
          • Setup 3D Scene
            • Visual Scene Setup
              • Interaction Events
              • Grouping
              • Labeling
              • Actions
              • Attributes (Look & Feel)
            • Configuration
              • Interaction Events
                • Action Items
                • Conditions
                • Steps
        • Developer
          • Custom 3D App Development using Salesforce
        • End-User Usage
          • View Related 3D Converted files on a record
          • 3D Annotations & Comments
      • CAD Conversion
        • CAD Conversion using Admin UI
          • Prior to getting started...
          • CAD Conversion UI within Salesforce
        • Automatic Conversion in Salesforce
          • Integration User
          • Remote Site Setting
          • Setup Connected App
          • Setup Custom Settings for Triggering Conversion
          • Test your Files
          • Extending the integration using Platform Events
      • RenderDraw Interactive Maps
        • Admin Setup
        • End User Usage
      • Other Apps
        • RenderDraw Data Utilities
          • Essentials
            • Swiper
            • Flow Image display
            • QR Code Generator
            • QR Code Scanner
          • Standard
            • 360º Virtual Tours
              • Administration
              • Usage
            • AnnotateIt! Images
              • Admin's Guide to AnnotateIt! components
              • Permissions / Authorization
            • Standalone Datatable
          • Advanced
            • AnnotateIt! PDF Editor
            • Parsing PDFs
            • CSV Importer
        • RenderDraw for Propel
          • Initial Setup
            • Common Issues
          • CAD Conversion & Visual Viewing
          • Annotate Item Attachments
        • MeasurePro (iOS App)
          • Creating a Deep Link to Launch with Parameters
      • Interacting with RenderDraw using Lightning Messaging Service (LMS)
        • Canvas Element Hovered
        • Canvas Element Selected
        • Canvas Initialized
        • Canvas Interaction
        • Record Selected
        • Code Example of Listening to LMS Events
  • API Documentation
    • 3D Components API
      • Events (Aura)
        • EVT_Renderer_Context_Details_Closed
        • EVT_Renderer_Element_Added
        • EVT_Renderer_Get_CameraPositionandTarget
        • EVT_Renderer_Get_Hierarchy
        • EVT_Renderer_Loaded
        • EVT_Renderer_Mesh_Selected
        • EVT_Renderer_Mesh_Selection_Cleared
        • EVT_Renderer_Select_Component
        • EVT_Renderer_Screenshot_Taken
      • Components (Aura/LWC)
        • 3D Interaction Canvas (LWC)
        • 3D Advanced Renderer (Aura)
        • 3D Scene Director (Aura)
        • 3D Simple Renderer (Aura)
        • 3D File Attachment Viewer (Aura)
    • 2D Components API
      • 2D Interaction Canvas
      • 2D Scene Director
    • Universal Components Used throughout the Suite
      • dynamicContentComponent_treeGrid
    • Data Objects used throughout the Suite
      • Canvas
      • BaseCanvasItem
      • LayoutWall
      • DropZone
      • DroppableArea
  • 👬Digital Twin
    • Digital Twin App
      • Setup
        • Steps to Setup Digital Twin Capabilities
        • RenderDraw Relationship Settings
        • Embedding Digital Twin Components
      • Asset Search
      • Digital Twin LWC Component
        • Custom Component Interaction with Renderer
        • Digital Experience Tips and Tricks
Powered by GitBook
On this page
  • Request
  • Response
  1. Getting Started with RenderDraw
  2. CAD Conversion

Version 2 (proposal)

PreviousExample input for ConversionNextPurpose

Last updated 1 year ago

RenderDraw API conversion only accepts POST requests

Request

This API will primarily convert input CAD files into a specified output format with various options for customization and data extraction.

API Overview

Purpose: Convert CAD files to different formats with options for screenshots, assembly modes, compression, and additional data extraction.

Input Parameters

  1. CADFile (binary or Zip): The input CAD file. Accepts either a binary CAD file or a Zip file containing a CAD assembly with its parts or subassemblies.

  2. DimensionType (string): Indicates whether the CAD file is 3D or 2D. Accepted values: "3D", "2D".

  3. OutputFileType (string): The desired output file type. Typically a GLB file. Other formats can be specified as needed.

  4. TakeScreenshot (boolean): Specifies whether to take a 2D screenshot of the CAD model. Default is false.

  5. AssemblyMode (string): Determines the level of detail in the assembly conversion. Options are:

    • "full": Includes all components.

    • "subassembliesOnly": Includes only subassemblies.

    • "unimodel": Consolidates into a single top-level model.

  6. CompressionLevel (integer): Sets the compression level for the output 3D model. Range is 0-10, with 7 as default.

  7. OutputModel (boolean): Whether to output the converted 3D CAD model. Default is true.

  8. OutputAssemblyInformation (boolean): If true, outputs the JSON structure of the CAD model, including Product Manufacturing Information (PMI). Default is true.

Sample API Calls

Call 1: Basic Conversion

{
  "CADFile": "[Binary CAD File]",
  "DimensionType": "3D",
  "OutputFileType": "GLB",
  "TakeScreenshot": false,
  "AssemblyMode": "full",
  "CompressionLevel": 7,
  "OutputModel": true,
  "OutputAssemblyInformation": true
}

Response 1:

{
  "status": "success",
  "convertedFile": "[URL to GLB File]",
  "assemblyInformation": "[JSON Structure]",
  "screenshot": null
}

Call 2: Subassembly with Screenshot

{
  "CADFile": "[Zip File with Subassemblies]",
  "DimensionType": "3D",
  "OutputFileType": "GLB",
  "TakeScreenshot": true,
  "AssemblyMode": "subassembliesOnly",
  "CompressionLevel": 5,
  "OutputModel": true,
  "OutputAssemblyInformation": false
}

Response 2:

{
  "status": "success",
  "convertedFile": "[URL to GLB File]",
  "assemblyInformation": null,
  "screenshot": "[URL to Screenshot Image]"
}

Additional Notes

  • The API should handle various CAD file formats and be robust enough to process complex assemblies.

  • Error handling must be implemented, especially for unsupported file formats, corrupted files, or conversion errors.

  • Performance optimization is crucial, especially for large and complex CAD files.

  • Security considerations should include secure handling and storage of the input CAD files.

  • Consider providing a progress endpoint for monitoring the status of long-running conversions.

  • Documentation should be clear, comprehensive, and include examples for various use cases.

  • Optional features could include batch processing, additional output formats, and advanced compression options.

This structure provides a comprehensive foundation for the v2 CAD Conversion API, catering to a range of needs from basic file conversions to complex assembly processing with additional data extraction capabilities.

Response

This approach ensures that the response is easily consumable by JavaScript applications. Here's the structure:

Sample Response for Web API Service

Response Format:

{
  "status": "success",
  "convertedFile": {
    "type": "GLB",
    "content": "[Base64 Encoded GLB File Data]",
    "fileName": "model.glb"
  },
  "assemblyInformation": {
    "content": "[Serialized JSON Object with Assembly Information]"
  },
  "screenshot": {
    "type": "Image",
    "content": "[Base64 Encoded Image Data]", // Only if TakeScreenshot is true
    "fileName": "screenshot.png"
  }
}

Explanation:

  1. Status: Indicates the success or failure of the API call.

  2. ConvertedFile:

    • Type: Specifies the file type, GLB in this case.

    • Content: The GLB file data encoded in Base64 format, which JavaScript can easily decode.

    • FileName: Suggested name for the file when saved or processed by the client.

  3. AssemblyInformation:

    • Content: The assembly information provided as a serialized JSON object. This format is native to JavaScript and can be easily parsed and manipulated.

  4. Screenshot (Optional):

    • Type: Specifies the image format.

    • Content: The image data encoded in Base64, provided only if TakeScreenshot is set to true.

    • FileName: Suggested name for the screenshot file.

Considerations:

  • Serialization: All components of the response are serialized, allowing for easy parsing and processing in JavaScript.

  • Base64 Encoding: While Base64 increases data size, it's a standard method for embedding binary data in JSON responses. JavaScript can handle Base64 encoding/decoding efficiently.

  • File Names: Including suggested file names can help clients manage downloaded data.

  • Error Handling: The API should include robust error handling and return meaningful error messages in a similar JSON structure.

  • Documentation: Detailed documentation should accompany the API, explaining the response structure and providing examples of how to handle the data in JavaScript.

This approach aligns with the requirements of a web API service, ensuring that all data is returned in a format that can be serialized and utilized effectively in JavaScript-based applications.