sabato, ottobre 08, 2016

Temporary Dynamo Panic

Picture this scene in your mind: you are at the customer office, you are about to give the best you have got for the very last day of a so far very successful workshop, you click on the Dynamo icon in Revit 2017 and that's what appear before you:

Computers uh? ok, let's try one more time... nothing, same message, let's try sandbox.. it doesn't even show up, let's reboot... nothing, let's uninstall clean and reinstall... nothing, let's uninstall all the Dynamo versions you could possibly find..., let's upgrade to the latest version... let's try a different version of Revit, 2016, 2015... nothing, nothing, nothing!!!

There must be something on Dynamo Forum that explains how to solve this, right? well guess what.. nothing there. Ok let's ask Google... same as above.

"The file exists", over and over the same message!

What file? What are you talking about? Why are you messing up with me? Why this window does have no title?!?!??

Can you feel that uncomfortable sensation growing inside? and when the workshop is over you think of all the other projects where you absolutely need Dynamo to work as you are running out of options,  plus it is the weekend so you can't really do much about it until Monday.
New laptop, new software, a trip to a holy place to clean of your sins? 

What worked for me was a little quiet time in an aircraft watching "the secret life of Walter Mitty" on the small screen in the empty seat next to mine because the remote in my seat wasn't responding (not a lucky day for devices around me).

I open Revit, I go back to my good old fashion macros and try to find some comfort there where I've never been let down before...and the SDA.exe threw an error! Perfect.
But at least I finally had something to debug, Visual Studio popped up and this is what I read:

So after 24 hours struggling to understand what went wrong with Dynamo it turns out that is this mscorlib.DLL (dirty little lier) that is causing me all the pain!

When I touched the ground again it was easy to lookup for a solution: my TEMP folder was full, way beyond the maximum number of files for which the GetTempFilePath() method in the mscorlib.dll raises the exception that prevented me from launching Dynamo or Visual Studio or the Revit macro environment.

As you might know numbers are infinite, even integer numbers, but in computer science there are many number "flavours" so to speak, and in particular not all the numbers can be represented using a specific flavor.
In other words in computer science I can have a maximum and a minimum value for a given number flavour.

For the TEMP folder the limit is 65535 files, which is the maximum value for a ushort integer (or unsigned 16-bit integer). So I cleaned my TEMP folder (if you don't know where it is just type %TEMP% in the address bar in your Explorer) and everything went back to normal.

I've already asked the good people in the Dynamo development team to introduce a preliminary test when launching the application so that the user can be informed if a cleanup of the TEMP folder is needed (you need the user input on this because you are deleting files at your own risk). Hopefully nobody will have to go through the same panic situation as I did.

You can find more information on Value Types here.

giovedì, settembre 29, 2016

Section View in Revit API / Dynamo

It happend before, I made it to Jeremy Tammik's blog The Building Coder helping a colleague with a Revit API question about sections creation/orientation.

The whole story though started from Dynamo!

I needed to automate the creation of Section Views and what I came up with was to decompose and recreate a CoordinateSystem object to have the section on the right side of the Bounding Box.

Translating what I did in Dynamo nodes into Revit API led me to the solution reported in the blog link.

Knowledge is powerful and you never know where and when a help might come from, I have to say that getting to know and teaching Dynamo to others made a whole lot better "programmer" (I prefer logical thinker) and I'm saying this even if I started my Dynamo journey with an open mind but with no real expectations.
Well, the more you know, the better.

giovedì, settembre 08, 2016

Arc By Three Points returns wrong parameters

I was dealing with Sandbox and found a weird behavior with the angle parameters of an Arc By Three Points in Dynamo.
The Constructor is working fine but the angles are somehow wrong, I tried to use them to create a new arc by center point radius angle and the result did not overlap with the original arc.
I used some extra nodes to retrieve the correct angles using some auxiliary geometry (second image) but it works only in the XY plane.
It should be an easy fix for the Dynamo Team.

lunedì, agosto 22, 2016

Self-Redefinition in DesignScript

I just stumbled upon this interesting fact of the default language block you have in Code Blocks:

It looks kind of weird at first right? you would expect that the result is 1, not 2, if you do the same in a Python script you have right 1:

Note how there is only one output port on the Code Block, this is because the variable in play is called x on both lines, plus the default language block is Associative which means that each assignment is re-executed, some sort of recursion, to update all the variables values.

At first x = 0, on the second line the same variable x is then assigned to an expression x + 1, which returns x = 1, but since 1 is different form 0 it means that the value associated to x has changed so the Associativity kicks in and it re-executes the assignment that yields 1 + 1 = 2   which is totally correct in terms of DesignScript Associative language block context.

There are a couple of options to get the "standard" value 1 out of a Code Block:

Look at the number of output ports on the right side of these Code Blocks, just be thoughtful when you are using DesignScript because you need to know its own rules.

domenica, agosto 07, 2016

GraPHIcal definition of the Golden Section

One of those number deeply embedded in nature, the limit of the ratio of two consecutive members of a Fibonacci sequence, the so called number phi (1,618....) or golden section.
Just for fun, I threw in also the graphical method to extract the square root of a number, can you see it?

giovedì, agosto 04, 2016

Dynamo Letter Range

It's not exactly an ASCII table, but it can be useful to know that ranges in Dynamo Script can work on letters too, try it for yourself.

martedì, luglio 12, 2016

A360 Team discount

As found on the A360 blog:

Today only: subscribe to A360 Team for only $2/month (80% off annual price) as part of Amazon Prime Day.
Here are just a few reasons to buy A360 Team seats for your team:
  • Invite your clients into your A360 projects
  • Add seats for your subconsultants and design partners
  • Ensure your whole team is working together in A360 Team
If you don’t have an Amazon Prime account, you can sign up to gain access to Prime Day  deals. We’ve put together a guide to setting up your Amazon Prime account:

venerdì, maggio 06, 2016

Russian Dome in Dynamo

Just a little experiment with Dynamo to create something that resembles a Russian Dome like those of the St. Vassily's church on the Red Square in Moscow...

Here is the Dynamo graph to play with.

giovedì, aprile 28, 2016

Panel Recursive Optimization

I continued the research of the fastest algorithm and I tried to apply a simple recursion instead of an iterative approach; I introduced also another constrain, I wanted to preserve the original vertex normals (each new vertex is obtained by pushing/pulling the original vertex along its surface normal).
The output is a flat panel made out of 4 vertices when it is possible, otherwise there is a compensation made of triangles, still flat of course so it is a combination of quad and tri shapes.
This 9x9 grid, took a little less than 10 seconds to complete.

sabato, aprile 23, 2016

Panels Optimization with Dynamo

These days I've been giving a Dynamo workshop to Jan, a former Grasshopper user with a big passion for optimization problems and automation.
He showed me a couple of examples were GH is used to solve panels optimization, in particular something that would produce flat panels over an organic surface.
I liked the challenge and we started to discuss possible algorithms to find a Dynamo solution to the same problem.
Firstly the subdivision of the surface only using Dynamo Out Of The Box nodes as opposed to the possibility of using LunchBox (I'd say just for academic purposes), so to have set of points to place adaptive components.
In Revit is relatively easy to get flat adaptive components out of 4 points and Zach Krone showed how to do that in his blog, what you have in return though is a set of panels that are discontinuous, in other words you have gaps along the sides of the panels and usually when I show this example I use a report parameter to measure how much the panels are deviating from the original surface.

The optimization problem is different, basically you accept to have points that are not sitting on the original surface but that are derived from it and that put together will generate a set of flat panels with no gaps, so that the outcome will look like a continuous quad mesh.

I started to think at this problem having in mind the iterative approach that I've seen in the videos that Jan showed me, I came up with a couple of different solutions, each vertex can be further adjusted at each iteration based on a variable number of "target" optimized positions (from 0 to 4) depending on where it is in the grid. If you set an high enough number of iterations you eventually get what you are looking for, but I guess that the optimization should be also after the minimum number of iterations required to get all the panels to be flat.

In the first attempt I've used an iterative approach that took in consideration all the vertices at each cycle, so it was running on a new set of points at each iteration.
In the second attempt I decided to introduce a maximum deviation from the flat condition for groups of 4 points. Basically if 4 points satisfy the maximum deviation condition they are not going to change in the following iterations.

In the image above, on the left you see an output for 5000 iterations over a 9x9 grid generated from the free form surface in Revit on the right.
The grey panels are flat, the colored panels didn't meet the maximum deviation condition (in this particular case it means that the red corners for each panel are more than 0.00001 mm away from the plane that best fit the 4 corners).
In the output I have a value that tells me the number of iterations required and the time elapsed to find the optimized vertices, if the number of iterations reaches the maximum values it means that not all the panels meet the maximum deviation condition.

This kind of processes can bring down the fabrication costs quite sensibly, once again Dynamo saved the day.

martedì, aprile 19, 2016

Egress Path and Minimum Travel Distance with Dynamo

Yesterday I've been playing with Dynamo to calculate the minimum travel distance and the egress path length for each room of a level in Revit, it is still a work in progress and there is much to do in terms of handling exceptions, avoiding obstacles, but the core is there and it hasn't been that difficult to achieve after all.
I can say that having the possibility to choose among several tools to solve this kind of problems is a very good sensation, I can see several applications for that, in the design phase of course but also in the O&M of a facility, especially when there is valuable equipment that has been moved from one room to another.
I'd like to hear some feedbacks on this so feel free to leave a comment.

sabato, aprile 16, 2016

It's time to vote for Computational Design!

I wouldn't do this if it wasn't for a good cause...

Please, everyone who is interested in computational design and model based workflows, help to make this project reach the next stage: follow the link at the end of this page, subscribe and follow that project, propose 5 questions you would like to see on that stack exchange (look at mine for example, those are not platform related, I kindly ask you to do the same) and vote for questions proposed by others.

The goal now is to hit a minimum of 60 followers and 40 questions with 10 votes each so please don't waste your votes and thank you!

giovedì, aprile 14, 2016

Dynamo for pattern design

Recently I have been asked to demonstrate how Dynamo can help in the manufacturing market, especially in pattern generation, so I came up with this little example that can show all core Dynamo features at once: the Visual Scripting side by side with some Dynamo Script as well as some Python Nodes, Complex Geometry controlled by Parameters, Pattern generation, Lists handling, the Connection with External Resources (in this case Images) that can be used to generate information, the Export to SAT format to bring the idea in the physical world through other platforms such as Fusion 360.

If you were looking for a tool that does right that, you've found it, but Dynamo is much more!

giovedì, aprile 07, 2016

New Autodesk Blog around BIM and Beyond

Behold everyone, there is a brand new blog around BIM and cool stuff like Dynamo and React Structures that you might want to keep an eye on, so please subscribe and add it to your favorite readings, let's see what's in the box!

martedì, aprile 05, 2016

Delaunay Triangulation with Dynamo

I was reading a twit by Dimitar Venkov and it caught my attention, how can you use Dynamo to create a triangular mesh from a list of points, here is the discussion on the forum.

I was looking at the same problem my self not too long ago, it is achievable in Dynamo too but there is a lot to learn about Delaunay Triangulation and the algorithms to solve it.

Searching on the internet I've found several examples, the one I decided to try to implement in Dynamo is this one.

Basically is what Revit does when it reads a LandXML file and converts it into a Topographic Surface, well... almost..., therefore some "ghost" triangles outside the true mesh are going to appear.
If it is possible to add an outline, like a polycurve, they could be removed with a little bit extra effort.
This is not yet a Constrained Delaunay Triangulation though, but it works.

To be honest I had to swap the Y and Z coordinates in this example ant then swap it back before creating the surfaces and get rid of an extra "construction" triangle in the latest while loop.

Using the same algorithm it is possible to derive the IndexGroups  and create a Dynamo Mesh from the same list of points, the graphical result is quite different and smooth.

Once again our Dynamo Swiss Knife saved the day.

lunedì, aprile 04, 2016

BIM Manager / BIM Coordinator wanted

Maffeis Engineering S.p.a. based in Solagna (VI) is looking for a BIM Manager and a BIM Coordinator with a very good knowledge of Revit and the BIM workflows.
Please get in touch with the human resources to send a CV (English) and ask for more details about this position and job description (I don't retain anymore information unfortunately).

sabato, marzo 19, 2016

The dream

A while back when I was working for and architectural firm based in Milan Italy I was actively contributing to this blog at a crazy rate, even two posts a day sometimes, and I was answering questions around Revit and BIM in forums, sharing what I know as much as possible.

Knowledge is power, and the simple act of sharing knowledge can make a big difference.

One of my dreams was to be able to start a group of professionals to share ideas, around BIM in Italy and how this is going to change how we see the world and how the world looks on us, as a Country, to aknowledge the value in what we do, because we are passionate about it, because we take proud from being intellectually challenged, pursuing a never ending improvement.

What I felt was missing those days had become a necessity now, and thank to the efforts of Chiara Rizzarda, Claudio Vittori Antisari and Luigi Santapaga, it finally happend.

On March the 15th I was invited to the very first meeting of professionals around BIM in Milan, I saw old and new friends coming from all over Italy there, in a very warm and welcoming atmosphere, each and every one with a different story behind but eager to contribute and grow, together.

We talked about expectations and opportunities, we drew sketches and took notes, I can only speak for myself but I felt really good, I felt free to express my ideas and I was thrilled by the interaction in the room that night.

I was honered to be there, I sincerely hope that these meetings will grow in number of partecipants not only professionals but also owners, managers, contractors, all the people that will have to face the change of approach to their businesses and start a new path on the right foot, being supported by those who get their hands dirty with BIM every day.

Early adopters, with concrete solutions to concrete problems, getting together to work better, and the best part is that is not a dream anymore.

domenica, dicembre 06, 2015

Everybody loves Marcello, but...

It's true.
He is a brilliant man and he has done an astonishing work in the past with Revit, and most of all he shared his work and discoveries in multiple occasions and he became one of the most respected opinion leader in the world wide community through blog threads, Autodesk University Classes, RUGs and so on. So he's one of my superheroes and he knows it.

It's been a while now that he is on Dynamo, he has a course on CAD Learning and here's the latest class at AU named "More Practical Dynamo: Practical Uses for Dynamo Within Revit" that you should check out, it's been recorded and it's available for free.

I watched it on streaming and I was hoping to see some of his magic tricks in action but I was disappointed, very much, partially for the content of the class itself (I get that most of the people who attended the class hadn't the slightest idea of what Dynamo is and how it works but 20 minutes to change texts to upper case, seriously?), and mainly for a few false concepts here and there that will make people go "Marcello said it, so it must be true" because of who he is for the community.

I just couldn't turn a blind eye on it, for the sake of those who will approach to Dynamo and Revit API in general because they were inspired by Marcello's work, he's a good story teller, and I get that sometimes he needs to simplify concepts, like in this case, but too much simplification can lead to misunderstanding and unnecessary confusion, especially when it's going to be out there for a very long time.

Just a couple of examples:
1) [0:08:25] Element Types ARE NOT System families, they are the Base classes for all Types within Autodesk Revit (System or non-System family types), they simply are different animals.

2) [1:21:12] With this version of the Revit API it is not possible to create a "free standing" Railing but only hosted by a stair object and there are no exposed method to change the path of a Railing object. So NO, you can't create the fence example using an actual Railing object directly from Dynamo, something that you might want to change type later on per say, but you can use generic models, adaptive components, you could model the whole thing in Dynamo and import it in Revit using DirectShape...
Here's a question on the Revit API forum on the same topic.

What I'm saying is to keep up the good work, the creativity and the inspiration as a community, but in order to do that we should never take for granted what people tells us to be true (not even me, not even our heroes) and wrap our own head around problems, so if we look at the same problem from different point of views we might find a truly better solution.

I've tried to follow a very wise and simple ABC rule I've read somewhere, I think it's worth sharing:

Assume nothing
Believe in yourself
Check everything

mercoledì, ottobre 28, 2015

Project BuildCity3D

Here is a brand new initiative by my good buddy Cesare Caoduro from his LinkedIn page: unleash all of your creative power and test your skills with the collaboration tools provided by the A360 platform!

You get to to pick your favourite Autodesk tools and create your own city for free!

So get an Autodesk Account if you don't have one already and be prepared to submit your models!

Like Cesare said on his page:

"...Imagine and design your personal city because the imagination is the only barrier for game designer, think like a game desiger or like a baby constructor..."

Read more here

I'll be there, and you?

giovedì, settembre 10, 2015

Setting Active View Temporarily Disabled

Sad news, thanks to Alex S. I ran into what appears to be a by-design limitation in Dynamo.

The idea was to duplicate a Legend View since it is not possible to create a new one from the API, rename the copy and use it to set the Active View property of the UIDocument.
Turns out it's not possible to do that in Dynamo, for now.
Here's the Python script I've used, maybe someone has already found a solution to that.

lunedì, agosto 31, 2015

Dynamo 0.8.2 is out!

Good news!

the latest stable release of Dynamo is out and ready for everyone to test, you can find it here in the DynamoBim official page.

Among other really awesome things that you can find in the release notes, one in particular caught my attention: the "Node to Code", which helps you to learn DesignScript converting (where it is possible) the graph into a very well organized CodeBlock.

This is a fantastic feature that adds clarity to a graph and opens the path for a Dynamo code compiler, that's one of the things I've been dreaming on for a robust firm-wide Dynamo implementation.

Plus from what I could see the development did a really good job in resolving clashing issues in geometry representation in the Dynamo environment.

Happy Dynamo!

domenica, agosto 30, 2015

Lacings in CodeBlocks

Today I stumbled upon this notation in codeblocks and I tried to figure out how it works because I couldn't remember any documentations on this particular aspect but I think is pretty useful because it helps having compact clean graphs.

I've used a range from 0 to 5 (I prefer to use the codeblocks for this purpose) and built some points, on the Point.ByCoordinates node there is the lacing strategy to apply but on codeblocks there is not (to be fair now you can assign the lacing strategy to a selection of node via right click, also the codeblocks but it doesn't seemed to work in my case) .

With this syntax though you gain control over the range and how to use it applying transposition directly.

b=Point.ByCoordinates(a< i >,a < j >,a < k >)

Now i,j, and k have to be non negative integers, which means zero is allowed, what this does is to let you control how to combine the numbers in the range.

If i,j and k have the same values then the result will be a list of 6 points where for each point x=y=z.

When these indices are equal to 0 they return the first value of the range (in this case 0), otherwise the indices express the order in which the values in the range are going to be combined: the higher index is the one that goes through all the values of the range first.

When two indices are equals and bigger than  0, for instance 1,1,2 or 2,2,1, the geometric outcomes are going to look the same but the points will be listed differently just like using the transpose node.

When the indices are all different and greater than zero you a have a cross product lacing behavior.

Without further ado, here are some images that can explain better the results of the different combinations.

sabato, luglio 04, 2015

Mario Is Unreal

Dynamo 0.8.1 is out!

Finally this stable release is out for every Dynamo user, I've been waiting for such new feature for so long, and finally they are here!

Many thanks to the team for the amazing work once again.

Now I want to talk in particular about the grouping feature, this is the first step towards a robust, well organized, easy to read and edit Code/Graph.

A group is a collection of nodes, this is the closest thing that we have in standard coding with private functions or subroutines or whatever they are called in other coding languages.
To create a group is easy: select the nodes and CTRL+G (yes, I know... too bad that it is the same shortcut to toggle between the graph and the geometry view until 0.8.0, get over it!).
To be honset there are a couple of ways more  to do that via the menu, right clicking... so stop complaining, you have been given a LOT more than just that.

If you select the group with a right click you can assign the color, and make the title really, REALLY visible with a huge font size.

Now the user can better understand what a set of nodes is meant for, so it becomes easier to orient inside a graph saving a huge amount of time. Love it.

If you want to remove a node from a group, right click on it and remove it from group, viceversa if you want to add a node to a group you need to select the node AND the group at once, right click and Add to group, that easy.
Anyway I wish it were as simple as "drag-and-drop" items over a group but hey, Rome wasn't build in a day.

Nodes inside a group move all together, so it is fairly easy to organize nicely your graph in a few clicks. A couple of issues are still there though: if you try to align two groups, what you are really doing is aligning the nodes inside the groups all together... so for now you don't wanna do that, maybe in the next releases such behaviour will be improved.
A nice thing to have would be the ability to "lock" a group, so no user is allowed to mess with it

We have colors, let's use them to organize our graph! Yes but how? We have 16 colors for now, let's say we start distinguishing main functions in our graphs:

  • Input
  • Data manipluation
  • Output
  • Debugging
I know it is even too much simplified, but what can be wrong with simple?
So, please, let's keep it this way.

It would be AWESOME to standardize the color meanings inside a firm, to provide consistency, so one can pick four different colors from the bottom row and assign each one of them to functions above.
It would be nice to follow an order too... from left to right, like when you are reading a book, so for instance:

  • Purple -> Input
  • Orange -> Data manipulation
  • Green -> Output
  • Light Blue -> Debugging
I feel that this approach can be really useful if we want a serious Dynamo implementation in our everyday processes, plus this would increase the possibility to make circulate these graphs between firms and open up to a more productive environment with multiple benefits for every one involved.

Next step? Dynamo templates of course!

venerdì, gennaio 09, 2015

Model freezing

One of the issues that designers are most concerned about is the protection of their intellectual property within a model.
In an environment where the exchange of informations is vital to the process, one can not refuse to cooperate and share his model with other stakeholders involved, plain and simple.
There are different ways to protect the intellectual property without affecting the data exchange, such as using a different file format (e.g. DWF, IFC, etc..) but there's nothing we can do when it comes to native file format for authoring platforms like Revit.
Or maybe not.
I've been looking to the new functionality shown by Jeremy Tammik in his blog, the DirectShape, intended to allow the users to import geometry created in other softwares through other formats like OBJ for instance.
What I was trying to accomplish instead was to create a DirectShape from the actual model, retrieving a solid and fill the voids left by the rooms for 3D printing optimization, I'm still struggling on this particular issue since rooms appear to end up as solids with negative volumes.

Then came to mind a possibile application, the model freezing: one can select a portion of the model that wants to lock and eventually use it as a component. in other projects.
In theory it is possible to freeze the entire model, obtain a generic model, copy and paste it into a blank project, and deliver that to a third party.
The odd thing is that the family created through this process has no Type and it is not even listed in the family browser, so it can't be edited and saved in anyway.
The generic model is not editable and won't even export to CAD for what it matters, the only workaround I found was to export it to IFC.

In this case all of the data is retained except for the 3D geometry and some material information (just the appereance because tagging won't work). 

sabato, novembre 29, 2014

Insert Excel worksheets as Revit Schedules

I'm ve been away for a while, I've some news too.
Since October the 1st 2014 I'm part of the Autodesk Consulting AEC EMEA team, and I'm really happy! I'm sorrounded by very talented people and I'm learning everyday something new. Unfortunately I wasn't able to blog for a long time.

But anyway I'm here now and I want to share with you what I couldn.t over a year ago. During the first session in the very first RTC Europe in Delft, David Conant showed us a very interesting application of the new feature in Revit 2014, the highly customizable schedules!
Back at the time I had little knowledge of coding since I had just started the course by Harry Mattison of Boost Your BIM on Udemy, which by the way you should totally check out if you haven't yet.

I had time these days to test my understanding of how Revit API can work for me and made a little experiment to mimic what I saw at RTC, it's still a work in progress but I think it's been one of the highlights of that a RTC and shows pretty well what can be ddone if you just think out of the box, so my big thank you goes to David and Harry.

Here it is.

giovedì, settembre 25, 2014

Export Sheets in shared coordinates

When working with consultants or clients it's fairly common to ship PDFs and DWGs of the sheet sets along with the Revit model, however DWGs are the weakest part of the overall process.
Revit is not able, natively, to export DWG in shared coordiantes from a sheet view, but from a regular model view it does although it will never be a native DWG file. So I wrote a macro (see a previous post) that collects the views on a sheet and exports them in a separate folder to have them organized and in shared coordinates.
What was missing was the ability to include the title block, which was ok for consultants but not for the client.
So here's a video that shows how this issue can be solved using both Revit and AutoCAD.
DWGs are still X-Refs and they are not clipped like in the previous version, each view is then rotated accordingly to the Revit file. Each viewport only shows the layers of the corresponding x-ref. For further enhancements the views could be locked automatically, there could be a batch file that will open AutoCAD and do the job for each sheet file, etc... I'm still working on and testing it. I hope to find a way to run the whole thing from Revit with the press of a button. Suggestions and critiques are appreciated as long as they are constructive.

lunedì, settembre 22, 2014

Super Tag - Parameters grouping

In this examples I'm trying to retrieve the parameters of a generic model representing a person (a generic model smile shaped) in a room with all the equipment that belongs to his/her such as the workstation or the phone (each family has its own parameters).
In the previous example parameters were just listed in a certain order hard-coded in the Updater, this time the order needs to change slightly so that the parameters referring to a spefic person are all consequential.
In order to do this an additional step must be included in the process.
The best way I could think of is to group the families involved (the person, the workstation and the phone), retrieve the parameters for grouped objects first and then the remaining outside of groups.

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.

sabato, settembre 06, 2014

Dynamo - Document Nodes Confusion

In addition to Marcello's post  on confusing node names for selection in Dynamo, I'd like to point out what I've just discovered about the Document nodes.

In the API the document that is shown to the user is called Active UIDocument (for brevity uidoc), this element has a property called "Document" that refers to the data base level document (for brevity doc). Any time we want to edit a file in Revit we need to open a transaction that points to a specific doc, while the user interacts with the current uidoc.
In a Revit session there could be multiple docs opened at the same time at a database level (think for instance to a host and links scenario, linked files are documents somehow opened at a database level but not directly editable by the user in the current session; similarly, with multiple editable docs opened, the user is allowed to edit just one at a time, the active document, the uidoc), they could be project or family documents.
The API allows access to those docs without the user interaction and for this reason it's important to have clear in mind the differences between the two: for example, object selections belong to the uidoc (because they require the user intervention), walltypes belong to the doc (because their definition doesn't depend on variables such as the active view), etc.

In the picture above you can see that Document.Current is referring to the UIDocument since I got the active view name, while the Element.Document is referring to the Document since I got the title.
Hope this is gonna be fixed or cleared up in releases to come.

Are you kidding me???

venerdì, settembre 05, 2014

Dynamo - Rooms Solids - Color Scheme for any parameter

This is a further development of previous Dynamo definition, now it can apply the color scheme for any parameter, there's a little bit of coding in there because I couldn't figure out why a cross product lacing over a List.FilterByBoolMask returned a null list for the In and Out output ports.
Anyway I did it myself using a very simple script in Python.
I'm trying to avoid them as much as I can, really, but when I'm tight on the dead line and I need  the get the job done, coding is always my best option, even if I don't feel particularly comfortable with Python, but I guess it's how my brain works, I know for a fact that amazing things are achievable just using the OutOfTheBox set of nodes, so I hope to have enough time to obtain the same thing using a "pure nodes" approach instead.

I guess that the beauty of Dynamo is that everybody can play with it and  make his own tools, no doubt about that.

Here's the code I've used to collect rooms in the project:

Here's the code I've used to retrieve indexes evaluating the elements of ListA against the elements of a ListB, the output is a list of integers, as long as ListA.
In this example ListA contains Department values for each room in the project (11 rooms gives 11 items) while ListB contains the same values but derived from the Color Scheme file (5 department entries gives 5 items).

The outcome of this python script is used to determine which color has to be used to override each one of  the solids derived from rooms.

Solid extraction and ListA:

Color override and ListB:

Here's a .Zip file containing the .Dyn, .Rvt and .Csv used in this example.
In action: