# CAD Views

## Overview

The term “CAD Views” in HOOPS Visualize Web refers to a particular representation of a 3D-scene defined by the aggregate of the following states:

- Camera
- Cutting planes
- Entity visibility
- Entity color
- Entity position

A CAD view will often be associated with various PMI elements denoting model dimensions or other properties with parts not relevant to the current view hidden. A series of CAD Views could also comprise a work-instruction by moving parts to different locations and adding text labels and other information for each step.

CAD Views are either imported from CAD models via Converter or can be authored directly via libsc or in the HOOPS Web Viewer.

Example of a CAD View that activates a specific camera and cutting plane and enables various PMI elements.

Each CAD View is referenced via a nodeid. To query all CAD Views in a model you can use the function getCADViews which returns a map associating the name of the CAD View with its id.

        hwv.model.getCadViewMap();

Result for landinggear contained in the package:

- 427: “__STARTING VIEW NOTES # Annotation View”
- 429: “__MAIN VIEW # Annotation View”
- 431: “__MAIN SECTION # Annotation View”
- 433: “__FRONT AXLE SECTION # Annotation View”
- 435: “__UPPER AXLE SECTION # Annotation View”
- 437: “__REAR AXLE SECTION # Annotation View”
- 439: “__SIDE FIXING SECTION # Annotation View”
- 441: “__SIDE BOX # Annotation View”
- 443: “__RIB HOLE SECTION # Annotation View”
- 444: “INITIAL”
- 445: “MAIN SECTION”
- 446: “FRONT AXLE SECTION”
- 447: “UPPER AXLE SECTION”
- 448: “REAR AXLE SECTION”
- 449: “SIDE FIXING SECTION”
- 450: “SIDE BOX”
- 451: “RIB HOLE SECTION”
- 452: “MAINVIEWFULLPMI”
- 453: “TS3D LOGO”
- 454: “STARTING VIEW NOTES”

## Activating a CAD view

To activate a CAD view via the HOOPS Web Viewer UI, simply switch to the Views tab in the Model Tree UI and activate the desired CAD View.

To activate a specific CAD view programmatically, simply pass its `nodeId` to the `activateCadView` function as seen below. If the CAD View contains a camera definition the camera of the scene will transition to its new location as soon as this function is called and all entities will be set to the various states listed above (visibility, color, position). The second parameter of this function defines the transition time to the new camera in milliseconds.

        hwv.model.activateCadView(449);

## Creating a new CAD view

You can create a new CAD view from scratch in the HOOPS Web Viewer with the `createCadView` function though you are responsible for saving those CAD Views when the viewing session ends. Creating your own CAD Views in the client is an advanced topic we will not be discussing here in detail. If you simply want to store a specific camera orientation and assign redline and other markup elements to it we suggest using the markup manager discussed in the Markup Basics Programming Guide for that purpose.

        hwv.model.createCadView(hwv.model.getAbsoluteRootNode(), "New View", hwv.view.getCamera());

## Other considerations

CAD Views permanently change the state of various entities and will override any manual attribute changes performed on the model via the HOOPS Visualize Web API. To reset the model to its original state you can use the reset function.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...