- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I get the following error when attempting to programatically hide a group. I can hide a group manually so I don't understand why this wouldn't work.
This is my code (which works for other types of elements...just not groups):
view.HideElements(m_elemSet);
Here is the error:
Autodesk.Revit.Exceptions.ArgumentException was unhandled by user code
HResult=-2146233088
Message=One of the elements cannot be hidden.
Parameter name: elementIdSet
Source=RevitAPI
ParamName=elementIdSet
StackTrace:
at Autodesk.Revit.DB.View.HideElements(ICollection`1 elementIdSet)
at DADY.HideInViews.HideInViewsForm.btnOK_Click(Object sender, EventArgs e) in Q:\CADcoop\source\CADdaddy Tools for Revit 2014\CADdaddy Revit Tools Application\HideInViewsForm.cs:line 180
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at DADY.HideInViews.Command.Execute(ExternalCommandData cData, String& msg1, ElementSet elems) in Q:\CADcoop\source\CADdaddy Tools for Revit 2014\CADdaddy Revit Tools Application\HideInViews.cs:line 54
at apiManagedExecuteCommand(AString* assemblyName, AString* className, AString* vendorDescription, MFCApp* pMFCApp, DBView* pDBView, AString* message, Set<ElementId\,std::less<ElementId>\,tnallc<ElementId> >* ids, Map<AString\,AString\,std::less<AString>\,tnallc<AString> >* data, AString* exceptionName, AString* exceptionMessage)
InnerException:
Solved! Go to Solution.