Meaningful Error Messages through API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Making a post looking for clarification of information. For context - I have seen this Idea posted but it seems to apply to Revit as a whole rather than being API specific - https://forums.autodesk.com/t5/revit-ideas/meaningful-error-messages/idi-p/6338222
On to my point, is there any way to extract more meaningful information from errors through the API? For example, I'm currently trying to work out an issue with a family I am trying to insert an instance of through the API. The family is not really unconventional, it's a family that has some nested components. I'm using a process that has worked well for me in the past. But, I'm getting the error message shown in the attached screenshot "Cannot make Type". Fine, I'm familiar with this error, I commonly see it when a value for a parameter I'm entering causes issues within the family, usually being too small since we work with a lot of small elements (aware of Revit's 1/32" rule). But here's where my frustrations begin. I go through my code as we step and examine each value I'm passing into parameters into the Family and everything seems to line up. My next step is to insert the family into a project manually and fill out the dimension parameters manually to try and find the offending value/parameter combo. Alas, I put in my values, and it works just fine. At this point, I'm stuck with a very unhelpful error message.
So the crux of the thread, is there anyway to obtain any meaningful info from this error message (and similar messages)? Yes, I'm sure I'm missing something in my code, but considering issues like this don't appear until you commit a transaction. I'm left with no exceptions in my code to guide me or any other info other than "Object can't work!". So having an error message that was more than just "can't make type' even if just a little more, would go a LONG way.