Find View error

Hi,

I try to make area boundaries on the certain view but RIR couldn’t find a certain view and sheet. Could anyone give me advice?
Find view error

Here is python part for helping. I haven’t touch it.
Find view error.-pytjpg

Hi,
Since I can’t modify the original my post, I am adding more info.

I have tested to solve this issue but have failed.
It would be great for me if someone can give me comments about it.


In the GH side, it shows the certain view but the Find View component shows error.

Here are revit file(2020) and Gh,
FindView.gh (20.9 KB) FindView.rvt (4.7 MB)

Huh. I edited the python code of the Find View component. Copy and paste into the component and it should work

import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI') 
clr.AddReference('RevitAPIUI')

from System import Enum

import rhinoscriptsyntax as rs
import Rhino
import RhinoInside
import Grasshopper
from RhinoInside.Revit import Revit, Convert
from Autodesk.Revit import DB

doc = Revit.ActiveDBDocument

views = DB.FilteredElementCollector(doc).OfClass(DB.View).WhereElementIsNotElementType().ToElements()
if isinstance(N, str) and N:
    view_name = str(N).lower()
    for view in views:
        if str(view.Name).lower() == view_name:
            V = view
            break

if isinstance(TOS, str) and TOS:
    view_tbname = str(TOS).lower()
    for view in views:
        tbname_param = view.Parameter[DB.BuiltInParameter.VIEW_DESCRIPTION]
        tbname = tbname_param.AsString() if tbname_param else ''
        tbname = tbname.lower()
        if tbname == view_tbname:
            V = view
            break

Hi.

Thanks for your help.
It works very well with the Find View component.

There are still two issues.

  1. The Create Area Boundaries component appeared to be error after I updated your code.
    FindView.gh (23.2 KB)
  2. Is there any way to update the initial Find view component itself?
    Other Find components are not updated after I save the code.

Sorry for the bugs. Here are the updated components and script

FindView.gh (21.4 KB) Find View.ghuser (3.8 KB) Create Area Boundaries.ghuser (4.2 KB)

1 Like

Thanks a lot.

1 Like