Point leftVariable = new Point('left');



DAY 2 PRE-TRAINING NOTES

TRANSACTION SCRIPTS

o First create point and two lines

o Save this transaction

o Right click on last transaction. New script transaction–> insert after

Create a Point

transaction script "first try"

{

// first make the point

Point leftVariable = new Point("left");

leftVariable.ByCartesianCoordinates(baseCS, 5.0, 5.0, 0.0);

}

First line of script

o insert a line that says to make a point

o make me an object that is a point, call that object left variable. Make the object by executing this command. It’s new name is left.

▪ Point leftVariable = new Point("left");

o Point is the type.

o Name is leftVariable - temporary name

o = means execute

o Point("left");: constructor

o Point explains the type

o Then (“name”)

Second line of script – compute our variable with cartesian coordinates

o define the variable. Use the perios, and pull up cartesian coordinates

▪ leftVariable.ByCartesianCoordinates(CoordinateSystem, Xtranslation, Ytranslation, Ztranslation [, Origin] )

▪ leftVariable.ByCartesianCoordinates(baseCS, 5.0, 5.0, 0.0);

o in [] is optional

Run the script to make sure it works

Create a second Point

// first make the point

Point leftVariable = new Point("left");

leftVariable.ByCartesianCoordinates(baseCS, 5.0, 5.0, 0.0);

// then make the right point

Point rightVariable = new Point("right");

rightVariable.ByCartesianCoordinates(baseCS, 10.0, 5.0, 0.0);

Create a Line

// first make the point

Point leftVariable = new Point("left");

leftVariable.ByCartesianCoordinates(baseCS, 5.0, 5.0, 0.0);

// then make the right point

Point rightVariable = new Point("right");

rightVariable.ByCartesianCoordinates(baseCS, 10.0, 5.0, 0.0);

// then draw the line

Line bridgeVariable = new Line("bridge");

bridgeVariable.ByPoints(left, right);

Next free the point manually by editing the point. Right click on the x/y

Then move the point

Check the script to see what was added.

transaction modelBased "Graph changed by user"

{

feature left GC.Point

{

Xtranslation = (5.0);

Ytranslation = (3.41945192602107);

}

}

transaction modelBased "free point/move point"

{

feature left GC.Point

{

Xtranslation = (-6.3264554214921);

}

}

Start a new transaction. Choose the expression builder upper right to left of fx

o This transaction makes a bunch of lines

transaction script "script transaction 02"

{

for (int i = 0; i < 5; ++i)

{

// first make the point

Point leftVariable = new Point("left_" + i);

leftVariable.ByCartesianCoordinates(baseCS, 5.0, 5.0 + i, 0.0);

// then make the right point

Point rightVariable = new Point("right_" + i);

rightVariable.ByCartesianCoordinates(baseCS, 10.0, 5.0 + i, 0.0);

// then draw the line

Line bridgeVariable = new Line("bridge_" + i);

bridgeVariable.ByPoints(leftVariable, rightVariable);

}

}

First line

for (value index = 0; index < count; ++index)

for (int i = 0; i < 5; ++i)

o ++i indicates the increment

o Key words in blue

o Light blue highlight variables

o Statement delinieated by semicolons????

o Then copy and paste from first try and change to match above

o Try 15 iterations instead of 5.

Debugger

o Reduce iterations to 3

o Add a breakpoint; before the “for” argument

o Run the program

o Then debugger appears

o Step through the steps and see how the program works

Edit the coordinate system

o Make a new coordinate system

o Then edit script to depend on that cs

o Resulting script

transaction modelBased "Graph changed by user"

{

feature coordinateSpiral GC.CoordinateSystem

{

CoordinateSystem = baseCS;

Xtranslation = (23.2934532741567);

Ytranslation = (-2.56051530619625);

Ztranslation = (0.0);

HandleDisplay = DisplayOption.Display;

}

}

Make a spiral by editing previous script – number 1 (Robert Woodbury)

transaction script "First Spiral"

{

for (int i = 0; i < 20; ++i)

{

double radius = 5.0;

Point spiralVariable = new Point("spiral_" + i);

spiralVariable.ByCartesianCoordinates(baseCS, radius*Cos(30*i), radius*Sin(30*i), i);

}

}

[pic]

o Try 100

o Backspace before spiral

o Intorudce new coordinate stystm, with the icon

o Then go and rename it csSpiral

o Change the script to refer to this new sprial

o Then go and delete this once done

o Try to change it to a different coordinate system in the script instead of creating your own cs. This one will introduce a cs based on radius, and move the new one away from the baseCS

transaction script "First Spiral"

{

double radius = 5.0;

CoordinateSystem csSpiral = new CoordinateSystem("csSpiral");

csSpiral.ByCartesianCoordinates(baseCS, 4*radius, 4*radius, 0.0 );

for (int i = 0; i < 100; ++i)

{

Point spiralVariable = new Point("spiral_" + i);

spiralVariable.ByCartesianCoordinates(csSpiral, radius*Cos(30*i), radius*Sin(30*i), i);

}

}

[pic]

Now we are going to change the radius

o Create a spiral that can’t be done in model based GC

Change the previous script first spiral

transaction script "First Spiral"

{

double radius = 5.0;

//add a variable

double radiusStep = 0.1;

double increments = radius/radiusStep;

CoordinateSystem csSpiral = new CoordinateSystem("csSpiral");

csSpiral.ByCartesianCoordinates(baseCS, 4*radius, 4*radius, 0.0 );

for (int i = 0; i < increments; ++i)

{

radius = radius - radiusStep;

Point spiralVariable = new Point("spiral_" + i);

spiralVariable.ByCartesianCoordinates(csSpiral, radius*Cos(30*i), radius*Sin(30*i), i);

}

}

[pic]

Make clock

Make two points and a line

Save the image capture two different ways

transaction script "New script transaction"

{

//breakpoint;

for (int j = 0; j < 4; ++j )

for (int i = 0; i by function

o Go to text editor and type this

o This sets up a function with two arguments, shown in parentheses

value function (ICurve curve, int num)

{

double spacing = 1.0/(num-1);

//create empty collection

Point childPoint = {};

//breakpoint;

for (int i=0; i < num; ++i)

{

//add to collection

//true indicates visability

childPoint[i] = new Point(true);

double t = spacing*i;

childPoint[i].ByParameterAlongCurve(curve, t);

}

return childPoint;

}

o Then list of values for the argument. These are the arguments for the function above. F(x) = x2

{bsplineCurve01,6}

Create a graph variable

o Go to graph -> manage graph variable ->make new and call it num

o Put in a value from 0-10

[pic]

Create a graph function, a function that works across the board

o Create feature, graph function, define

o Open the text editor, and copy the old function into the graph function

Then make a new arc and apply the graph function

Create a new feature ->point-> by function

o function… type in graphFunction01

o Arguments – type {arc01,num}

This will make points across the arc

And they can be changed with the num slider too

[pic]

Some kind of function

o Create two variables

o inputToFunction

o outputFromFunction

o create a new graph function

function (value x)

{

return x*x;

}

Open five scripts for curves from dongle

o method 1

o It’s a script transaction

o For loop creates 10 points

o p_0, p_1, etc.

o they are updated by cartesian coordinates, move along x,y,z

o z = j2/10 – to make a parabola of points

o each point is a top level feature

o they are just points

o put in a bspline curve

o method 2

o define scale variable in order to change the shape of the curve = scale is a global variable

o internal function has this text

o Point point = new Point(this);

o Function point constructs a point

o Function coordinate system constructs a coordinate system

o Under Fx/feature types, 3 ways to create a new point

1. New point

2. creates a new top level point

3. creates a new point that is a subpoint of another

o this refers to what you are trying to make

o make 10 points… set update method to what it is before

o the upper version is one point, and bottom has many separate points

o then you can bind the one point to curveScale

o method 3

o use dpoints.

1. have the essence of a point

2. under geomtry tab under fx

3. only contain x,y,z

o create a function – this explains what the function does… see file.

1. use for loop

2. not child points, it will be empty list of dpoint3ds

3. keep adding to the list by adding dpoint3ds

4. this.ByPointsOnCurveAsDPoints3ds (cs, dPoint); this makes the curve

o method 4

o just using a point

o define a collection of dpoints

o make a bspline curve

o it only exists inside the function

o and make a child pline?

o Then return a point by a parameter along a bspline curve

o It will move through space and is T along the curve

o Excel/gaming are often end-user systems

Create dynamic text to indicate the x coordinate

o Insert Text

o Placement: coordinateSystem01

o TextString "X coordinate="+coordinateSystem01.X

o Make New TextStyle

o Input in Defined Format

o Apply TextStyle to Text

Roly exercise

o Draw 9 point

o Draw bspline surface

o Play around

o Add point onto surface by using point icon

[pic]

o Change point to series

o Click on fx, and click on functions, scroll down to series

o Series(0.3,0.6,0.05) start, final, incremental count . technique is optional, in brackets.

[pic]

o Manage graph variable

o startU = 0.15, make it a slider

o replace the first digit of series with the startU

o fill the whole space

o change second number of series with 1.0 instead of 0.5

o change it to 1.01 instead of 1.0 to get the points to go to the edge

[pic]

o Change to

o U: Series(startU, startU+uSize, 0.05 )

o V: Series(startV, startV+vSize, 0.05 )

o Play around with the values

o Create a shape grid, features – shape – by point grid

o Just click on one point and delete all but point name

o Try facetoption and choose FacetOption.ForcePlanarQuads

o Small cracks will start opening up

o FacetOption.TriangulationAlternate, shows triangle,

o Change u/v to 1

o Leave it on quads

[pic]

Build a component in a separate file

o Component can be anything

o They are adaptive

o Line are components too, feature and components interchangeable

Create a component

o Open a new file

o 4 points

o Shape – by vertices, select 4 corners

o Coordinate system – FromShapeVertices

o Keep everything dependent on the shape

o Create point

o By cartesian coordinates

▪ Select coordinatesystem01

▪ X=0, y=0

▪ Z: shape01.Area/4

o Create new graph variable pHeight

o Replace 4 with pHeight

o Create a line feature by points, start point – apex point, and end point shape01.Vertices

[pic]

o Create a cone,

o by line, and

o Line: line 01

o Start/End radii: line01.Length/20

[pic]

o Generate Feature Type, brings up form, icon lots of little squares

o Give name

o Define inputs

o Make the two variables

o Change name Hfactor

o Change to logical names, such as HFactor and PlaceHolder

o Click both replicatable

o Outputs - Show the other stuff as construction, except the cone.

o Create it, close the file and open the old file

o Then insert pyra01 by default, set HFactor to 0.75 and shape01

[pic]

GENERAL NOTES

o Modeling

o Use construction lines as needed. Click on icon, then use control select to select the item.

o You can extractRegionUsingStartEndPoint, this is useful for creating equal arcs for a façade

▪ With ellipse, either the arcs are equal, or the lines are equal see

▪ Basis for T on a ellipse is angle,

o Create plane, it acts as a 2d coordinate system

o To change color, select color/thickness, then apply to object

o ProjectCurveOntoSurface

▪ Switch on curve vector

▪ C:\Documents and Settings\All Users\Application Data\Bentley\WorkSpace\GenerativeComponents\Transaction Files\nyc_workshop_samples\day 3\project_trim\

o Trim by Projection

▪ C:\Documents and Settings\All Users\Application Data\Bentley\WorkSpace\GenerativeComponents\Transaction Files\nyc_workshop_samples\day 3\cut_protrusion\bsplineSurface_TrimByProjectedCurve.gct

o Program is in development phase, beta

o Rhino had extensive beta phase too, benefited much from this

o Intention - get GC out to people

o Will add flyovers to rest of software

o Coordinate systems

o You always get a baseCS. If you delete it, everything goes

o Scripting

o Write for 3 audiences, yourself, the script, and your colleagues

o Transaction script

▪ Must have script in the beginning, so it knows to execute it.

▪ Use comments often. They are signified with // before the text. Turns it green

o Syntax notes

o Syntax from C sharp… learning curve better if you learn C sharp. Java also, other end user programming systems

o () for arguments

o [] for array indexing

o {} collection

o Type of properties

▪ Double is a real number, remnant from binary code days

o Quick Help

o Use quick help. See window. Hover over copy command and it will show you the video of how to work it.

o Also, if you go to create an item, then you can see an icon called example.

o Look for quick help exe file in c:\program files\Bentley\documentation and move it to c:\program files\Bentley\generative components\. Then execute it

o Examples

o Find examples.zip in c:\program files\Bentley\documentation

o Unzip to C:\Documents and Settings\All Users\Application Data\Bentley\WorkSpace\GenerativeComponents\Transaction Files\Examples

o Chm file available - C:\Program Files\Bentley\MicroStation\MicroStationVBA.chm

o Blue properties are optional, and set to null

o Right click – will send more documentation on this

o Add notational property

o These show up in purple

o Bspline surface

o By points – surface passes thru points

o By poles – poles are the control points

▪ Control points means that there is tangency between implied lines

o Vclosed: bool – forces the surface to be closed

o UcurveDisplay: int – indicates the divisions on the curve/matrix

o Uorder: int (and Vorder)– changes order, lower = more faceted

o Change symbol size

o Edit -> baseCS

o Change SymbolSize: double

o Place point on surface

o Choose icon

o Or ByUVParametersOnSurface

Update session – day 3

o Offset curve

o Original curve, offset curve, get nasty result. Approximate a plane and offset within that. See example offset_from_bspline. You may need to set an upvector (blue)

o Can drive by offset number

o Or by offset point, more geometric

o RemoveUnsuccessfulFeatures

o Can filter out unsuccessful

o C:\Documents and Settings\All Users\Application Data\Bentley\WorkSpace\GenerativeComponents\Transaction Files\nyc_workshop_samples\day 3 stick 2\GC Examples2\remove_unsuccesful_features\remove_unsuccesful_1.gct

o Proptotype design

o House that can redesign based on parameters

o Concentrate on climate parameter

o Database interactivity

o Check climate conditions/date

o Model to update based on this info

o Roof

o Solar panels to tilt

o Façade

o Shading devices

o Windows

o Natural ventilation

o Roof pond

o

Questions

o How to undo if you delete something

o How to work this into other cad programs, microstation and others?

o How to deal with license issue in the future

o

Excel

o Use function – excelvalue, write value

o Write Value

o Sheet – Sheet1

o “A1:A11”

o Point05.X

o Read Value

o Filename

o Sheetname

o Grids

o YTranslationjs: excelRange02.Value

Script Function

Function (Shape shape, double bulge, double radius, bool bSwitch)

{

For each (Shape nestedShape in shape)

{

Shape nestedResult = new Shape(this);

Foreach (Shape newstedNestedShape in nestedShape)

{

If (bswitch)

{

Cross_bar_1 nestedNestedResult = new cross_bar_1(nestedResult);

nestedNestedResult.ByDefault(nestedNestedShape, radius);

}

Else

{

Panel_2 nestedNestedResult = new panel_2(nestedResult) = new cross

o Make your component type to optional so that you can switch from one to the other

Database_Facilities.doc – see this for more information.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download