This translation is from the fifteenth chapter of the DesignScript Language Manual and can be found atDSLM(pages 47-49) and is entitled; Translation, Rotation, and Other Transformations. There also is a companion video tutorial entitled, Transform method (#11), which can be found in the DS website’s tutorials.

Open the DS Editor and create a new file, lets copy and paste the first and second page of code from Chapter 15 (pages 47 & 48) into the Editor. Separate the code by commenting out the “import” statements to avoid a editor malfunction. By activating the code in separate parts we can see the first page with the graphic window results as shown below.

chp_15_Pt1_Translation_Rotation& other_Trans.ds#1_2

The bit of code shows moving a point by the translate method, with the graphic generated pasted into the illustration. The second bit from the bottom of the page shows the transform method by moving the Coordinate System of the subject.

Lets stop here and copy and paste just this amount of script into a blank canvas in the DesignScript Studio program.

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a1_a2

Edited out the commenting out so the script will be activated, but first make sure that the “import” statements are commented out

chp_15_Pt1_Translation_Rotation& other_Trans.ds#a1_a2-edited

After commenting out the last bit of code then, the code-block is activated, and a result is obtained for the first portion of code. Developing and breaking out the script into code blocks is shown in the DS Studio canvas in it’s initial translation.

chp_15_Translation_Rotation_Other_Transformations-7#1

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

chp_15_Translation_Rotation_Other_Transformations-7#1a

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

chp15_Translation_Rotation_Other_Transformations-pg47#1b

A little editing is desired.

chp15_Translation_Rotation_Other_Transformations-pg47#1b-edited

The Windows Graphic that is generated from the files.

chp_15_Translation_Rotation_Other_Transformations-7#1_Graphic Window

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.