jeremytammik / RevitLookup

Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
http://thebuildingcoder.typepad.com
MIT License
1.07k stars 297 forks source link

queering dimensions throws an exception #32

Closed ksobon closed 6 years ago

ksobon commented 7 years ago

I got this when I tried to query Dimensions:

image

************** Exception Text **************
Autodesk.Revit.Exceptions.InvalidOperationException: Cannot access this method if this dimension has more than one segment.
   at Autodesk.Revit.DB.Dimension.get_LeaderEndPosition()
   at RevitLookup.Snoop.CollectorExts.CollectorExtElement.Stream(ArrayList data, Dimension dim)
   at RevitLookup.Snoop.CollectorExts.CollectorExtElement.Stream(ArrayList data, Element elem)
   at RevitLookup.Snoop.CollectorExts.CollectorExtElement.CollectEvent(Object sender, CollectorEventArgs e)
   at RevitLookup.Snoop.Collectors.Collector.CollectorExt.Invoke(Object sender, CollectorEventArgs e)
   at RevitLookup.Snoop.Collectors.Collector.FireEvent_CollectExt(Object objToSnoop)
   at RevitLookup.Snoop.Collectors.CollectorObj.Collect(Object obj)
   at RevitLookup.Snoop.Forms.Objects.TreeNodeSelected(Object sender, TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
jeremytammik commented 7 years ago

hi konrad. okay... well, the process to fix it is pretty clear. determine the code snippet throwing the exception and either avoid calling it under the problematic circumstances (better) or catch the specific exception thrown (less good, also ok). can you do that and submit a pull request with the fix, please?

ksobon commented 7 years ago

I got this when using the Lookup tool from Revit's UI. I am in no position to debug this particular issue. I know this doesn't exactly make it easy but that's all I got. These seem to be constraint dimensions and I am not sure why they are surfaced in my Revit model. I don't think I should be able to access them. Anyways. That's all I got. Sorry.

jeremytammik commented 7 years ago

can you provide a minimal RVT sample? please delete absolutely everything you can except the dimension causing the error. thx!

jeremytammik commented 6 years ago

close for now until we have a reproducible case to fix