Revit 2023 - Dynamo and Coding Standards

Marketing
Marketing
  • Updated

By Dennis Collin

Dynamo_and_Coding_Standards_-_1.JPG

Dynamo scripting environment has been available for several years now and the provision of scripts can make many tasks easier to perform. When creating scripts, it is a good idea to follow Coding Standards so that it makes it easier for anyone, including yourself to be able to read, understand and diagnose what you have set out in a script. Coding standards apply to how nodes are grouped, assigned colours and how nodes and variables are named within the script. One such standard used by the Python and .Net framework community is outlined below.

Dynamo_and_Coding_Standards_-_2.JPG

When working with Nodes, the recommended practice is to keep the original node name as a prefix, separated with a pipe symbol, then a description as to what the node does. This can be done by double-clicking the node and editing the node name to suit.

Dynamo_and_Coding_Standards_-_3.JPG

Naming convention in code is applicable to all objects including:

  • Class Names
  • Member Variables
  • Local Variables
  • Lists
  • Constants

Colour coding of groups and naming of nodes can be seen for an example script in the illustration below.

Dynamo_and_Coding_Standards_-_4.JPG

Following these guidelines makes it a lot easier to diagnose problems with scripts or understanding the thought process behind a script. Especially when some time has elapsed between the scripts creation and the time looking through it.

For further information, the following links may be of interest.

Framework Design Guidelines here

Python Recommendations here

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.