Revit_Toolkit icon indicating copy to clipboard operation
Revit_Toolkit copied to clipboard

GetCurve Method Can Throw Error

Open RichardWhitfield opened this issue 4 years ago • 1 comments

https://github.com/BHoM/Revit_Toolkit/blob/c27a9a615f07ee9eff9870be94b51360a975b22b/Revit_Core_Engine/Convert/Structure/FromRevit/Bars.cs#L65

The Revit API can throw an error when called if the analytical model contains more than one curve. Message: This AnalyticalModel contains more than one single curve.

This can be reproduced by using the element.FromRevit(Discipline.Structural) call when referencing all elelments of Revit BuiltInCategory.OST_StructuralColumns in the sample file 'rst_advanced_sample_project.rvt' which is typically found here: C:\Program Files\Autodesk\Revit 2022\Samples

Since this is a Revit API call I suggest that we just wrap this in a Try/Catch statement and log the error.

RichardWhitfield avatar Sep 27 '21 05:09 RichardWhitfield

Apologies @RichardWhitfield, I have missed this issue altogether! I will try to have a look into this at some point, but for the future, could you please add me as a default assignee for Revit-related issues? Then we can be sure it will not get lost. Thanks!

pawelbaran avatar Dec 01 '21 15:12 pawelbaran