Wednesday, March 11, 2020

Revit Lookup


Introduction:

1. Revit lookup helps in the exploration of the Revit document.
2. One can look into geometrical properties (bounding box), location, material properties, element hierarchical data such as it's Family, FamilySymbol, type of element (structural/ architectural/electrical), category, parameters that define instance/type properties.
3. 90% of the time I used Revit look up, it is so essential to understand how one can use API to get the required information.

In this post, we will discuss, what kind of information we can get from Revit lookup.
And I will mention some use cases from my previous experience.

Installation:

Download the installer, it will place both add-in and dll files in addins folder of Revit: 

Notes:

1. Revit Lookup is placed under the Add-Ins menu.
Once pressed the tab "Revit Lookup", it will expand and there will be multiple options to choose from.
To get information related to the document, select "Snoop DB" 
To get information related to an element, select "Snoop Current Selection"

Figure : (A)                               Figure : (B)

Selection and What information they provide?

(a) "Hello, World" - Gives the location of the Revit Lookup library(.dll) present in the system.

(b) "Snoop DB" - Gives the information related to the currently opened document.
It includes all :
- System families present in the document.
- External families present in a document
- Family Instances, Family types/symbols
- Views (project, system),  View families (Ceiling Plan, Floor Plan, Schedule)
- If the current document is a family document, there will be no views or other systems family.
It contains the number of extrusions/void elements depending upon the complexity of the family.
It contains geom-combination which represents the geometry of the family

(c) "Snoop Current Selection" - Gives information about selected eleemet.

I have created a Wall from System family. Family: Basic Wall, Type - Wall1
I will use these to snoop its properties.

Bounding Box - Represent the 3d box around an element. It gives diagonally opposite corners -  minimum and maximum points.

  • Category -  Represent the category of an element.
  • Geometry - Gives geometric representation of elements such as edges, faces, etc.
  • Id - Element Id
  • IsValidObject - Sometimes if the element gets deleted while some processing but we may still have element object and all its internal information is corrupted, in such case one can use whether the object is valid or not to process further else it will throw an exception while processing such elements.



    Figure : (C)  


  • Level Id - It gives the current Level's Id.
  • Location - It gives a location curve which contains information such as location point, curve, and rotation.
  • Parameters - It provides the instance/type parameters. They represent properties of instance/type.
  • for example Family, FamilyName, Category, Area, etc.
  • Parameters Map - I have never really used it. I don't really see the difference between Parameters and ParametersMap but most reliable is Parameters. Information will be the same in both but more consistent in Parameters.
  • UniqueId - Represent unique identifier of element.

    Figure : (D)  


  • GetOrderedParamters - It also provides the parameters same as Parameters field.

  • In this case, we have a Wall from family Basic Wall and type is Wall 1.
  • System family has its own family type/symbol such as WallType.
  • If we load a family into a document and created instance out of it then we have an element in the document. The element is FamilyInstance, its type would be FamilySymbol in terms of API but in case of system families we cannot cast elements type to FamilySymbol, instead, we can cast it to WallType if is a wall. At least it is true for the Wall family element as I observed.
  • GetTypeId - These provide the type id of the currently selected wall.
  • GetValidTypes - List all valid types belongs to selected elements Family.
    
                                                                    Figure : (E)  Represent Valid types for Wall family
  • WallType - If it were not a system family, then it would have been a little different. Instead of WallType, there would be the Family Symbol field. In both cases, it indicates the Type of family instance/element. If we select WallType, then we will be able to see the properties of WallType. Again the fields will be the same as the above fields, some fields would be additional in WallType window.
      • So RevitLook gives information in a hierarchy.
      • first is instance properties, second is type properties, third is family properties
      • System family properties would not be visible, but external loaded family properties would be visible.


Figure : (F)  Wall, Family Symbol/Type Properties


Figure : (G) Hierarchy Family Instance, symbol/type, family
*Family properties not visible in Revit Lookup for System family (from observation)


Figure : (H) Hierarchy Family Instance, symbol/type, family
*Family properties are visible in Revit Lookup for Externally family (from observation)


(D) "Snoop Active View"- These provide the current view information. Such as View3D/ViewPlan(sheet/2d views)  information. Both belongs to category Views.
In View3D, important fields are:
GetOrientation - Gives the Eye Position, ForwardDirection and UpDirection values in terms of vector. These values change if View3D changed from top, front, botttom, eight, left or any other possible orientation. These values can be used forgenerating views (iso, front, top views) for assembly.

(E) "Snoop Application" - Provides infomation related to active document, actyually application wide properties.

(F) "Search and Snoop" - Elements can be search and snoop using their ElementId and UniqueId.


Thanks!

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home