Has anyone successfully used ChatGPT to create Dynamo Scripts?

Hi everyone,

I’ve been attempting to use ChatGPT to create various Dynamo scripts, including a specific one for adding multiple views to multiple sheets. Unfortunately, my experiences have not been successful so far.

I’ve noticed that sometimes ChatGPT suggests methods or nodes that don’t exist in Dynamo, which complicates the process. I asked for a detailed walkthrough that only led me to dead ends.

Is this even possible yet with the technology we have? Has anyone in the community ever succeeded in creating a Dynamo script with ChatGPT’s help? If so, I would appreciate hearing about your experiences, particularly any tips or workarounds you’ve found useful.

Thank you!

Oh… and if anyone has a “Add Multiple Views to Multiple Sheets” script… please let ChatGPT know how to create it :wink:

Hi @serei i have to admit i havent tried with graph as i guess you mean…guess its better for code…for graph its best just learn it from primer and follow in this forum here…and when first learn it will be much faster and flexible than chat gpt…just a though imo, but on the other hand i think many things can change there in the future…:wink:

2 Likes

I love chat GPT… I use it every-single-day… However it has severe limitations.

For Dynamo it sucks. It makes up nodes all the time.

For Revit API it’s not great either and makes up commands.

For Python in Dynamo it’s also meh… very basic stuff it’s great but not much more than some loops. 30 lines code max at once I’d say.

For pure Python it’s much better - but again, not perfect and if you’ve no clue what you’re doing you’re going to hit a wall very fast.

For C# I have to say I’m impressed. It’s much better than me and it’s teaching me… I don’t think I could have learned much for Dynamo or Python in Dynamo from it.

WPF with C# same comments as C#.

My tips for GPT: Do tiny bits of logic at once. Try to get the bare bones of your work first. Then ask it to tweak. Something like, “I have got my sheets from Revit like this, how would you improve this?” … Or, “I’ve got my sheets, how do I extract parameter XX?”

Tips for the add multiple views:
Write your logic out in basic human language first.
1 - Select all sheets from 20 series (for example)
2 - Select views to add
3 - add views to sheets.

Break down each step.
1- HOW am I selecting sheets? Do I want a pop-up window, do I want to write sheet names into the code?
What am I doing with the views? Am I copying with detailing? If the view is a legend, do I want to copy it or use the same one?
How am I going to number it? Revit won’t let you use the same number twice. (for multi views on multi sheets I prefix each view and each new sheet with the user’s name… it’s a QA thing to try to make sure they name stuff correctly, and if they don’t … we know who did it :smiley: )

3 Likes

ChatGPT is really REALLY good at making things up. It won’t admit when it doesn’t have an answer, which is why you end up with so many methods that don’t exist. Unfortunately, it’s also really good at making those methods look convincing. The more “documentation” that exists, the less likely ChatGPT is to make up a method. This is why you can pretty reasonably rely on it for Python but not Dynamo - Python has a huge user-base and is pretty stable, whereas Dynamo is still relatively new, always changing, and has a much more niche application.

For these reasons, I would not recommend using ChatGPT to learn methods or specifics within Dynamo. However, it can be helpful in working through generic logic problems and planning out your workflow process. The Dynamo forums will be a much better place to figure out your specifics once you have your plan of action. If you want to work in Python, then you can lean more heavily on GPT produced code. But even then, if you’re working with the Revit API, only use ChatGPT as an outline. Always confirm your Revit methods through the forums or Revit API documentation.

As for solving your problem with multiple views on multiple sheets… try searching for similar topics. There are quite a few dealing with view and sheet creation. The difference between one view/sheet and multiple is just a matter of list management. The process is still the same.

3 Likes

Also… Do you want to create sheets from scratch or just place some views on existing sheets?

Do these views already exist… or do you want to create new ones.

You need to nail down your specifics before you approach the coding.

I use GitHub co-pilot which is really good at completing lines of python and sometimes it can get a function to around 90% quickly, however this works because co-pilot is context aware and is trained on a huge database of general python code.

I have also been testing Claude for other common coding tasks and I am quite impressed at its ability to code and correct itself.

For Dynamo and Revit there will always be the issue that the information available for training is limited to a few forums, some documentation and probably less than a hundred public repositories of code.

I think the challenge with Cgpt for Dynamo is the primary medium for Gpt is text, whereas Dynamo is methodical to describe.

Having said that it has been incredible for learning C#, although having a python/OOP background was crucial as well as knowing fundamentals - I spent a few months without GPT just to get comfortable with VS, basics, event/delegates etc.

I stick screen grabs into GPT all the time now. I love that feature. :smiley:

yes but there is no code interpreter to verify the code is working or not, for now I am testing for fun.

If you run it and there is no yellow or red… :person_shrugging:

@solamour wasn’t this something a team was looking at during the AU Hackathon?

*edit*: Mostafa El Ayoubi El Idrissi on LinkedIn: #dynamobim

Great work as always @Mostafa_El_Ayoubi!

1 Like

All these AI tools can be good, but you do have to watch out when getting into production/release level of scripts.

To have a company wide scalable script/code you need to be able to fully understand what the tool has given you, document what it does, plus more importantly it must be QA-ed before released onto projects.

4 Likes

Everyone has pretty much covered the ChatGPT part of your post, so I won’t repeat what has already been stated.

For your last part about adding views to sheets. Look at the “Viewport.Create” node from Rhythm. That will handle it. You will need to use the lacing and possibly levels if you are trying to do multiple sheets and views at the same time.

Thanks for the insights! I’ve definitely seen the limitations with ChatGPT in Dynamo, especially with it suggesting nodes or commands that don’t exist, which can be frustrating :frowning: . Your approach of breaking things down step-by-step and testing small logic pieces sounds like a solid plan :slight_smile:

Thanks for the suggestion! I’m aiming to add multiple existing views to multiple existing sheets based on lists in Dynamo. I tried using Data-Shapes’ “UI.Multiple Input Form++” but couldn’t get it to work as intended. I’ll definitely look into “Viewport.Create” as you suggested. Appreciate the guidance!