Align causing lock up and fatal error

I set the align distance to 3 ft, and now it locks up when rebuilding the preview. It caused a fatal revit error too. This is the log:

2023-06-06 14:09:22.8802|FATAL|pollination_logger|System.NullReferenceException: Object reference not set to an instance of an object.
   at Pollination.Revit.Utilities.DocumentUtils.GetFilePath(Document doc)|System.NullReferenceException: Object reference not set to an instance of an object.
   at Pollination.Revit.Utilities.DocumentUtils.GetFilePath(Document doc)
2023-06-06 14:09:26.4048|DEBUG|pollination_logger|& "C:\Program Files\pollination_revit\python\Scripts\dragonfly.exe" edit align --output-file "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp92F4.tmp" --distance 3ft "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp9400.tmp" "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp93DF.tmp"|
2023-06-06 14:09:39.3743|DEBUG|pollination_logger||
2023-06-06 14:09:39.4525|DEBUG|pollination_logger|& "C:\Program Files\pollination_revit\python\Scripts\dragonfly.exe" translate model-to-honeybee "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp92F4.tmp" --folder "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\vnnplnnb.xqd" --bypass-adj-check|
2023-06-06 14:09:45.0462|DEBUG|pollination_logger||
2023-06-06 14:09:46.5490|DEBUG|pollination_logger|& "C:\Program Files\pollination_revit\python\Scripts\honeybee-display.exe" model-to-vis "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp8CAA.tmp" --output-file "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\sboomh4m.d3w\e72299d4-b3c1-4a58-8e7c-c22f45f380e2.html" --room-attr display_name --text-attr --output-format html|

Hi @crduggin!

Thank you for sharing the logs. This should just simply fail but it is probably because of this null Object reference.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Pollination.Revit.Utilities.DocumentUtils.GetFilePath(Document doc)|System.NullReferenceException: Object reference not set to an instance of an object.
   at Pollination.Revit.Utilities.DocumentUtils.GetFilePath(Document doc)

Can you share this file with us? "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp8CAA.tmp" - You can send it to me in a private message or in an email.

Do you want the full log file or the model or both? There are a bunch of those null object references in the log.

1 Like

If you can share both, then my answer is always both! That way we can replicate the error and fix it. :slight_smile:

Hi @crduggin - Thank you for sharing the input file. I think I figured out what is going on.

  1. The alignment command works as expected and generates the new version of the file. I can open the adjusted file in Rhino.

  2. The visualization code struggles to create the visualization from this model because there is a room (STORAGE 1720) that is translated to a single line after the alignment. :smile: I imagine this is because the width of the room is less than 3 ft. @chriswmackey, we should add an automated check to filter these cases out.

Once, I delete that room the visualization command works as expected.

@crduggin, we will push a fix for this but until then, unselect the problematic storage room before visualization and everything should work as expected.

We need to add an additional check to remove the rooms with 0-ish areas after the alignment.

This is already there in the alignment code when we run this delete_degenerate_rooms method:

This type of alignment operation would be producing tons of garbage rooms otherwise.
Let me see if there’s some reason why this room is not being removed by this method.

Actually, there’s no straightforward way for me to understand what’s going on without the DFJSON so please send it over.

Thank you, @chriswmackey for checking this.

@crduggin, by DFJSON file, Chris is referring to these two files:

  • C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp9400.tmp
  • C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp93DF.tmp

One is the input DFJSON file and the other one is the alignment lines.

Looking at the code, I’m pretty sure that this is just a floating point tolerance issue and so I have put together a PR that I think will address this case by using the Model tolerance instead of absolute floating point tolerance:

Once I get the DFJSON and I can test it, I will merge it into the codebase if it fixes the issue.

Also, @mostapha , it’s a little concerning that the VTK visualization code gets stuck in an endless loop whenever there is a degenerate geometry. I am sure that not all HBJSONs that we want to preview in the viewer will have the benefit of having passed through a check for degenerate rooms. Can you get the visualization code to fail more gracefully for this case instead of looping endlessly? I feel like it should ideally proceed with producing the visualization and just report that one of the rooms could not be rendered.

1 Like

Agreed! I will have a look and see where this is happening and probably ignore these rooms so the viewer works even if there are degenerated rooms.

1 Like

Thanks all. I’ll get those files to Mostapha shortly.

1 Like

Thanks, @crduggin ,

I just checked and the new command now removes the degenerate Storage 1720 Room:

So I merged the fix and it should be available with the next installer.

As a side note, I feel like 3 feet is probably too large of an alignment distance for this model since I can see that it results in overlapping Rooms:

Something like 1 or 1.5 feet is probably better for getting rid of the columns without collapsing Rooms on top of eachother.

Gotcha. I had been using like 2 ft. I was struggling to get it to work, so I increased it to see whether anything changed. I think my issue was mainly with me not creating the selection set right in revit though. I tried making two separate align lines for either side of the bathrooms and column there, so it wouldn’t collapse. I’m not sure why the walls are difference right there from the rest of the floor. Thanks @chriswmackey .

I’m still not seeing the align work for some reason.

Hmm. That’s strange! @crduggin, if you can send us the input files, we can recreate the case on our end and tell you what’s happening. I know that you sent me the Revit file, but it is easier if you can send us the temp files that are generated on your end. From the screenshot, I can see that @chriswmackey is getting a much better results on his end.

If you run the visualization command and check the logs you should see a command that starts with "C:\Program Files\pollination_revit\python\Scripts\dragonfly.exe" edit align. The full command will look like something like this one.

"C:\Program Files\pollination_revit\python\Scripts\dragonfly.exe" edit align --output-file "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp92F4.tmp" --distance 3ft "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp9400.tmp" "C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp93DF.tmp"

We will need the two files after --distance 3ft to be able to recreate the case on our end. In the example above they are:

  • “C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp9400.tmp”
  • “C:\Users\Cory.Duggin\AppData\Local\Temp\fa51ecfb-6965-44af-97b7-1babaa64d111\tmp93DF.tmp”

I expect them to be a different name when you re-run the command, but the pattern should not change. Let me know if you have any questions.

Hi, @crduggin - did you figure this out? Let us know if you need any further help with this.

No, I just haven’t had time to get back to it yet. I’ll let you know.

1 Like