- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried to hide/show element in a view but I got the error message:
"One of the elments cannot be hidden. Parameter name:elementIdSet"
I used this piece of code befor to hide show text on a view but it is not working now. The model contain links also. What is the the wrong in this code:
List<ElementId> allId = new List<ElementId>();
//I add the elementsId in allId
try
{
view = (Autodesk.Revit.DB.View)doc.ActiveView;
// ss += view.Name + "\n";
MessageBox.Show("View " + view.Name);
}
catch (Exception ex)
{
MessageBox.Show("View " + view.Name + " could not reviewed\n");
}
try
{
Transaction hide = new Transaction(doc, "Hide the elements");
hide.Start();
if(allId.Count>0)
view.HideElements(allId);
hide.Commit();
}
catch (Exception ex)
{
MessageBox.Show( "View " + view.Name + "can not be hiden \n"+ex.Message);
}
Solved! Go to Solution.