Unable to delete elementId of Dimension type

Unable to delete elementId of Dimension type

Anonymous
Not applicable
829 Views
2 Replies
Message 1 of 3

Unable to delete elementId of Dimension type

Anonymous
Not applicable

In my document there are list of unused Dimension types that Revit cannot catch in it's purge tool but I was able to delete through Revit API. The issue I'm facing now is when I hit the ElementId that belongs to specific Dimension Style Type (e.g. Angular Dimension Style, Spot Coordinates) in my list of unused, Revit will throw an error "Unable to delete ElementId". Revit not allowing to delete it unless those Dimension Style should have at least one Dimension Type that should retain within it.

Is there a way to skip that error and not try to delete it and then continue deleting my other ElementId in the list?.  

0 Likes
Accepted solutions (1)
830 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni
Accepted solution

When you say, 'throw an error', i assume you mean that an exception. is thrown.

 

If so, then yes, you can catch that specific exception and proceed with the next element id.

 

Look for '.NET try catch' to learn how to use that:

 

https://duckduckgo.com/?q=.net+try+catch

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks Jeremy yes I mean exception. got it resolve now

0 Likes