Elzohry Academy
Log in / Sign up
EGP $
Home Courses Browse all courses (A–Z) BIM coordination BIM IT Architecture Programming & API Planning Steel structures Structural design Packages Paths Instructors Certificates Forum Contact us Book a support call

A Ready-Made Prompt Template for Requesting a Dynamo or Revit Script from Any AI

Admin ·

Translated from Arabic. اقرأ الأصل بالعربي

Most scripts that come out wrong from AI are wrong because the request is missing information. The AI doesn't know your version, the parameter name, or the units you work in. This template closes those gaps, and you can use it with any tool.

Task: [describe the task in two lines]

Environment:
- Revit version: [e.g. 2024]
- Dynamo version: [the number from Help > About]
- Python engine: [IronPython 2.7 or CPython3]

Model data:
- Category: [e.g. Structural Columns]
- Parameter name: [the exact name]
- Parameter kind: [Instance or Type] / [Text, Number or Length]
- Input from Dynamo: IN[0] = [e.g. a list of elements from Select Model Elements]

Units:
- I work in millimeters. Revit API uses feet internally,
  so convert any length values and say where you convert.

Requirements:
- Wrap every model change in a Transaction (TransactionManager in Dynamo).
- Skip elements where the parameter is missing or read-only, do not crash.
- Add short comments on each step.

Output:
- OUT = [e.g. a list of the changed elements + a list of the failed ones and why]

I will test it on a copy of the model first.

Why each part matters

  • Dynamo version and Python engine: There are differences in syntax and libraries between IronPython and CPython, and code that works on one may not work on the other.
  • The exact parameter name: One wrong letter and the script won't find it.
  • Units: The Revit API uses feet internally, so if you write 300 without conversion, you'll get 300 feet, not 300 mm.
  • OUT: When you specify what it will return, you can review the result easily.

Save the template in a file and just edit the brackets each time.

And if you'd like to understand the code that comes out instead of just copying it, the academy's Dynamo course explains these fundamentals.

#Prompt#Dynamo#Revit#Template

شارك: Facebook X LinkedIn WhatsApp Telegram
Report

0 replies

You'll create an account in one step (or sign in), and your comment will be posted.