I’ve just encountered a bug in the conversion of Spaces in the Revit connector. Issue is that conversion fails in the indicated line when a zone is not specified. This gives the well-known but unclear 'object not set to an instance of an object' error. I’m not a Revit expert, but I think it should be possible to send Spaces without a Zone, as also Revit doesn’t have issues with undefined zones. Or at least, it should give a clear error when the zone is missing.
By commenting the line, I was able to convert and send all Spaces. Receiving them (updating in this case), seems to work fine, also without the zones.
Additionally, a bit off-topic, I wasn’t able to properly debug the ConvertSpace.cs in Visual Studio as it didn’t hit my breakpoints for some reason, maybe because it’s in the shared ConverterRevitShared project and not the ConverterRevit2021 project that was being debugged (?). Anyway, if you have any clue on this, some advice would be much appreciated!
Thanks for reporting this bug and looking into it to find the cause! That’s awesome. If you’re feeling bold, you could just add a null check (changing the line to speckleSpace.zoneName = revitSpace.Zone?.Name should work just fine) and make a PR.
If not that’s fine, I can get around to it.
In terms of the debug issue, that is a common one that I need to add in the readme or something. You need to debug the CONNECTOR, not the converter, for whichever version of Revit your are using or your breakpoints won’t hit. Just right-click on the connector version that you’d like to debug and set it as the startup project
I checked the solution and that indeed works, easy and elegant way to fix it. I’m not so familiar with C# so didn’t know it was this simple. Also managed to get the debugging working after changing some additional settings, and debugging the connector instead of the converter
I reported the issue on Github (see below) and was trying to push the solution. However, I can’t push my newly created branch and can also not create one on Github directly, so probably I don’t have permission for that?
Believe I will need to be added as contributor to your speckle-sharp repo to make the PR. For us at least, this small fix is very valuable. Would also be easy in the future if I encounter more of these small bugs.
Yeah we don’t allow anyone who isn’t employed by Speckle to push branches or commits directly to our repo for security reasons. You can definitely create a fork and submit a PR from there. Github has a guide on how to contribute to open source projects that you can follow! Git stuff can be really confusing so let me know if you have any questions and I’ll try to help
That is perfect! The circleCI doesn’t run for PRs by external contributors so that’s nothing to worry about. I just merged it in (this is definitely the simplest PR I’ve ever merged haha). However, we aren’t planning on making another release until end of the end of the month. I’ll try to see if we can make a hotfix and release a version 2.10.4 with this change and let you know