to enter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net • The Grasshopper scripting components. Choosing a .Net language. Language developments • Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls • Classes: declaration and instancing. Constructors. Importing a namespace. Point3d, Lines • Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities. Afternoon: patterns • About OOP (object oriented programming) as opposed to procedural programming. Discussion • Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes • Lists as input parameters. Trees as input parameters. Usage and limitations • Finding resources: on the net with website that can help getting started and troubleshoot. And books Day 2 Morning: extending Grasshopper functionality with our definitions • Store data between updates. The use of fields [globals, or static locals] • Examples on how to use stored data between updates: a simple agents simulation • Baking geometry with scripting directly into the Rhino document. Baking with names • Passing custom types from a scripted component to another one. Our own code reusability • Rendering an animation from Grasshopper. How to get started and final results Afternoon: customizing our tools • Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher • Writing a custom Grasshopper component: hacking an exporter for our data to Excel Day 3 All day: personal project • Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing MINIMUM REQUIREMENTS A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
can work in any node of a given hierarchy tree (loaded in your work session) by making the node "active". "Nodes" can be other things as well (like workplane, clip definitions etc).
Why to do that weird thing? Well, think any design being "flat" > meaning that all objects are placed in a single file (and in a single layer). Not that good > although the items are present you barely can handle them (because power is nothing without control, he he).
Let's go one step further: we can start classifying objects in "groups" (like a directories/files organization in any O/S). This means, in MCAD speak, creating assemblies (a void thing kinda like a directory) that contain components/entities (kinda like files).
Several steps further we end up with severely nested "arrangements" of entities (an assembly could be parent of something and child of something else).
For instance, it could be rather obvious the logical classification of a "geodetic" (so to speak) structure like this : a 40000m2 "hangar" defining some thematic park.
I mean : a void master that owns 4 equal void segment sets that own 4 "legs" that own various geodesic structural members + cables + membranes + you name it etc etc.
Each "leg" owns the concrete base (Shared) and a rather complex set of objects.
Notice that some tensile membrane "fixture" combos (see above)...act as perimeter light fixtures as well...meaning that the membrane tension plate may could be a child of a void "light" parent...or may could be a "stand alone" assembly etc etc.
These arrangements can be internal (belonging in, say, a x node within the current active file) or external (belonging in a y node within another file). If they deal with the same (topologically speaking) object they define clusters of Shared entities (or variations)- where only the view transformation matrix changes (in the simple scenario, he he). For instance the disk shown above is a Shared Assembly that owns the bolts, the plates, the tension member etc etc. Selective Instancing allows modifying some attributes without affecting the topology (i.e. the geometry).
The whole (terrible) mess is controlled by some tree like "dialog" (in Catia is "transparent") that is called Structure Browser. By controlled I mean (1) display/display mode with regard any tree member combo/selection set (assembly and/or component) in any View (2) clip state control (3) active status (for modifications/variations) (4) workplane control (5) drag and drop ownership control (6) ....
Now...what if I would chan…
to enter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net
• The Grasshopper scripting components. Choosing a .Net language. Language developments
• Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls
• Classes: declaration and instancing. Constructors. Importing a namespace. Point3d, Lines
• Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities.
Afternoon: patterns
• About OOP (object oriented programming) as opposed to procedural programming. Discussion
• Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes
• Lists as input parameters. Trees as input parameters. Usage and limitations
• Finding resources: on the net with website that can help getting started and troubleshoot. And books
Day 2 Morning: extending Grasshopper functionality with our definitions
• Store data between updates. The use of fields [globals, or static locals]
• Examples on how to use stored data between updates: a simple agents simulation
• Baking geometry with scripting directly into the Rhino document. Baking with names
• Passing custom types from a scripted component to another one. Our own code reusability
• Rendering an animation from Grasshopper. How to get started and final results
Afternoon: customizing our tools
• Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher
• Writing a custom Grasshopper component: hacking an exporter for our data to Excel
Day 3 All day: personal project
• Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing
MINIMUM REQUIREMENTS
A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
ially suitable for what i try to do - the solution landscape may be full of local extremes and i am worried about that. This is because, as far as i know, there should be "fluent" change in values of a slider. I will try to explain what i mean on an example.
Lets say we want to optimize energy use of a building but also give a penalty function - each time overall building rising cost exceeds X. Our variables are - its morphology (overall shape, glazing%, shading elements) and materials used. The problem starts with the materials. Let's say each of materials has 'y-cost per m^2' and 'z-thermal resistance' values. Even if that list would be sorted, jumps between these values wouldnt be fixed as for example when using sliders for box dimensions, and that may be no good for optimization purposes - there would be possibility that some the list item slider for material list would simply get stuck.
The perfect solution would be using Galapagos with a loop - for each geometry generated there are all materials checked and the best solution is picked. Unfortunately i don't think this is possible.
Thats why i looked into brute force optimization - it eliminates that problem but generates a lot of results.
I think i will have to consider step-by-step approach - first optimize the shape and then find the right material. That, on the other hand, eliminates a lot of possible solutions.
Another way would be using Colibri and culling unpromising results before they are exported to csv file. That would have to be done between Colibri Iterator and Aggregator. The problem with that is that first I would need to have some solutions to compare to (example - cost>h and energy use>i results in a cull). That would allow me to upload only best solutions to Design Explorer, but it may take ages to check all the possibilities.
Sorry for such long and intricate posts. I try to organize my thoughts and writing helps me to do so.
I didn't find perfect approach for my purpose. If you have any further thoughts on that topic I'd really like to hear them. Thank you for your effort, time and help, I really appreciate that.…
(tree info, relationships to certain other objects, etc.) after it's been baked, so that our team can hand tool some of the results, delete certain objects, etc. I'm using the doc.objects.find(guid) function right now - which works fine when I feed a string into the VB component and set the input as a GUID, but am having a hard time casting my strings from Excel into the GUID directly in the VB component. Hopefully it's easy to do and I can whack my palm on my face, as often I do. Here's my script...I get the "specified cast is not valid" error at: Dim obj As Guid = xlSheet.Range(strGUIDColumn & I).Value.
If activate = True Then
Dim xlApp, xlSheet As Object
xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")Dim strSheet As String = "MEM_6"
Dim strGUIDColumn As String = "C"
Dim strDeleteColumn As String = "F"
Dim intCheck As Int16 = xlApp.Worksheets("META").Range("B4").Value
Dim I As Int16
xlSheet = xlApp.Worksheets(strSheet)
For I = 2 To intCheck + 1
Dim obj As Guid = xlSheet.Range(strGUIDColumn & I).Value <- returns my casting error
If doc.Objects.Find(obj) Is Nothing Then
xlSheet.Range(strDeleteColumn & I).Value = "X"
End If
Next
End If
thanks!…
Added by David Stasiuk at 8:05am on December 15, 2010
ates of the given object, cylinder in the case of my uploaded file) into smaller groups and send these smaller pieces one at a time to the UDP sender. Currently I was able to create Python Script (using my knowledge about Python lists) component that essentially does what "Partition" component does but one problem is that it creates an extra layer of complexity in the data tree (which I do not understand why it is doing that). More importantly, once I break the pieces down in smaller chunks, I want these string data chunks to be sent one at a time to the UDP sender by some form of methodology, and I am currently thinking of using a timer (for example, sending one chunk out of x amount of chunks every 1 second, etc), but I am struggling on how to execute my idea since I am new to GH. I want to learn if what I just mentioned is achievable to begin with. The primary reason why I want to break this down and send as opposed to sending one big chunk entirely all at once is because the the size of the data information from a big mesh cannot fit into the limited buffer of the UDP sender.I understand that there is the "Explode Tree" component in GH, but this does not completely achieve what I want because:1) If I change my size of the string data input or the component/bin size, I have to manually press "Match Output," and I am trying to make it work dynamically.2) Once these "smaller chunks" and output ports associated to each smaller chunks are created within the "Explode Tree" component are created, I would have to manually link every single one of these output ports to the UDP sender, which is definitely not a good idea.Because of these reasons/factors, I am trying to create an alternative way to achieve breaking and packaging of large data input into smaller pieces and sending one by one to UDP sender using Python Script component (if this is achievable and is considered a good idea).I have attached my file on this post, so that you can take a look at my Python Script and overall workflow as well. Thank you!…
Visiting School Rio de Janeiro will collaborate with the Centro Carioca de Design with the support of Columbia University Studio X to investigate new possibilities for the urban infrastructure surrounding World Cup Stadiums. Nation-wide, there has been significant investment to build and renovate stadiums for the 2014 World Cup in order to meet the required standard FIFA regulations (‘Padrão FIFA’). At the same time, there has been a large public demand for equal investment into transport systems, public space, and public programs such as hospitals and schools. The Visiting School will tap into the momentum of this movement, and promote a series of interventions within and around the World Cup structures, proposing new public programs and standards for their legacy. Students can choose to focus directly on the Maracanã stadium in Rio de Janeiro, the venue for the Final match of the World Cup. The intense ten-day workshop will employ computational design and digital fabrication to introduce a design methodology that creatively automates and promotes transformation, mutation and complexity for these infrastructure interventions.
Prominent Features of the workshop
Teaching teamThe teaching team will include a mix of tutors from the Architectural Association, including Theodore Sarantoglou Lalis e Dora Sweijd (lassa-architects.com) of Diploma 17, and locally-based architects, urban-designers and experts, mediated by locally-based Visiting School directors, to promote cutting-edge innovative strategies informed by local political, economic and construction issues.
Computational skillsThe workshop will teach advanced digital modeling and parametric design skills, no previous experience is needed. A group of specialist computation tutors will conduct an initial skills workshop and continue to assist throughout the workshop to develop the individual projects of the participants.
Digital FabricationA series of physical models will be built using digital fabrication techniques that will be taught during the workshop, no previous experience is needed.
Applications
1) You can make an application by completing the online application found under ‘Links and Downloads’ on the AA Visiting School page. If you are not able to make an online application, email visitingschool@aaschool.ac.uk for instructions to pay by bank transfer.
2) Once you complete the online application and make a full payment, you are registered to the programme. A CV or a portfolio is not required.
The deadline for applications is 11thApril 2014.
All participants travelling from abroad are responsible for securing any visa required, and are advised to contact their home embassy early. After payment of fees, the AA School can provide a letter confirming participation in the workshop.
Fees
The AA Visiting School requires a fee of £695 per participant, which includes a £60 Visiting membership fee.
Fees do not include flights or accommodation, but accommodation options can be advised. Students need to bring their own laptops, digital equipment and model making tools. Please ensure this equipment is covered by your own insurance as the AA takes no responsibility for items lost or stolen at the workshop.
Eligibility
The workshop is open to current architecture and design students, phd candidates and young professionals.
…
I tell you what I had to do and how I did it.
I have the following situation. A urban context with a square plot 40m x 40m surrounded by buildings.
If I extrude the plot I get 4 surfaces and I need to calculate the minimum daily quantity of direct sunlight hours each test point receives in the period from 22nd of April to 22nd of August. For example for the test point at index 21 of surface with index 1 (I am just creating these numbers in my mind) the minimum is on 27th of April and the test point receive 8 hours (this is also invented for the sake of the example) of direct sunlight. All the other days it receives more. So the values I have to found are these minimums for all the test points. Now how to calculate these minimum quantities is a different issue of the topic of this post and actually I manage it.
Continuing with the explanation of what I had to... so I have only the initial plot that generate 4 surfaces, then I want to test smaller plots generated by an offset of 4 m of the original one, and the relative 4 surfaces for each smaller plot.
So in this case I think I cannot use your suggestion because the object don't exist yet.
I managed creating a loop with Anemone, the loop generate an offset starting from the original at 0 until 4 (then I multiply it by 4 to obtain the offset at 0, 4, 8, 12 and 16. Then I did like you also suggest I record every time the result with the DataRecorder and I create for each result a different branch with the index coming from the loop (0, 1, 2, 3 and 4) with the Flatten component.
In this image you can see all the surfaces saved in the same way as described above and in white the test points that receive minmum or equal than 2.5 hours per day of direct sunlight in the period from from 22nd of April to 22nd of August and in dark gray the test points that receive less.
The main point of this discussion is just the fact that instead use this tricky way I used, or the one you suggest, to analyze separately (because they shade each other) 20 geometries (in this case 20 they could be many more) it would be good if it would be possible just to input all the geometries at the same time and they would not shade each other so to get directly all the results with one run and in a more simple way.
Francesco
…
amespace.... somekind of playground which you can manipulate your way but is a standard part of rhinocommon.
Ah and what would be also very cool is a conduit which can be selected like a curve,brep etc. but does something totaly different (somethin you can modify) Till now I have a custom selector which is totally crap. I want to build a own contrained parametric sketcher for grasshopper. This is only some testing code.
I will send you something. As a idea....
private void RunScript(List<GeometryBase> x, object y, ref object A, ref object B) { Rhino.Geometry.GeometryBase geobase_result; List<Rhino.Geometry.GeometryBase> geobase_ll = x; Point3d point = new Point3d(12, 12, 12); GetPointAtCursorPos(ref point, geobase_ll, out geobase_result); A = point; B = geobase_result; }
Custom additional code::
[System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool GetCursorPos(out System.Drawing.Point pt); [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool ScreenToClient(IntPtr hWnd, ref System.Drawing.Point pt); public static bool GetPointAtCursorPos(ref Point3d point, List<Rhino.Geometry.GeometryBase> geobase_in, out GeometryBase geobase_out) { geobase_out = null; bool rc = false; Rhino.Display.RhinoView view = RhinoDoc.ActiveDoc.Views.ActiveView; if (view != null) { System.Drawing.Point pt; if (GetCursorPos(out pt) && ScreenToClient(view.Handle, ref pt)) { Transform xform = Transform.Unset; xform = view.ActiveViewport.GetTransform(Rhino.DocObjects.CoordinateSystem.Screen, Rhino.DocObjects.CoordinateSystem.World); point = new Point3d(pt.X, pt.Y, 0.0); point.Transform(xform); // Vector3d camera_vector = view.ActiveViewport.CameraDirection; Rhino.Geometry.Ray3d my_ray = new Rhino.Geometry.Ray3d(point, camera_vector); Line ray_line = new Line(my_ray.Position, my_ray.Direction * 2000000); Curve ray_curve = ray_line.ToNurbsCurve(); int int_sel; Point3d pt_crv = Point3d.Unset; Point3d pt_obj = Point3d.Unset; ray_curve.ClosestPoints(geobase_in, out pt_crv, out pt_obj, out int_sel); if (theshold() > pt_crv.DistanceTo(pt_obj)) { geobase_out = geobase_in[int_sel]; } else {geobase_out = null;} // rc = true; } } return rc; } public static double theshold() { Point3d[] rec_pt = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.GetNearRect(); double aspect = rec_pt[0].DistanceTo(rec_pt[2]); return aspect / 100; }…