This translation is from the eleventh chapter of the DesignScript Language Manual and can be found at DSLM (pages 34-36) and is entitled; Functions. There also is a companion video tutorial on Functions (#8), which can be found in the DS website’s tutorials.
The initial translation was made on the Autodesk DesignScript Community Forum and DesignScript.org. Now it can be found at can be found at Chapter 11, Functions, Code to Node Translations. This is the first part on multiple posts to be made on this chapter. Lets see how it goes.
Open the DS Editor and create a new file and copy and paste the code from Chapter 11 (pages 34) into the Editor. Run it, and observe that their aren’t any errors generated, as illustrated and highlighted below. The same can be pasted into a blank canvas of DesignScript Studio.
Below is what the DS Studio canvas looked like in that initial posting.
A more detailed and defined translation was done and involved naming the variables to identify and reference into them to their corresponding nodes.
Then with the naming and identifying complete, the “Node to Code” operation can take place.
The Windows Graphic that is generated from the files. Note that colors were added for interest.
The second part of this chapters original translation which operates with a defined function, works with the DS Editor as shown below.
Copy and paste the script into a new DSS canvas in and run it.
Above is illustrated the error drawn in DS Studio as Functions are not supported in it. However, continuing with a work around, it’s roughed out as previously posted.
Then the nodes then are broken down into groups and detail commentary is added.
Adding to this is the translation “Back to Code”, which is shown below.
The Geometry that is generated from these files is shown below.
Reiterating, this was done on the stand-alone version of DesignScript, rather than as a plugin for AutoCAD. The files are available for downloading from the Drop-Box links below.
Thanks for looking.