Journal Magic, Adjacent Rooms and Room Boundary

Taking a look at journal files, room boundaries, adjacent rooms, a ForgeTypeId question and one view of where AI might lead:

Harry's Journal File Magic

Boost Your BIM by Harry Mattison published a nice series on journal file magic and exporting groups to file. To be precise, it consists of three instalments:

Many thanks to Harry for implementing and sharing this useful and educational solution.

Closed Contiguous Room Boundary Loop

Loren Routh of GSA presents a quick and easy method to reliably retrieve a closed contiguous boundary loop for a room using GetRoomBoundaryAsCurveLoopArray from the ExporterIFC module in his answer to creating a generic model from area boundaries:

This just in: I tried the GetRoomBoundaryAsCurveLoopArray method, and it totally worked! You need to import the ExporterIFC module, etc. This method eliminated a chunk of code, no sorting or extracting the curves. It let me create an extrusion (manually) with no errors at all! As you can see by the pic below, this was not a rectangle. Definitely has my vote to be included in the regular Revit API. Now to make it work with Generic Models...

  import clr
  clr.AddReferenceToFileAndPath(r'C:\Program Files\Autodesk\Revit 2023\AddIns\IFCExporterUI\Autodesk.IFC.Export.UI.dll')
  clr.AddReference("RevitAPIIFC")
  from Autodesk.Revit.DB.IFC import ExporterIFC
  from Autodesk.Revit.DB.IFC import ExporterIFCUtils

  opt = DB.SpatialElementBoundaryOptions()

  curve_loop = ExporterIFCUtils.GetRoomBoundaryAsCurveLoopArray(selected_area, opt, True)

  with DB.Transaction(doc, "Create Model Lines") as tx:
    tx.Start()

    sketch_plane = DB.SketchPlane.Create(doc,selected_area.LevelId)

    for loop in curve_loop:
      for line in loop:
        crv = doc_create.NewModelCurve(line, sketch_plane)

    tx.Commit()

GetRoomBoundaryAsCurveLoopArray

Many thanks to Loren for sharing this valuable hint.

Challenges Identifying Adjacent Rooms

Ilia Krachkovskii shared some thoughts and challenges identifying adjacent rooms

I'm currently working on a so-called "Spatial Breakdown System" that identifies location and generates corresponding location code for each element in Revit model. It will allow architects at Marco Casamonti & Partners / Archea Associati to create very flexible schedules and will help with data management inside the projects.

I have been working with Revit API for quite some time, and just recently started to understand all the complaints one can find on countless threads: so far I have 15 different methods for calculating the room (or the nearest room) for various types of elements. Here are some of them:

Code sample below is used to calculate all the rooms that are formed by (or those that are very near to) a particular wall:

Retrieve adjacent rooms

ForgeTypeId for 'Other' Parameter Group

Kevin Fielding shared a quick, easy and effective solution for replacing the Other parameter group or the BuiltInParameterGroup INVALID in his thread on Revit 2024 'Other' parameter group:

With the changeover to ForgeTypeId and GroupTypeId in Revit 2024 instead of the BuiltInParameterGroup enumerations, I just wanted to share how to define the 'Other' group for parameters, as it doesn't appear to be documented.

Whereas previously you would use

  BuiltInParameterGroup.INVALID

In 2024 and beyond you need to use

  new ForgeTypeId(string.Empty)

Other groups can be found using the GroupTypeId class, like GroupTypeId.Data.

Hope this helps others searching for this.

In fact, the same question came up again in the question on Revit 2024 GroupTypeId missing ParameterGroup Other (Invalid).

Thanks, Kevin, for clarifying this!

AI May Obsolete All Apps

Bill Gates presents an interesting vision of the future of personal computing in The future of agents – AI is about to completely change how you use computers – and upend the software industry.