How to write this script in designscript

Hi,

I’m learning designscript and want to know how to write find/replace script in DS codes? Any feedback is appreciated.

Thanks - Jo

Hi !

You can select all your nodes, right click, and press Node to Code. That should do the trick.

As @mellouze said use node to code, but try different ways of selecting.
Start at the right of your graph selecting the last two nodes and use node to code, read what it says and try to grasp it, undo, take 3 nodes the next time and on and on until it makes more sense.

2 Likes

and to add to what @mellouze & @Marcel_Rijsmus are saying when you follow this method you will start to think of the nodes by their call name thus making them easier to write.

@mellouze @Marcel_Rijsmus @emmett.cruey

Thanks guys for the suggestion but here’s what happened. So I tried selecting the last two nodes, used node to code and got this error message. Is it my dynamo that’s causing the problem?

it says Object reference not set to an instance of an object,
Did you use a revit file (with titleblocks) and start Dynamo from there?
If the Dynamo graph runs without errors, start your node to code quest :slight_smile:

That’s what I did but it still crashed.

1 Like

Might be an outdated (or overdated if you’re in an older Dynamo version) package at play. Can you install the monocle view extension and document your custom nodes real quick?

Sorry - totally newbie. I installed the monocle view extension but no sure how to document the custom nodes.

In the monocle menu it’s the package usage doge tool. Should be pretty straight forward from there.