Visualizzazione post con etichetta room. Mostra tutti i post
Visualizzazione post con etichetta room. Mostra tutti i post

mercoledì, settembre 17, 2014

Super Tag - Dynamic Model Update




I've been wrapping my head around dynamic model update in order to push my code further to be more "Revit-ish", so it updates instantly and has no longer a "fire and forget" sort of behaviour.
I've implemented an IUpdater interface that loops through the family instances, reads their parameters in a certain order and then pushes them into the comments of the room.
It's not perfectly Revit since it's not bi-directional at the moment, anyway it gets the job done nicely.

Technically the oddest part in developing this idea was to realize that an IUpdater doesn't need a transaction to work.

Applications are endless, this one I called "Super Tag", it would give the ability to the users to push calculated values into tags (finally!), embedding a piece of code in the template file assuring that everyone on the team has the same tools available.

There are considerations to make on performances, but it sure is a great thing we have to suit our design.

mercoledì, settembre 03, 2014

Dynamo Room Solids





I've been asked today by a collegue how to replicate an axonometric view of AutoCAD spaces into Revit for a preliminary design.
In the past I've tried to do something using IFC but the result wasn't that good after all for many reasons.
This time I tried a Dynamo approach to the problem since it allows access to data and particulary to the solid representation of elements.
What I needed was a little bit of code to select rooms in the project but I still suck in Python, I happend by chance in a package by Nathan Miller called LunchBox and one of the custom nodes inside this package retrieves a lot of room data. What I did in this case was to copy the import statements from this node and write a few lines of Python code on my own to filter objects belonging to the Room Category.
After that it was fairly simple extract the solid representation for each room, I created a list to keep the geometries distinct because I wanted to be able to control the color of each room to match the color scheme in 2D views.
Here comes the sloppy part: unfortunately the API (Revit 2014 as far as I know) still doesn't give access to the color scheme parameters, so not even in Dynamo it shouldn't be possible to retrieve those parameters.
To keep it simple I decided to write a CSV file containing the paramter value and the components for the colors in the color scheme (this one was based on the name of the room, but it could be done for every parameter availible, just keep in mind that room solids have to be grouped as one big object for each value of the color scheme (I know it's not very handy but I couldn't figure out another way to do it, suggestions appreaciated).
Here's the definition for those who want to have a closer look to it.