DesignScript LM, Chapter Eleven Translation-Functions

Hi Everyone:

This translation is from the eleventh chapter of the DesignScript Language Manual and can be found atDSLM(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.

Chapter11_FunctionsPT#1

Below is what the DS Studio canvas looked like in that initial posting.

Chapter 11_Function_Part#1

A more detailed and defined translation was done and involved naming the variables to identify and reference into them to their corresponding nodes.

Chapter 11_Function_Part#1a

Then with the naming and identifying complete, the “Node to Code” operation can take place.

Chapter11_Function-Pt# 1b

The Windows Graphic that is generated from the files. Note that colors were added for interest.

Chapter11_functions-Part #1-Windows Graphic

The second part of this chapters original translation which operates with a defined function, works with the DS Editor as shown below.

Chapter11_functionsPT#2

Copy and paste the script into a new DSS canvas in and run it.

Chapter 11_Function_Part#2-unsupported_error

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.

Chapter 11_Function_Part#2

Then the nodes then are broken down into groups and detail commentary is added.

Chapter11_Function-Pt# 2a

Adding to this is the translation “Back to Code”, which is shown below.

Chapter11_Function-Pt# 2b

The Geometry that is generated from these files is shown below.

Chapter 11_Function_Part#2

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.