Summer is still hot and sunny.
I spent the last two weeks attempting to and succeeding pretty well at doing next to nothing.
Here are some things that cropped up anyway:
IsCreatedLocal
versus IsLocal
Last time I wrote, I mentioned the BIM 360 online hackathon and an introductory integration and partnering webinar recording.
Here is some more news and motivation for this event:
This is the fifth annual online hackathon conducted by the Autodesk App Store team, from August 1 to October 31, 2017. This year, the hackathon is dedicated to apps that use the BIM 360 API.
This hackathon is a great way to quickly climb the BIM 360 + Forge API integration learning curve with Autodesk engineers close at hand (virtually) to grow your business by integrating with BIM 360. The seven web training sessions give you a head start addressing opportunities across the entire building and infrastructure lifecycle and help you discover what you can achieve by leveraging Forge APIs with BIM 360. You don't have to take part in the hackathon to attend the webinars, but registration for the webinars is required. Sign up once for the webinar series and attend any webinar you want. All webinars will be recorded:
Registration for the BIM 360 Online Hackathon is open right now.
During the hackathon introduction webinar on August 15th, we’ll be talking about what you can do right now to integrate with BIM 360 and provide an early look at the API roadmap (i.e., programmatic access to Issues, BIM 360 UI integration, and more).
Another reason to work on BIM 360 integration sooner rather than later is we’ll be launching a BIM 360 app 'Showcase' on www.autodesk.com plus a BIM 360 app storefront in the Autodesk App Store in the next few weeks. Being present in the Showcase and the App Store BIM 360 storefront when they first 'open' is a great way to get maximum exposure for your business with Autodesk BIM 360 customers (while there are still just a few dozen apps, so you don’t risk getting lost in the crowd later, when hundreds are added).
For all new apps on the BIM 360 platform submitted to the Autodesk App Store and accepted for publication in the store, a reward of 500 USD will be given, for one eligible app per entrant.
Check out the full hackathon details including how to enter and the rules.
You don’t have to have an app in mind or even be a developer to participate in or benefit from the Hackathon. Join us to learn more about the opportunities to tap into the construction industry’s digital transformation by creating apps and seamless experiences that leverage the Forge APIs to extend BIM 360.
If you have any questions, please send an email to bim360hackathon@autodesk.com.
We recently discussed an issue related to
the BasicFileInfo
IsCreatedLocal
property outputting an unexpected value.
That was resolved by the following explanation from the Revit development team:
IsCreatedLocal
is currently used in the Revit Server workflow.
If a local model is created by the RevitServerTool
command line tool, the IsCreatedLocal
property in BasicFileInfo
is true.
The properties IsCreatedLocal
and IsLocal
are mutually exclusive – when IsCreatedLocal
is true, IsLocal
is actually false.
To safely determine whether a model is local, API users can use the following:
IsCreatedLocal || IsLocal
Another sweet and short solution was achieved in the Revit API discussion forum thread on getting the height of a building:
Question: This seems simple enough, but is there an easy way to get the total height of a building?
Answer: Sure there is.
The Building Coder samples provide a method to get the entire model extents.
It calls the get_BoundingBox
method generated by
the BoundingBox property on
all elements in the model and aggregates their results.
You can easily adapt that to your needs.
An enhancement to the FamilyBoundingBox add-in to determine a family's extents leads to another bounding box related topic.
It is based on Kevin @kelau1993 Lau's solution to determine the bounding box of a family in the family document environment presented in the Revit API discussion forum thread on family bounding box in family document.
Here is the full description of the update in Kevin's own words:
I updated the code to compute the family definition bounding box to take into account all nested family instances in addition to the GeomCombinatiom
and GenericForm
elements.
Previously, nested family instances were ignored.
A family instance requires going through the geometry to get a tighter bounding box.
The result of calling get_BoundingBox
directly is really loose for some reason.
I looked through these sites for reference:
I also tried using this:
familyInstance .get_Geometry(options) .GetTransformed( familyInstance.GetTransform() )
However, the result was inaccurate.
Here is a sample family importnest.rfa:
It contains a GeomCombination
at the top left consisting of a void and a solid extrusion.
The rest of the geometries are nested family instances.
Notice that with the new code, the bounding box grows to include the FamilyInstances.
Here are the results in the debugger:
Old:
New:
My images don't really show that the bounding box is right for the FamilyInstances, though. I don't know if there is a better way to get the coordinates of a vertex other than this method. You can verify the bounding box by calculating it in the UI. My way is to just place ReferencePlanes and snoop the coordinates with RevitLookup. One option to display them would be to create ReferencePlanes surrounding the bounding box in the different views or just create an Extrusion or something occupying the space of the bounding box.
Kevin's new code is integrated into the FamilyBoundingBox add-in release 2017.0.0.1.
Many thanks to Kevin for sharing this!