ing-in-python?commentId=2985220%3AComment%3A628495
For the most part, I got the serial port to work and I could share the port with other components without wiring the components together using a sticky Python dictionary. There were a couple of issues with closing the port (Rhino had to be restarted).
In any case, I'm back at it. I am however going the C# component route with an eye towards writing my own components with visual studio. I am trying to create bidirectional communication with a serial device in grasshopper. I need more control over the serial port that the generic Firefly components can afford. Furthermore, I would like to understand how to program this myself. The first goal would be to create a few components that could handle various serial tasks, one to open/close port, one to read from port and one to write to it. This is not unlike how I got it to work in python, and is also similar to the logic in Firefly's serial components.
The thing that has me stumped with C# is how one shares the port between components? If one component is responsible for creating and opening/closing the port, how do the read/write components address the instance of the port created in the other component? Python has the sticky dictionary, is there something similar in C#? I'm a novice when it comes to C# and how it works within grasshopper, so maybe I'm missing something simple.
I've attached a klunky definition that uses C# to open/close a serial port. I've tried accessing the port with other components, but I don't know enough to make it work. Again, I'm mainly interested in the mechanics of how one component can access the serial port instance created in another component. If I could get some user objects going for now, I'd be happy. In the future, I want to roll my own components. If anyone has any suggestions, code snippets, or any other forms of enlightenment, I'd be greatly appreciative!
Rhino5 x64 + GH version 0.9.0056
Thanks,
~BB~
…
r "virtual partitions" as follows:
What I mean "air walls" here, is derived from the description of the E+ documentation with the header of "Air wall, Open air connection between zones". (Page 17, http://apps1.eere.energy.gov/buildings/energyplus/pdfs/tips_and_tricks_using_energyplus.pdf)
As I understand, the term "air wall" used in E+ here refers to a description of something like "boundary condition" between adjacent interzone heat transfer surfaces, but not a kind of "construction or material" (like air space resistance or air gaps within a wall/double glazing window).
The main purpose of introducing the "air wall", is to simulate or approximate the airflow/convection/natural ventilation effect between multiple thermal zones which are connected by a large opening.
In my previous tests, using HBzones and GB, I managed to create the gbXML file which can be successfully imported to DB (without assigning any constructions within HB). And the adjacency condition can be recognized automatically by DB, even when I did not use the "Solve adjacencies" component in HB - shared surfaces between multiple thermal zones are recognized automatically by BD as "internal - partition"(which are standard partitions, but not virtual partitions).
In order to create/approximate "virtual partition", I need to manually draw a "hole" in the standard partition surface (fig.1&2). Again, the reason why we want to use "virtual partitions"(or "air wall") is that it allows airflow between multiple thermal zones which are connected by large openings and we could get different temperature of the each subdivided thermal zone which compose a large thermal zone.
My question is, if there is a possible way to simulate/approximate this kind of "virtual partitions"(or "air wall") in HBzones or in GB? If so, I would like to test if DB recognizes it or not. Actually, we expect that there is no need to involve any manual operations (like drawing a "hole" in the standard partition surface) in DB, due to an automatic optimization loop.
Thank you!
Best,
Ding
fig.1
fig.2
…
he example file to this file so you can give it a try with any version of Honeybee that you're already using. The only requirement is to have OpenStudio installed as the component is using OpenStudio libraries to parse gbXML files. If you're using the latest version available on github the component is also available under WIP tab.
Why?
The main purpose of developing this component is to save time and effort for importing Revit models for energy and daylight analysis. It bothers me to see a lot of smart people spend a lot of time to just come up with solutions just to get the geometry from Revit to Honeybee for analysis. This component is not solving all the issue but is a first step forward. In an ideal world, the future version of Honeybee, which works both under DynamoBIM and Grasshopper should address this issue but that can take some time to be fully ready!
How?
To use this component you need to Export your Revit model as gbXML and then use the file path to load the file into Grasshopper. There are several resources available online on how to prepare the analytical model in Revit and export the gbXML file. Here is an image for importing the Revit 2017 sample model using the default settings. As you can see the model will be just as good as what your original gbXML file from Revit is.
What can be improved?
Well, there are several items that can be improved and they are mostly not on us. To get it started I add what I think are the 3 main shortcomings and my thoughts on how they can be addressed in the future. Feel free to add what you think needs to be added to this list in the comments section.
1. Revit analytical models and as the results gbXML files, by design, are not intended to be clean. Watch this presentation from the Autodesk University to see the logic behind this approach which in short is it doesn't matter for a large scale early stage energy model. Well, This will be quite a problem for studies that you can do with Honeybee. Included but not limited to daylight and comfort analysis.
The best solution that I can think of, until Autodesk fixes their exporter, is to use Revit Rooms and Spaces and generate a clean model from the scratch. We have already tried this approach in Revit but since the Revit API doesn't provide access to Room openings we had a very hard time to get it to work.
That's why that I opened an idea on Revit ideas to get over this issue. With your support we already have 81 votes, but it hasn't been enough to make them to consider the idea for an official review. If you haven't voted already and you think this will be a helpful feature take a moment and vote so we can have it implemented at some point in the future.
2. There is no way (that I know) to export only part of the model. The way export gbXML is set up in Revit is to export the whole model once together. As a result, if you have a huge model with 100 rooms and you want to get one of the rooms into Honeybee using this component you have to export the whole model, which can take some time, and then import them all back into Grasshopper. To partially address this issue I added an input to the component that allows you input a list of names for rooms that you're interested to be loaded into Grasshopper. You can use the name of the room/space in Revit as an input for the component.
3. The component doesn't import adjacencies, loads, schedules and HVAC systems. I wasn't able to export a gbXML file from Revit with any of this data except for the adjacency, but even if you can do that, the component currently can only import geometries and constructions. I hope we get access to 1 and so we don't have to use the xml file approach at all, but if that takes a very long time then we will add these features to the component.
Happy 2017!
Mostapha…
unity in Ukraine, which is orientated to contemporary architecture.
The results of CANactions will be published in ACC magazine (link), on the web-sites of “Architectural club” (link), AB "ZOTOV&CO" (www.zotov.com.ua),
Theme
Theme of CANactions 2009 is emergent design techniques.
This theme could include following architectural branches as Digital design, sustainable architecture and other sectors, which by the participants’ opinions, could be EMERGENT.???
Any architectural projects made earlier of specially for the CANactions’09 are allowed for submission.
Presentation
All the projects will be submitted in two phases:
Phase 1 – selection of 10-15 participants of CANactions.
Project has to be sent by e-mail to: (__) in PDF (not less then 300 dpi, not more then 10 Mb).
Phase 2 –the CANactions participants prepare 15-20 min presentation of their projects (screen projector, microphone) and materials for the exhibition in House of Architect, Kyiv. The project has to be presented by author. -> exhibition is the first architecture biennale
Presentation requirements: file should be composed in PDF format on A0 sheets, placed horizontal (not more then 1 sheets). This file should contain sufficient amount of the presentation graphic material, including text explanation up to 300 words.
The raster images should have printing definition not less then 300 dpi. It’s recommended to avoid solid black fillings, because the projects will be printed on ink-jet printer.
The presentation requirements could be changed after phase 1 results.
The presentation materials should be made in Ukrainian (or Russian) and English. Verbal part can be presented in any language.
Tarek Naga, Naga Studio, Los Angeles / USA (I can contact him - he will do it for free)
Awards
DIA (Dessau Institute of Architecture), Germany gives a prize: certificate for the education for 1 (2) semesters of Master-program in DIA for students and young architects (up to 30 years) from Ukraine. The decision about the prize winners will be made by selection board.
Guests presentations
- Daniel da Rocha DIA /Germany/ (flights, accommodation?). Theme: (scripting???)
- Aleksandr Kalachev DIA /Riussian Federation/, Tudor Cosmatu DIA /Romania/, Irina Bogdan DIA /Romania/ - "Parametrically Defined Urban Patterns".
- Grygorii Zotov DIA /Ukraine/ - “The Multicultural Columbarium”.
- Armen Menendian /USA/ - "Blending Parametric Methods With Traditional Design:
"The Danish Pavilion at Shanghai EXPO 2010".
Exhibitions
1. Projects of 10 (15) CANactions participants
2. other projects: Zotov+Co
Bollinger+Grohmann - structural eng.
the very many
C-Space Pavillon / alvin huang
ala _ amanda levete studio
anOtherArchitect
student work, Charles Walker, AA Unit Pavillon
Event schedule
Phase 1: 01.07.2009 – start of the CANactions 2009 and beginning of projects submission.
16.08.2009 - dead-line of the project submission of phase 1.
Phase 2: 17.08.2009 – announcement of the CANactions 2009 participants.
30.08.2009 – dead-line of submission of the CANactions 2009 exhibition materials.
14-26.09.2009 – exhibition of the CANactions 2009 projects in House of Architect, Kyiv.
25-26.09.2009 – CANactions 2009.
26.09.2009 - finnissage / announcement of competition winners for DIA study
Contacts: canactions2009@gmail.com…
Added by Grisha Zotov at 6:32am on August 10, 2009
y case. Here's the thing. There is this subject at my university where we are assigned a famous building and we need to recreate it in Rhino. We're given bonus points if we manage to code some interesting part of it in Grasshopper. So far so good, I'm doing pretty well with Rhino and by far I am happy with the results I've achieved with modelling the given building. Harbin Opera House by MAD is the building I'm trying to model. There is one particular surface:I've built this surface in Rhino and now I'm trying to map pyramids on it. Not only have the pyramids to be different in height, but their height has to be dependent on the curvature of the surface. I'm getting some results but it seems to be exactly the opposite of what I need. I want to have higher/spikier pyramids where my curvature analysis shows red/blue and lower/slopier pyramids where the analysis shows green colour.At the moment I'm not really sure how the code I have works, but it seems that the height of the pyramids is dependent on a distance from a point in space to the projection of the cap-point of a pyramid.Here're my Rhino and Grasshopper files:surface1.3dm
surface1.ghI'd be grateful if someone of you guys could handle my problem. I've got one more issue with this surface, but once I get a solution to the first 1 will let know what the second one is.Thanks in advance and keep well!…
te some implications and questions so I will go one by one:
"Now I would like to use a single VRay material as a template for creating multiple identical materials"I hope this will work, but as VRay does not expose any SDK, I would not guarantee any specific result.
"Now I need to add them to the document material table"This is done with a reference to a document instance, such as the one you get with the code doc.Materials (both in C# and Vb.Net).
"I'm not going to learn C# to modify his script"That's a pity, it would be nice to pass on this troublemaker to somebody else! :)Btw, C# and Vb.Net are very very similar. This script could be written in Vb.Net too.
"Reference to a non-shared member requires an object reference. (line 96)"This only means that you need to access the Materials property on an instance, not on the type (class) name. Change that line using what is written at point 2.
"Do I understand that the material has to be assigned to a particular object in order to enter the Material Table?"No it does not. But if you call the _Purge command it will be removed if it does not have an object that references it.
"Can I assign it to a Layer instead?"You do not need to. But this would be achieved with doc.Layers[whichLayer].RenderMaterialIndex = materialIndex; in C# or doc.Layers(whichLayer).RenderMaterialIndex = materialIndex in Vb.Net.
"Any ideas? A better way to do this?"If you found a way to bypass the VRay SDK not being there, this should work.
"Giulio's component has a type hint defined as a Material"It does not any longer. The hint was there in earlier versions of Grasshopper, but now the hint has disappeared. This is not so bad, and it is also the only way you would be able to use either a Material instance already or a string for a material name.
"How was that done?"Probably it was done in an older version of Grasshopper. But which version are you using?
"I can't figure out how to cast the input as a Rhino.DocObjects.Material, so you can see that I have cast it as a compatible type in the first 2 lines... is there a cleaner way?"That sounds like a good way actually. Be sure your component responds properly when something wrong is inputted, though.Dim mTemp As Rhino.DocObjects.Material = CType(M, Rhino.DocObjects.Material)in one line might also work. See msdn for more conversion operators and functions.
I hope this helps,
- Giulio_______________giulio@mcneel.com…
ns. but first allow me to explain what i'm trying to do: i have a serial device i want to talk to, but i have to do it using some sort of handshaking. for instance, when i send a command/data, i need to wait for an appropriate response before sending another. i have used andy payne's general serial components from firefly, but i don't think they'll work for what i want to do, and in general, i want to know how to do this from scratch. i'm using the pyserial library to do the comm, and i can get it to work within one script. here's an example of a working (mostly) port open/close script (x=input param for baud, y=input param for port name, z=boolean input param for open/close):
import serialmyPort=serial.Serial()myPort.baudrate = xmyPort.port = yif z == True: try: myPort.open() except: print "Something went wrong. Cannot open port." if myPort.isOpen() == True: print myPort.name + " is open" if z != True: try: myPort.close() except: print "Something went wrong. Cannot close port." if myPort.isOpen != True: print myPort.name + " is closed"
this all works well and good. here are my questions:
1) I can open the port and then close it. however, if i try to re-open it, i get an access denied error. it seems rhino is holding the port open, as i have to re-start rhino to get it working again. i read through the discussions and didn't see any definitive answers to this problem. any advice?
2) I'd like to share this port with other components (or at least break up the functions of opening/closing the port and read/write, not unlike how the firefly components are organized), but i have no idea how to share an object instance between components. i did see that there is a sticky dict and tried to add myPort to it, but i kept getting errors in the other component when i try to use the object's methods. for instance:
Component 1 Script:
import serial
import scriptcontext
myPort=serial.Serial("COM4", 9600)
scriptcontext.sticky['myPort']=myPort
Component 2 Script:
import serial
import scriptcontext
myPort=scriptcontext.sticky['myPort']
print myPort.read()
but i get messages like:
Runtime error (MissingMemberException): 'Serial' object has no attribute '_port_handle'
any assistance would be greatly appreciated!!
best,
~BB~…
ceros.
Public concerné /
Architectes et designers, utilisateurs de Rhino souhaitant paramétrer Rhinocéros à l’aide de Grasshopper,
programme associant des composants et une structure de graphe interagissants avec le modèle Rhino.
Une bonne connaissance de Rhinocéros est nécessaire. La langue de la formation est le français.
Structure et Objectif de la formation /
La formation se déroule sur 3 jours : les 2 premières journées sont consacrées aux « fondamentaux » de
Grasshopper avec en préambule une introduction au design et à l’architecture paramétrique et leurs impacts
dans la conception, la création et la construction.
La troisième journée sous forme d’atelier est dédiée à l’étude de cas concrets proposés par les stagiaires, qui,
quelques jours avant la formation, pourront envoyer leurs projets par mail à - info AT rhinoforyou DOT com -
Les stagiaires, après la formation, pourront rester en contact avec les formateurs de HDA par le biais du
blog complexitys.com et le twitter @HDA_Paris. La durée de cette formation permettra d’atteindre une
autonomie et une bonne compréhension basée sur des exemples concrets.
Programme ind icatif des notions traitéES pendan t la formation /
Introduction à la conception Paramétrique . Rhinoscript, Grasshopper: différences et similarités . Interface
graphique de Grasshopper . Objets, Données, Listes . Opérateurs scalaires : La mathématique de
Grasshopper . Gestions des données : la logique de Grasshopper . Vecteurs, Points, Lignes, Surfaces : La
géométrie de Grasshopper . Listes, Arbres, Branches . Le dessin paramétrique: exercices divers et exemples
. Références, Bibliographie, Support de cours . Ateliers d’architecture et design paramétrique (3ème jour) .
Moda lité de la formation /
Venir avec un PC portable équipé de Rhinocéros version 4.0 SR 7 et de la dernière version du plug-in
Grasshopper (téléchargeable sur www.grasshopper3d.com).
Le coût du stage de 3 jours est de 1050 € HT par personne.
Réserver votre place dès que possible car les places sont limitées à 10 participants maximum.
Inscriptions et renseignements: Jacques Hababou, info AT rhinoforyou DOT com
Pour en savoir plus sur l’architecture paramétrique: www.complexitys.com…
t. So here we go!
1. Honeybee is brown and not yellow [stupid!]...
As you probably remember Honeybee logo was initially yellow because of my ignorance about Honeybees. With the help of our Honeybee expert, Michalina, now the color is corrected. I promised her to update everyone about this. Below are photos of her working on the honeybee logo and the results of her study.
If you think I'm exaggerating by calling her a honeybee expert you better watch this video:
Thank you Michalina for the great work! :). I corrected the colors. No yellow anymore. The only yellow arrows represent sun rays and not the honeybee!
2. Yellow or brown, W[here]TH Honeybee is?
I know. It has been a long time after I posted the initial video and it is not fun at all to wait for a long time. Here is the good news. If you are following the Facebook page you probably now that the Daylighting components are almost ready.
Couple of friends from Grasshopper community and RADIANCE community has been helping me with testing/debugging the components. I still think/hope to release the daylighting components at some point in January before Ladybug gets one year old.
There have been multiple changes. I finally feel that the current version of Honeybee is simple enough for non-expert users to start running initial studies and flexible enough for advanced users to run advanced studies. I will post a video soon and walk you through different components.
I think I still need more time to modify the energy simulation components so they are not going to be part of the next release. Unfortunately, there are so many ways to set up and run a wrong energy simulation and I really don’t want to add one new GIGO app to the world of simulation. We already have enough of that. Moreover I’m still not quite happy with the workflow. Please bear with me for few more months and then we can all celebrate!
I recently tested the idea of connecting Grasshopper to OpenStudio by using OpenStudio API successfully. If nothing else, I really want to release the EnergyPlus components so I can concentrate on Grasshopper > OpenStudio development which I personally think is the best approach.
3. What about wind analysis?
I have been asked multiple times that if Ladybug will have a component for wind study. The short answer is YES! I have been working with EFRI-PULSE project during the last year to develop a free and open source web-based CFD simulation platform for outdoor analysis.
We had a very good progress so far and our rockstar Stefan recently presented the results of the work at the American Physical Society’s 66th annual DFD meeting and the results looks pretty convincing in comparison to measured data. Here is an image from the presentation. All the credits go to Stefan Gracik and EFRI-PULSE project.
The project will go live at some point next year and after that I will release the Butterfly which will let you prepare the model for the CFD simulation and send it to EFRI-PULSE project. I haven’t tried to run the simulations locally yet but I’m considering that as a further development. Here is how the component and the logo looks like right now.
4. Teaching resources
It has been almost 11 months from the first public release of Ladybug. I know that I didn't do a good job in providing enough tutorials/teaching materials and I know that I won’t be able to put something comprehensive together soon.
Fortunately, ladybug has been flying in multiple schools during the last year. Several design, engineering and consultant firms are using it and it has been thought in several workshops. As I checked with multiple of you, almost everyone told me that they will be happy to share their teaching materials; hence I started the teaching resources page. Please share your materials on the page. They can be in any format and any language. Thanks in advance!
I hope you enjoyed/are enjoying/will enjoy the longest night of the year. Happy Yalda!
Cheers,
-Mostapha
…