#DesignScript LM – Chapter 14 Translation, IDE: Step In, Step Out, Watching, Breakpoints

Hi Everyone:

This translation is from the fourteenth chapter of the DesignScript Language Manual and can be found at DSLM  (pages 44-46) and is entitled; IDE: Step In, Step Out, Watching, Breakpoints. There also is a companion video tutorial entitled, IDE Basics (#3), 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 14: IDE: Step In, Step Out, Watching, Breakpoints Translating to DesignScript Graph-Node. (Note that it can be not longer be found on the Autodesk Labs Website, as linked.)

IDE which stands for Integrated, or Interactive, Development Environment is DesignScript’s  text Editor which is a users tool to not only mirror and write programs, but to also track down bugs in one’s script and aid in calling up the appropriate DS language.

Open the DS Editor and create a new file, lets copy and paste the first and second page of code from Chapter 14 (pages 44 & 45) into the Editor. Separate the code by commenting out the “import” statements at the top of the second bit of code to avoid a editor malfunction.  Run it, and observe the their errors generated, as intended and illustrated and highlighted below.

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#3

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#3

Reiterating about this file, it has a error, and the Editor has the facility to help locate it.  Now paste the same script into a blank canvas on DesignScript Studio.

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1

Edited out the commenting out so the script will be activated, but first make sure that the “import” statements are commented out. Note keep the highlighted middle of the script import’s commented out.

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#1

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#1

One see’s that the “Variable is over indexed” so it’s noted that this a problem with geometry indexed to [5], not [8].

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#2

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#2

After geometry [8] is changed to [5] another error is encountered, we have to remember that “Class and Function definitions are not supported in DesignScript Studio.”

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#3

Chapter14_IDE_StepIn_StepOut_Watching-Breakpoints_a1-edit#3

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.

Chapter14_ide_step_in-out_1

Chapter14_ide_step_in-out_1

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

Chapter14_ide_step_in-out_1a

Chapter14_ide_step_in-out_1a

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

Chapter14_ide_step_in-out_1b

Chapter14_ide_step_in-out_1b

The Windows Graphic that is generated from the files.

Chapter14_ide_step_in-out_1a-Graphic Window

Chapter14_ide_step_in-out_1a-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.

Chapter14_ide_step_in-out_a1

Chapter14_ide_step_in-out_1

Chapter14_ide_step_in-out_1a

Chapter14_ide_step_in-out_1b

Thanks for looking.

T!M

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s