Hi Everyone:
This translation is from the fifteenth chapter of the DesignScript Language Manual and can be found at DSLM (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.
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 15: Part 1; Translation, Rotation, and Other Transformations (Note that it can be not longer be found on the Autodesk Labs Website, as linked.)
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.
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.
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 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.
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.
A little editing is desired.
The Windows Graphic that is generated from the files.
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.
2014_02_13-chapter15_Translation_Rotation_Other_Transformations-pge47#1
2014_02_13-chapter15_Translation_Rotation_Other_Transformations-pge47#1a
2015_02_02-chapter15_Translation_Rotation_Other_Transformations-pg47#1a
2015_02_02-chapter15_Translation_Rotation_Other_Transformations-pg47#1b
The second part of Chapter 15 will be next.
Thanks for looking.
T!M