Skip to main content
Version: v4.5

IafViewer

The IafViewer React component allows you to view a BIM model in 3D space and interact with it using a range of tools. This facility allows you to manipulate and explore 3D models using a powerful set of viewing tools and visual assists.

Figure: IafViewer interface elements

CalloutElementDescription
AViewer page iconClick to open the Viewer page
B3D viewerInteract with the model
CConfiguration paneWhen you click a tool in the toolbar, you can further configure the tool's settings in the Configuration pane.
DToolbarClick a tool to use it in the IafViewer. For more information on each tool, see IafViewer toolbar icons

IafViewer toolbar icons#

ElementIconDescription
Reset viewReset the viewer to the default coordinates.
Projection
ViewClick to select from the available views, such as front, back, top, and bottom views.
ShadingEnable and configure model shading.
NavigationSelect a navigation modality, such as pan, orbit, or walk view.
Measurement and annotationsMeasure the distance between two points and configure the measurement settings. Add annotations to the 3D model such as lines, geometrical shapes, text callouts, and graphics.
AnimationsClick to run animations. For more information, see Animations.
Cutting PlaneCut the model by a horizontal or vertical plane, either by coordinates or by point of mouse click. For more information, see Cutting Planes pane.
2D ViewerView a flat 2D representation of the model.
Focus ModeClick to zoom in and focus on the selected model element.
Viewer customizationDrag and drop the tools you want to appear in the toolbar for a given setting.
SettingsConfigure the general and effect settings.
Visibility utilitiesIsolate selected model elements, hide the selection, or show all model elements. This option does not appear in the toolbar by default; to enable it, from the toolbar, click the Settings icon, then enable Utilities.
Model compositionCompose which parts of the model you want to load to optimize loading times for your use-case. For more information, see Model composition.

React component#

For more information on installing, importing, and configuring the IafViewer React component, see IafViewerDBM component.

Utility function commands#

For more information on utility functions for the IafViewer component, see IafViewer commands.

Model composition#

2D and 3D file destructuring#

Prior to 4.3, Revit-derived projects were comprised of a single 2D file and a single 3D file. After the release of 4.3, Revit-derived projects are now comprised of an array of linked files. This change means that load times are now optimized. Segmenting the project into multiple 3D and 2D files allows the user to configure which parts of the model to load for their use-case.

Model Composition pane#

The Model Composition pane comprises the Compose On Demand and Designer View sections. Use the Compose On Demand section to configure which parts of the model to load, and use the Designer View section to view the source Revit project files and track which of the linked models are loaded and visible and which are not.

Figure: Model Composition pane

Compose on Demand configurations#

In the Compose On Demand section you can configure which parts of the model render, either by range in feet or by discipline, such as Structural and Electrical. You can also enable Auto Compose, which automates the composition.

The distance in feet allows the viewer to loading of segment / view / linked model if the linked model lies within the specified viewing range in feet. One import thing to note here is that Distance in Feet is used on segmented models for the decision making and not on individual assets in the model.

Loads linked model segments that are within the specified viewing range measure in feet.

UI elementDescription
Auto ComposeEnable to leave the model composition decision-making to the IafViewer and Graphics Service based on view parameters such as view position and the user's enabled disciplines, such as Structural and Electrical.
Distance in FeetSet the range in feet that you want the viewer to load the model.
StructuralEnables structural elements
ArchitecturalAlways enabled
MechanicalEnables mechanical elements
ElectricalEnables electrical elements
PlumbingEnables plumbing elements
OthersEnables all other unlisted disciplines

Designer View#

Use the Designer View section to view how the original Revit project is structured in the Autodesk Revit Project as linked files. Track which of the linked models are loaded and visible and which are not.

Cutting Planes pane#

Focused Planes#

Use the Focused Planes section of the Cutting Planes pane to build a cutting plane box of a given size around the selected element or asset. As well as providing more efficient loading times, you can use cutting planes to quickly make visible a selected element that is obscured from view by other elements in the model.

Figure: Cuttings Planes pane

UI elementDescription
SizeSets the size of the cutting plane box around the selected element or asset
Change FocusChanges the active selection subject in order to update the focused plane box

Figure: Example where model elements obstruct view of selected element

Figure: Example of focused planes revealing selected element

Annotations and measurement pane#

Use the Annotations and measurement pane to measure the distance between two points, as well as add annotations to the 3D model such as lines, geometrical shapes, text callouts, and graphics. You can export and import annotations.

Figure: Annotations and measurement pane

UI elementNameDescription
Check DistanceMeasures the distance between two nodes you click.
LineClick in the viewer to set first node, then the second click completes the line. Press the Escape key to cancel.
CircleClick in the viewer where you want the circle's centre, then drag to enlarge the circle. Release the mouse click to complete the circle.
RectangleClick in the viewer where you want the upper-left corner of the rectangle, then click where you want the bottom-right corner to complete the shape.
PolylineClick in the viewer to set first node, then continue to add nodes. Right-click to complete the polyline.
PolygonClick in the viewer to set first polygon point, continue to add points, then right-click to auto-complete the final point.
Leader NoteCreates a callout with text that points to a location. Click in the viewer to set the pointer, then type in the text box. Press the Shift and Enter keys to add a new line.
Text
FreehandClick to start, drag the mouse to draw the freehand sketch, then release the mouse click to complete.
SpriteAdds a graphic annotation using an image URL. Click in the viewer where you want the image, then in the text box, paste the image URL. Click outside the text box to complete. You can use png and gif files.
ExportExports your annotations.
ImportImports exported annotations.
Repeat LastRepeats the previous annotation
Show AllShow or hide all annotations
Enabled AllEnable to select any annotation and move it or edit its properties. Disable if you are navigating the model and don't want the annotations to be editable.
Delete AllDeletes all annotations

Annotations examples#

CalloutName
ASprite
BRectangle
CCircle
DLine
ELeader Note
FPolyline
GPolygon
HText
IFreehand

Edit annotations panes#

You can edit any annotations in the viewer by clicking the annotation and editing the configuration in the panel.

Text edit pane#

You can change the text font, the text fill color and opacity, the text stroke color and thickness. There are also toggles to display or hide the text annotation, focus the viewer on the annotation, or make the annotation selectable or not.

Figure: Text annotations edit pane

Geometry edit pane#

For geometry shapes, you can change the stroke color and thickness, as well as the fill color and opacity. There are also toggles to display or hide the geometry annotation, focus the viewer on the annotation, or make the annotation selectable or not.

Figure: Geometry annotations edit pane

Animations#

You can layer various animations over 2D drawings in the IafViewer by passing a workflow prop that contains your workflows with animation scripts, which can animate model elements, graphics, and annotations.

Figure: Live animations workflow example

For more information on creating animation scripts and defining the workflow prop, see Animations.

Grid Helpers#

The Grid Helper feature in the IafViewer helps with spatial understanding of a 3D project layout by adding visual reference grids and axes to the scene. These visual tools help users with more effective navigating, aligning, and analyzing of 3D models.

Figure: Grid Helper visual references

Grid Helper pane#

The Grid Helper features are controlled in the Grid Helper pane which is accessed via the Settings icon.

Figure: Grid Helper pane

In the Grid Helper pane, use the Rectangular Grid option to toggle the display of a rectangular grid of lines on the ground plane, aiding in alignment and measurements.

The Axes as Lines option enables traditional 2D axis representation, while the Axes as 3D Poles option provides vertical references in the scene.

The Size in Meters and Step Size in Meters sliders allow customization of the grid's overall dimensions and spacing, making it adaptable to projects of different scales.

React selection handling#

Selection handling refers to the handling of element click events in the IafViewer. To enhance React best practices, promote a more reactive data flow, and provide a more maintainable and efficient codebase, from platform v4.3 and later, implement the React selection handling enhancements.

Callback mechanism#

Any selection directly made within the IafViewer component triggers a callback to the application, passing the selected elements for processing. This ensures a more reactive response to user interactions and follows the principles of one-way data flow in React.

React selection handling workflow#

  1. User Interaction in IafViewer: In the IafViewer component user interface, a user makes element selections.
  2. Callback to application: Upon a selection event, the IafViewer component sends a callback to the application, providing details about the selected element.
  3. Application Response: The application receives the callback and processes the selected element, ensuring one-way data flow.

Note: For more information on using the IafViewer React component refer to the IafViewer page in the APIs section.