This translation is from the twentieth chapter of the DesignScript Language Manual and can be found at DSLM (pages 60-61) and is entitled; Chapter 20: Modifier Stack and Blocks.
The initial manual translation was made on the Autodesk DesignScript Community Forum and DesignScript.org. Now it can be found at can be found at Chapter 20, Modifier Stacks & Blocks. (Note that it can be not longer be found on the Autodesk Labs Website, as previously linked.)
Continuing on, open the DS Editor and create a new file, lets copy and paste the code from Chapter 20 (pages60 & 61) into the editor. Separate the code by commenting out the “import” statements at each pasted section of code. Run the code in Debug mode (step-in and step-out) in order to generate the graphic windows results in each subsequent page of code. Each graphic result has been pasted along side of the script for reference.
Note that the DS Editor ran code from both pages of the DSL Manual. Moving on, paste the same script into a blank canvas on DesignScript Studio.
Edited out the commenting out so the script will be activated, but first make sure that the “import” statements are commented out.
After commenting out the import statement and the code-block is activated we see that “Modifier Blocks are not supported currently ,” so “this example was altered to include the steps without the associative updating to the elements as evident when run in the DesignScript Editor.” (from previous forum posting on the DesignScript.org site)
The first translation (page 60) shows the script “stacking transformations” yet keeping the elements initial relationship intact for use in forthcoming operations.
The second translation (top page 61) illustrates the use of the cube as a temporary variable to modify itself sequentially.
The third translation as illustrated above attempts to emulate the use of Modifier Blocks (which are not supported). The intent is to eliminate the redundancy of naming the cube repeatedly, while allowing further object description. Continuing on with the more detailed and defined translations with the naming of the variables, identifying them and referencing them into their corresponding nodes. This is shown sequentially for each of the above corresponding (1,2,3) graph node canvases.
The first again utilizes “Stacking Transformations.”
The second example utilizes the cube as a “Temporary Variable.”
And the third attempts to show the intent of the “Modifier Block.”
With the naming and identifying complete for each of the translations, the “Node to Code” operation can take place. Here they are once again sequentially.
We see that a little editing is in order for the first translation as highlighted above.
The second Node to Code is shown below.
And see the third Node to Code below.
The Window Graphics that is generated from the files is shown below.
Note that colors were added in this translation, to highlight the geometry in the Graphic view window.
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.