Create a Button that Runs a Dynamo Script

One of the newest features of Civil 3D 2021 is the integration of Dynamo. Out-of-the box you can find the Dynamo tools on your Civil 3D Manage tab of the ribbon.

The default buttons, located on the Manage tab.
The Visual Programming panel is located on the Manage tab of the ribbon.

Clicking on the Dynamo button will take you to the Dynamo scripting environment, while clocking on Dynamo Player will take you to the Dynamo Player window.

The Dynamo player window.

In this window, you can change the folder to look for .dyn files (the native file type for dynamo graphs), open the currently selected folder in Windows Explorer or Refresh the current folder contents. This interface can be detrimental to the average user, if they don’t understand how and where your dynamo graphs are being stored. To get around this, you can create your own command buttons that can call a specific dynamo graph.

The CUI Command settings.
The command portion of the CUI dialog box.

When creating a new command in the CUI, insert “_AeccRunDynamoScript ” in the Macro line. Make sure to add a space after the command. After the space, add a path and dynamo file name, using the / path separator. Be sure to enclose the path in double quotes if there are any spaces. Add one more space at the end of the line.

With this new button, a user will not have to open a dialog to choose a script or even know where those files are stored.

Published by Adam Reilly

An Autodesk Civil 3D Certified Professional with almost 15 years of experience in Civil 3D and over 20 years in the civil engineering industry. I love working with, learning about and teaching Civil 3D.

Leave a comment

Design a site like this with WordPress.com
Get started