Message 1 of 9

Not applicable
02-03-2017
03:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I have a problem when deleting a view.
I'm using this:
doc.Delete(existingView.Value().Id);
existingView.Value() will return the view and the view will have a valid Id.
The error thrown is this:
Autodesk.Revit.Exceptions.ArgumentException: ElementId cannot be deleted. Parameter name: elementId at Autodesk.Revit.DB.Document.Delete(ElementId elementId)
I saw in this post that the condition for this exception is :
The element elementId does not exist in the document -or- ElementId cannot be deleted.
Can someone shred some light on why ElementId cannot be deleted ? What could be the cause ?
I also checked the first case and the element with that id is present in the document.
I'd like to mention that this is happening only on one model ( this model belongs to a client and i cannot share it ).
Thank you in advance for your replies.
Solved! Go to Solution.