Pagina's op IkLeerBIM

Posts tonen met het label API. Alle posts tonen
Posts tonen met het label API. Alle posts tonen

donderdag 22 oktober 2020

Update IkLeerBIM Dynamo Package

The IkLeerBIM Dynamo package has just been updated.

more methods, more arguments,
ready for Revit 2021,
and what about sandbox and other software.



A few things have improved or changed:
  • Some Python 'build in functions' did not show up as a method. This error is fixed.
  • The Revit API 2021 has deprecated the displayUnitType in Revit 2021. So based on the Revit version the script uses displayUnitType or ForgeTypeId.
  • The LookUp node and MethodLookUp node should also work in Dynamo Sandbox or other software. So the UnwrapElement and the loading of some libraries are made conditional.
  • The MethodLookUp node now also can deal with 'overloads'. Cases were more than 1 argument series for a method is possible in the API.
  • The Example.dyn file in the Extra directory is also updated to the new functionality.

Thanks Laurin Ernst, for the feedback!

Older posts about this Dynamo Package:

dinsdag 5 mei 2020

Update IkLeerBIM Dynamo Package

Just added 2 extra nodes: API.MethodLookUp and API.FilterScriptGenerator.
And in the extra directory is also an example.dyn file for a Quick start.


The whole goal of this Package is to help people who are already familiar with Dynamo. And understand how to make a for loop in Python. So they can find their way with the (Revit) API as comfortable as possible. You can search the internet later. Most Dynamo users will come to this point where they need to build just a little Python script because there is no Node available. Or they need to speed up a Dynamo script just a little.

To do this I needed to add 2 more Nodes:

API.FilterScriptGenerator 

Will help you with your second problem: "How to grab elements from the Revit Database?" You can use the Dynamo Nodes off course. But can you do without? Now you can. And very easy. This Node will generate a complete Python Script. Copy this to clipboard, with a Node from Clockwork or Rhythm. Paste it in a Python Node. And tweak it to your needs.

API.FilterScriptGenerator

But, "The FilterElementCollector is no rocket science." I hear you say. No it isn't.
Still this Node has almost every option that the API gives us. And there are quite a few...
Beside filtering on 1 or multiple Classes or BuiltinCategories, you can Filter on all the Parameters you want. Use Views, Levels, Geometry and DesignOptions. And there is also an option so your Python Node also works for Linked documents.

Some Filter options can be achieved in multiple ways. If that is the case I tried to choose 1 or the other. I also skipped some very specialized Filters, because it is possible to also use e.g. BuiltinCategories. Most of this is documented in the Node.
And for those who know their stuff. This is not the most beautiful, clean and efficient script I ever wrote. But it works. ;-) So perhaps I will clean it up later (if I want to).


API.MethodLookUp 

Helps to find the arguments needed for a method. In al lot of cases this will be enough. And if this is still confusing you can always use google and find more examples or an explanation.
API.MethodLookUp
With Lacing Longest and some sorting and grouping.



woensdag 15 april 2020

First release IkLeerBIM Dynamo API helper (micro) Package

While writing Python code in Dynamo I still seem to use my own LookUp Node a lot. And that is despite multiple very appreciated well known tools and websites. All these work best, because a lot of people did contribute their little something. That's how this train moves. So today I want to contribute my tiny little something.




But why do I use this LookUp Node and not something else?
First of all every situation is different. And everybody works differently. But most of the time I simply do not want to leave my scripting environment. And that is Dynamo. Secondly I want to know what actually works - no surprises. And remember I am foremost a Revit user, so the way I approach a Revit problem might be slightly different than a professional programmer. And this Node is a real easy and straight forword way of working with Python in Dynamo.

Really world changing technology right? 
Ahh not exactly... It is more like a smart dir() function, with some extra. But .. it works. Simply give the Node something to chew on. And it will return all the attributes with values, all methods, all BuiltinParameters with values, the BuiltinCategory and the Class. It is possible to search, clean or even extend the outcome with readable names. I would say, give it a try. I love it, it might work for you too.



Thanks to the community who provides countless means to examine and learn new things. Parts of the code came from everywhere. Like the Clockwork Package, Dynamo Forum, The Building Coder etc. Thanks all. This is my small contribute back.


Just a few teasers on what this node does.
And remember, this Node is basically a temporary LookUp node. It is not build to use it as a part of script. But why would you. Use it to build your own Python script. Have fun.

This node eats almost everything and shows the class of the input

Just give this node a list or a single item. It will flatten everything and uses only the first index. 

It will clean the output for empty / null etc. values. Unless you want to see everything off course. 

Sometimes you simply want readable names. But most of the times you do not...


Because it slows down a little.
And if you know what you are looking for, you simply use the Case Insensitive search.

vrijdag 4 oktober 2013

Boost Your BIM verwerkt API wensen vanuit de RTC

Naar aanleiding van vragen die hij tijdens de RTC in Delft kreeg, is Harry Mattison van Boost Your BIM flink aan het werk gegaan. Op dit moment heeft hij al voor 5 vragen een oplossing met behulp van een stukje API code.

Zelf ben ik vooral gecharmeerd van Wish 2 - de mogelijkheid om alle elementen met een foutmelding tegelijk te kunnen laten oplichten. Het doet me denken aan mijn eerdere post over het verwijderen van Levels. Hierbij gaf Revit pas een uitgebreide (maar enigszins onbruikbare) foutrapportage nadat een gebruikte Level werd omgezet in een Linked Group.




En als we dan toch bezig zijn. Wat denk je van deze:
Topo From Lines – App #3 submitted to the Autodesk Port-a-thon



Goed bezig Harry!

Populaire berichten

Zoeken in deze blog