FormIt for Windows
English
English
  • Introduction
  • What's New
  • FormIt Capabilities
    • Multiple Clients
    • Conceptual Solid Modeling
    • Working with Data Formats
    • Languages
    • Collaboration
    • Presentation Graphics
    • FormIt + Autodesk Docs
    • FormIt + Dynamo
    • Solar + Energy Analysis
    • FormIt + Revit
    • FormIt + JavaScript for Plugins
  • FormIt Introduction
    • Frequently Asked Questions
    • Prerequisites and Installation
    • Setting Up the Project
    • Toolbars and Palettes
    • Navigating the Scene
  • FormIt Primer
    • Part I
      • 1.1 - Set the Location
      • 1.2 - Project Set Up with Images and Grid
      • 1.3 - 3D Sketch and Drag Face
      • 1.4 - Add Floors with Levels
      • 1.5 - Group Objects
      • 1.6 - Control Visibility with Layers
      • 1.7 - Paint with Materials
      • 1.8 - Create Columns with Array
      • 1.9 - Adding Details
      • 1.10 - Computational Groups with Dynamo
      • 1.11 - Import Models with Content Library
      • 1.12 - Visual Styles
      • 1.13 - Section Planes
      • 1.14 - Export Image
      • 1.15 - Working With Revit
    • Part II
      • 2.1 - Offset Line Tool
      • 2.2 - Advanced Modeling Tools: Shell and Cover
      • 2.3 Orthographic View Workflow
      • 2.4 - 3D Terrain Workflows
      • 2.5 - Plugins
      • 2.6 - Dynamo FormIt Nodes
      • 2.7 - Diagnostics Tools
      • 2.8 - Advanced Revit Workflows
      • 2.9 - Solar and Insight Energy Analysis
      • 2.10 - Collaboration Sessions
  • Tool Library
    • 3D Text
    • Align Camera With Face
    • Arc
    • Array
    • Array Along Path
    • AutoSave
    • Boolean Cut
    • Boolean Intersect
    • Boolean Join
    • Circle
    • Collaboration
    • Content Library
    • Copy Object
    • Cover, Sweep, Loft
    • Create Panorama
    • Curve + Surface Faceting
    • Delete, Edit, Move
    • Dynamo
    • Energy Analysis with Insight
    • Faces: Extrude, Cut and Offset
    • Faces: Flatten
    • Faces: Tilt and Facet/Smooth
    • Groups Tree
    • Groups
    • Import and Export Data
    • Layers
    • Levels and Area
    • Lines
    • Materials
    • Measure Angle
    • Measure
    • Meshes
    • Mirror
    • Model Statistics
    • Model Tree
    • Modifying Faces, Edges, and Points
    • Non-Uniform Scale
    • Offset Line
    • Orthographic Views
    • Orthographic and Perspective Camera
    • Placing Primitives
    • Place Vertex
    • Plugins
    • Polygon
    • Properties
    • Railing Along Path
    • Rectangle
    • Revit
    • Rotate Object
    • Scale Object
    • Scenes
    • Section Planes
    • Selection
    • Setting Location
    • Sun + Shadows
    • Shell
    • Snaps and Inferences
    • Solar Analysis
    • Spline
    • Storefront/Curtainwall Mullion System
    • Undo Manager
    • Visual Styles
    • Work Planes
    • World Axes
  • Plugins
    • Introduction to Plugins
    • How to Use Plugins
    • How to Develop Plugins
      • Your First Plugin
        • Plugin Playground
        • Launching the Sample Plugin
        • Adding Your Own Features
        • Saving Your Work to GitHub
        • Publishing Your Project
      • Advanced Development
        • Using an IDE
        • Cloning a Sample Plugin
        • Hosting a Plugin on a Local Server
        • Previewing a Plugin in the Plugin Manager
        • Setting Up FormIt for Development
        • Hosting a Plugin on GitHub
        • General Plugin Setup in the Manifest
        • Reloading for Local Changes
        • Client-Side vs Web-Side Engines
        • Debugging
        • Versioning
      • Additional Development Options
        • Creating an HTML Panel Plugin
        • Creating a Combined HTML Panel and Toolbar Plugin
        • Creating a Toolbar-Based Plugin
        • Testing a Combined HTML Panel and Toolbar Plugin
        • Creating an Add-In
        • Invoking Plugins and API from Dynamo
    • FormIt APIs
    • Examples
      • Generate String Lights
      • Manage Cameras Plugin
      • Properties Plus Plugin
      • 3D Context Creator
      • FormIt Plugin Community
  • Appendix
    • Keyboard Shortcuts
Powered by GitBook
On this page
  • Structure of a Toolbar-Based Plugin manifest.json
  • Configure Toolbar Format with JSON
Edit on GitHub
  1. Plugins
  2. How to Develop Plugins
  3. Additional Development Options

Creating a Toolbar-Based Plugin

PreviousCreating a Combined HTML Panel and Toolbar PluginNextTesting a Combined HTML Panel and Toolbar Plugin

Last updated 3 years ago

Structure of a Toolbar-Based Plugin manifest.json

A toolbar-based plugin has a manifest.json file with the following structure:

{
    "PluginName": "Flip Along",
    "PluginType": "Toolbar",
    "PluginDescription": "Creates a toolbar with X, Y, and Z buttons to quickly flip selected geometry in the direction of the selected axis.",
    "ToolbarURL": "PLUGINLOCATION/toolbar.json",
    "Scripts": [
        "PLUGINLOCATION/flipalong.js"
    ]
}               
  • "ToolbarURL" tells FormIt that this plugin is a toolbar and links to the location of another JSON file that describes the toolbar's functionality.

Configure Toolbar Format with JSON

After creating a manifest file like the one described above, you'll need to create the toolbar.json file, which defines the toolbar buttons, their names, text, icons, and the onClick function assigned to each button. The toolbar's JSON file will have the following format:

{
    "name": "Flip Along Toolbar",
    "buttons": [
        {
            "name": "Flip Along X",
            "command": "FlipAlongPlugin.ButtonX",
            "iconText": "X",
            "iconURL": "[Icon URL]"
        },
        {
            "name": "Flip Along Y",
            "command": "FlipAlongPlugin.ButtonY",
            "iconText": "Y",
            "iconURL": "[Icon URL]"
        },
        {
            "name": "Flip Along Z",
            "command": "FlipAlongPlugin.ButtonZ",
            "iconText": "Z",
            "iconURL": "[Icon URL]"
        }
    ]
}               

The toolbar.json file includes these JSON properties:

  • "name" represents the name of the overall toolbar, and is used internally to associate all the buttons to the single toolbar menu.

  • "buttons" represents individual buttons added inside of the toolbar. A toolbar can have any number of buttons.

  • "name" defines the button's internal name, which is used to associate the button to the toolbar as well as to the button's onClick function.

  • "command" defines the function of the button, which can come in one of two forms: a JavaScript function (which can be defined in a script contained in the manifest.json "Scripts" field), or a FormIt command, for example, "Draw: Circle". You can obtain a list of FormIt commands by running the Messages plugin.

  • "iconText" sets the tooltip and description text in the button. If an icon URL is not provided, the text will create an auto-generated icon of formatted text.

  • "iconURL" can be set to define a custom icon for the button.

After the buttons have all been defined in the toolbar.json file, the plugin is ready to go.

If there are any additional JavaScript functions you would like to define, add them to the same folder as the manifest.json file. Be sure to add the file reference to the "Scripts" field of the manifest file as well so that FormIt can find the files.

In addition to the , a toolbar-based plugin includes this special JSON property:

standard JSON properties