Monthly Archives: February 2014

DesignScript Curve Translation #3, Arc – Code to Node to Code

Hi Everyone:

Here is the third curve translation in a series of five Arc files, access it through the DSE sample files, as shown below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal.ds#3Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal.ds#3

After opening the file in the Editor, copy and paste it into the DSS canvas to make a new file.

2013_12_19-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3

2013_12_19-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3

Continue the translation one gets a translation similar to one below.

2013_12_19-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3a

2013_12_19-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3a

After being satisfied that the translation has been adequately defined execute the “Code to Node” operation to change the graph nodes to script. A couple of lines of code could be improved.

Capture

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3b

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3b

Combine the two lines of script to make one line, by eliminating the Var#’s. Then the file looks like below.

2014_01_23-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3b-1

2014_01_23-Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3b-1

Here is the Windows Graphic that results from the arc file.

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3-Windows Graphic

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3-Windows Graphic

The files are available for downloading below.

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3a

Geometry.Curve.Arc.ByCenterPointStartPointSweepAngleNormal#3b

Thanks for looking

T!M

DesignScript Curve Translation #1, Arc – Code to Node

Hi Everyone:

From Coordinate Systems we are now moving on to the next Class of DesignScript Geometry. One might want to review  DesignScriptMethods, which is located on the DS program, C:\ProgramData\Autodesk\ApplicationPlugins\DesignScript.bundle\Contents\Help\DesignScriptMethods.htm to get a understanding of the structural naming conventions of the program. For these samples, Curve, contains the sub classes of Arc, Line, BSplineCurve and Circle, all one dimensional constructs. The first one in this series is entitled Geometry.Curve.Arc.ByCenterPointRadiusAngle.ds.

Geometry.Curve.Arc.ByCenterPointRadiusAngle.ds

Geometry.Curve.Arc.ByCenterPointRadiusAngle.ds

Open the DSE, copy and paste the sample file into the DSS blank canvas and do the first translation.

Geometry.Curve.Arc.ByCenterPointRadiusAngle

Geometry.Curve.Arc.ByCenterPointRadiusAngle

Then generate the other properties that follow in the script.

Geometry.Curve.Arc.ByCenterPointRadiusAngle

Geometry.Curve.Arc.ByCenterPointRadiusAngle

And complete the translation with the “Node to Code” operation.

Geometry.Curve.Arc.ByCenterPointRadiusAngle

Geometry.Curve.Arc.ByCenterPointRadiusAngle

Seems like all nodes were identified adequately. The resulting Window’s Graphic is posted below.

Geometry.Curve.Arc.ByCenterPointRadiusAngle_Window_graphic

Geometry.Curve.Arc.ByCenterPointRadiusAngle_Window_graphic

The files are available for downloading below.

Geometry.Curve.Arc.ByCenterPointRadiusAngle#1

Geometry.Curve.Arc.ByCenterPointRadiusAngle#1a

Geometry.Curve.Arc.ByCenterPointRadiusAngle#1b

Thanks for looking

T!M

Designscript Coordinate Translation # 25th, Code to Node +

Hi Everyone:

This is the twenty-fifth Coordinate translation from the DSE, and is the second in a series of two files on Translate. The file, CoordinateSystem.Translate.ds#25, can be found in the sample files of the opening window of the DSE lite program. It’s the last Coordinate System files found the Samples directory.

CoordinateSystem.Translate.ds#25

CoordinateSystem.Translate.ds#25

After opening the file in the DSE, copying the code and pasting it into the DSS canvas its seen to be very similar to the previous Translate file. For that reason one may wish to edit the previous file to avoid a duplicating effort.

CoordinateSystem.Translate#25

CoordinateSystem.Translate#25

Regardless, after its translated, we get the code shown below.

CoordinateSystem.Translate#25a

CoordinateSystem.Translate#25a

After being satisfied with the level of node naming description, the translate from “Node to Code” is done.

CoordinateSystem.Translate#25b

CoordinateSystem.Translate#25b

The resulting Window’s Graphic accompanies each translation file.

CoordinateSystem.Translate#25-Window Graphic

CoordinateSystem.Translate#25-Window Graphic

The Coordinate System Translate files are available for download below.

CoordinateSystem.Translate#25

CoordinateSystem.Translate#25a

CoordinateSystem.Translate#23b

Thanks for looking.

T!M

Designscript Coordinate Translation # 24th, Code to Node +

Hi Everyone:

This is the twenty-fourth Coordinate translation from the DSE, and is the first of two files on the Translate node. This one is entitled CoordinateSystem.Translate.AlongVectors.ds, and can be found in the sample files of the opening window of the DSE (lite) program.

CoordinateSystem.Translate.AlongVector.ds#24

                          CoordinateSystem.Translate.AlongVector.ds#24

Doing the usual procedure the code is pasted into the DSS blank canvas and the first the Translate node is placed from the library.

CoordinateSystem.Translate.AlongVector#24

 

From there one proceeds to translate the guaranteed properties.

CoordinateSystem.Translate.#24a

CoordinateSystem.Translate.AlongVector#24a

And then one proceeds to the “Code to Node” process.

2014_01_21-CoordinateSystem.Translate.AlongVector#24b

2014_01_21-CoordinateSystem.Translate.AlongVector#24b

The resulting graphic from the files can be seen below.

2014_01_21-CoordinateSystem.Translate.AlongVector#24Window Graphic

2014_01_21-CoordinateSystem.Translate.AlongVector#24Window Graphic

The files can be downloaded from below.

CoordinateSystem.Translate.AlongVector#24

CoordinateSystem.Translate.AlongVector#24a

CoordinateSystem.Translate.AlongVector#24b

Thanks for looking

T!M

Designscript Coordinate Translation # 23rd, Code to Node +

Hi Everyone:

This is the twenty-third Coordinate translation from the DSE, and is the second of two files on scale. The file, Coordinate System.Scale.ds can be found in the sample files of the opening window of the DSE (lite) program.

CoordinateSystem.Scale.ds#23

CoordinateSystem.Scale.ds#23

Transfer the code to the DSS canvas.

CoordinateSystem.Scale#23

CoordinateSystem.Scale#2

Generate the Scale node from the Context menu on the WCS node. Then translate the guaranteed properties.

CoordinateSystem.Scale#23a

CoordinateSystem.Scale#23a

Use the  “Node to Code” operation to get the code into the canvas

CoordinateSystem.Scale#23b

CoordinateSystem.Scale#23b

The resulting Coordinate System Scale can be seen below.

CoordinateSystem.Scale#23-Window graphic

CoordinateSystem.Scale#23-Window graphic

The Coordinate System Scale files are available for download below.

CoordinateSystem.Scale#23

CoordinateSystem.Scale#23a

CoordinateSystem.Scale#23b

Thanks for looking

T!M

 

 

Designscript Coordinate Translation # 22nd, Code to Node +

Hi Everyone:

This is the twenty-second Coordinate translation from the DSE, and is the first of two files on scale. The file, CoordinateSystem.Scale.Axis.ds  can be found in the sample files of the opening window of the DSE (lite) program.

CoordinateSystem.Scale.Axis.ds #22

CoordinateSystem.Scale.Axis.ds #22

Translate the code by first transferring it to the DSS canvas.

CoordinateSystem.Scale.Axis#22

CoordinateSystem.Scale.Axis#22

After translating the coordinate system scale,  translate the guaranteed properties.

CoordinateSystem.Scale.Axis#22a

CoordinateSystem.Scale.Axis#22a

Then generate the “Node to Code” operation.

CoordinateSystem.Scale.Axis#22b

CoordinateSystem.Scale.Axis#22b

The resulting Coordinate System Scale results from each file and can be seen below.

CoordinateSystem.Scale.Axis-Wondows Graphic

CoordinateSystem.Scale.Axis-Wondows Graphic

The files are available for downloading below.

CoordinateSystem.Scale.Axis#22

CoordinateSystem.Scale.Axis#22a

CoordinateSystem.Scale.Axis#22b

Thanks for looking.

T!M

Designscript Coordinate Translation # 21st, Code to Node +

Hi Everyone:

This is the twenty-first Coordinate translation from the DSE, and is the third in a series of three files on rotation. The file, CoordinateSystem.Rotate.RotationAnglesSequence.ds, can be found in the sample files of the opening window of the DSE (lite) program.

CoordinateSystem.Rotate.RotationAnglesSequence.ds#21_graphic

CoordinateSystem.Rotate.RotationAnglesSequence.ds#21_graphic

Doing the usual translation procedure one gets the code into the DSS canvas.

CoordinateSystem.Rotate.RotationAnglesSequence#21

CoordinateSystem.Rotate.RotationAnglesSequence#21

Use the previous file to edit would be a expedient way to finish the graph node translation.

CoordinateSystem.Rotate.RotationAnglesSequence-a#21

CoordinateSystem.Rotate.RotationAnglesSequence-a#21

Note the values that are the variables that will need to be edited in the “Node to Code” translation.

coordinatesystem-rotate-rotationanglessequence#21b

Note the highlighted code in the large Code Block above. Edit out the extraneous Variables, as shown below.

Edit the Code Block in the canvas

Edit the Code Block in the canvas

The edited translation looks like below.

CoordinateSystem.Rotate.RotationAnglesSequence#21b

CoordinateSystem.Rotate.RotationAnglesSequence#21b

And the accompanying window graphic is shown below.

CoordinateSystem.Rotate.RotationAnglesSequence#21b-Graphic

CoordinateSystem.Rotate.RotationAnglesSequence#21b-Graphic

The Coordinate Rotation files are available for downloading below.

CoordinateSystem.Rotate.RotationAnglesSequence#21

CoordinateSystem.Rotate.RotationAnglesSequence#21a

CoordinateSystem.Rotate.RotationAnglesSequence#21b

Thanks for looking.

T!M