RVTDocs.com
Namespace: Autodesk.Revit.DB

View

Class
Description:
Base class for all types of views in Autodesk Revit.
Remarks:
A view can display an image produced from a Revit model. Views can be graphical (e.g. plans, elevations, or 3D views) or textual (e.g. schedules). Views keep track of Elements that can be seen in them.
Syntax
public class View : Element
Examples
private void Getinfo_View(Autodesk.Revit.DB.View view)
{
    string message = "View: ";

    //get the name of the view
    message += "\nView name: " + view.Name;

    //The crop box sets display bounds of the view
    BoundingBoxXYZ cropBox = view.CropBox;
    XYZ max = cropBox.Max; //Maximum coordinates (upper-right-front corner of the box).
    XYZ min = cropBox.Min; //Minimum coordinates (lower-left-rear corner of the box).
    message += "\nCrop Box: ";
    message += "\nMaximum coordinates: (" + max.X + ", " + max.Y + ", " + max.Z + ")";
    message += "\nMinimum coordinates: (" + min.X + ", " + min.Y + ", " + min.Z + ")";


   //get the origin of the screen
    XYZ origin = view.Origin;
    message += "\nOrigin: (" + origin.X + ", " + origin.Y + ", " + origin.Z + ")";


    //The bounds of the view in paper space (in inches).
    BoundingBoxUV outline = view.Outline;
    UV maxUv = outline.Max; //Maximum coordinates (upper-right corner of the box).
    UV minUv = outline.Min; //Minimum coordinates (lower-left corner of the box).
    message += "\nOutline: ";
    message += "\nMaximum coordinates: (" + maxUv.U + ", " + maxUv.V + ")";
    message += "\nMinimum coordinates: (" + minUv.U + ", " + minUv.V + ")";

    //The direction towards the right side of the screen
    XYZ rightDirection = view.RightDirection;
    message += "\nRight direction: (" + rightDirection.X + ", " +
                   rightDirection.Y + ", " + rightDirection.Z + ")";

    //The direction towards the top of the screen
    XYZ upDirection = view.UpDirection;
    message += "\nUp direction: (" + upDirection.X + ", " +
                   upDirection.Y + ", " + upDirection.Z + ")";

    //The direction towards the viewer
    XYZ viewDirection = view.ViewDirection;
    message += "\nView direction: (" + viewDirection.X + ", " +
                   viewDirection.Y + ", " + viewDirection.Z + ")";

    //The scale of the view
    message += "\nScale: " + view.Scale;
    // Scale is meaningless for Schedules
    if (view.ViewType != ViewType.Schedule)
    {
        int testScale = 5;
        //set the scale of the view
        view.Scale = testScale;
        message += "\nScale after set: " + view.Scale;
    }

    TaskDialog.Show("Revit",message);
}
View Class Members:
Name Description Inherited From
AnalysisDisplayStyleId Element id of Analysis Display Style associated with the view.
AreAnalyticalModelCategoriesHidden Indicates if analytical model categories are currently hidden in the view.
AreAnnotationCategoriesHidden Indicates if annotation categories are currently hidden in the view.
AreCoordinationModelHandlesHidden Indicates if Coordination Model handles are currently hidden in the view.
AreImportCategoriesHidden Indicates if import categories are currently hidden in the view.
AreModelCategoriesHidden Indicates if model categories are currently hidden in the view.
ArePointCloudsHidden Indicates if point clouds are currently hidden in the view.
AssemblyInstanceId The id of the assembly instance to which the element belongs. (Inherited from Element ) Element
AssociatedAssemblyInstanceId The Id of the assembly instance that owns the assembly view.
BoundingBox Retrieves a box that circumscribes all geometry of the element. (Inherited from Element ) Element
CanBePrinted Test whether the view can be printed.
Category Retrieves a Category object that represents the category or sub category in which the element resides. (Inherited from Element ) Element
CreatedPhaseId Id of a Phase at which the Element was created. (Inherited from Element ) Element
CropBox The Crop Box applied to the view, or an outline encompassing the crop region applied to the view.
CropBoxActive Whether or not the Crop Box/Region is active for the view.
CropBoxVisible Whether or not the Crop Box/Region is visible for the view.
DemolishedPhaseId Id of a Phase at which the Element was demolished. (Inherited from Element ) Element
DesignOption Returns the design option to which the element belongs. (Inherited from Element ) Element
DetailLevel The detail level of this view.
Discipline The Discipline of the view.
DisplayStyle The DisplayStyle of the view. Returns DisplayStyle.Wireframe if the view has no display style.
Document Returns the Document in which the Element resides. (Inherited from Element ) Element
GenLevel The level for the view.
Geometry Retrieves the geometric representation of the element. (Inherited from Element ) Element
GroupId The id of the group to which an element belongs. (Inherited from Element ) Element
Id A unique identifier for an Element in an Autodesk Revit project. (Inherited from Element ) Element
IsAssemblyView Indicates if the view is assembly view.
IsCallout Indicates if the view is a callout view.
IsModifiable Identifies if the element is modifiable. (Inherited from Element ) Element
IsTemplate Test whether the view is a view template.
IsTransient Indicates whether an element is transient or permanent. (Inherited from Element ) Element
IsValidObject Specifies whether the .NET object represents a valid Revit entity. (Inherited from Element ) Element
LevelId The id of the level associated with the element. (Inherited from Element ) Element
Location This property is used to find the physical location of an element within a project. (Inherited from Element ) Element
Name A human readable name for the Element. (Inherited from Element ) Element
Origin Returns the origin of the screen.
Outline The bounds of the view in paper space (in feet).
OwnerViewId The id of the view that owns the element. (Inherited from Element ) Element
Parameter[BuiltInParameter] Retrieves a parameter from the element given a parameter id. (Inherited from Element ) Element
Parameter[Definition] Retrieves a parameter from the element based on its definition. (Inherited from Element ) Element
Parameter[Guid] Retrieves a parameter from the element given a GUID for a shared parameter. (Inherited from Element ) Element
Parameters Retrieves a set containing all of the parameters that are contained within the element. (Inherited from Element ) Element
ParametersMap Retrieves a map containing all of the parameters that are contained within the element. (Inherited from Element ) Element
PartsVisibility The visibility setting for parts in this view.
Pinned Identifies if the element has been pinned to prevent changes. (Inherited from Element ) Element
RevealConstraintsMode Indicates whether the Reveal Constraints mode is activated in the view.
RightDirection The direction towards the right side of the screen.
Scale The scale of the view.
ShadowIntensity The intesity of cast shadows - 0 = no shadows, 100 = black.
SketchPlane The sketch plane assigned to the view for model curve creation.
SunAndShadowSettings The sun and shadow settings assigned to the view for shadow calculation and rendering.
SunlightIntensity The intensity of the simulated (directional) sunlight. 0 = no directional light; maximum value is 100.
TemporaryViewModes Data of temporary view modes associated with this view.
Title The view title. This consists of the view name plus other modifiers, such as the view type, sheet number, area scheme, and/or assembly type, depending on the specifics of the view.
UniqueId A stable unique identifier for an element within the document. (Inherited from Element ) Element
UpDirection The direction towards the top of the screen.
VersionGuid Get the element version Guid. (Inherited from Element ) Element
ViewDirection The direction towards the viewer.
ViewSpecific Identifies if the element is owned by a view. (Inherited from Element ) Element
ViewTemplateId The id of the template view that controls this view's parameters.
ViewType The type of the view.
WorksetId Get Id of the Workset which owns the element. (Inherited from Element ) Element
Name Description Inherited From
AddFilter Adds a filter to the view.
AllowsAnalysisDisplay Identifies if this view allows display of Analysis results.
ApplyViewTemplateParameters Applies to this view the parameters of the input view that are not controlled by the current view template.
AreGraphicsOverridesAllowed Determines if Visibility/Graphics Overriddes can be applied to the view.
ArePhasesModifiable Returns true if the properties CreatedPhaseId and DemolishedPhaseId can be modified for this Element. (Inherited from Element ) Element
CanApplyColorFillScheme Checks if the id can be applied as the scheme id of specified category to this view.
CanBeHidden Indicates if the element can be hidden in the view. (Inherited from Element ) Element
CanBeLocked Identifies if the element can be locked. (Inherited from Element ) Element
CanCategoryBeHidden Checks whether the category can be hidden in the view.
CanCategoryBeHiddenTemporary Check if category can be temporarily hidden in the view.
CanDeleteSubelement Checks if given subelement can be removed from the element. (Inherited from Element ) Element
CanEnableTemporaryViewPropertiesMode Indicates if Temporary View Properties mode can be applied for view in current state.
CanHaveTypeAssigned() Identifies if the element can have a type assigned. (Inherited from Element ) Element
CanModifyDetailLevel Check if Detail Level can be modified.
CanModifyDisplayStyle Indicates if DisplayStyle can be modified.
CanModifyViewDiscipline Indicates if the View Discipline can be modified
CanUseDepthCueing Indicates if view can use Depth Cueing
CanUseTemporaryVisibilityModes Indicates if view can use temporary visibility modes
CanViewBeDuplicated Identifies if this view can be duplicated.
ChangeTypeId(ElementId) Changes the type of the element. (Inherited from Element ) Element
ConvertTemporaryHideIsolateToPermanent Convert all temporary hidden elements or categories to permanently hidden in view.
ConvertToIndependent Convert the dependent view to independent.
CreateViewTemplate Creates a new view template instance from this view instance.
DeleteEntity Deletes the existing entity created by %schema% in the element (Inherited from Element ) Element
DeleteSubelement Removes a subelement from the element. (Inherited from Element ) Element
DeleteSubelements Removes the subelements from the element. (Inherited from Element ) Element
DisableTemporaryViewMode Disables the specified temporary view mode.
Dispose (Inherited from Element ) Element
Duplicate Duplicates this view.
EnableRevealHiddenMode Enables Reveal Hidden elements mode.
EnableTemporaryViewPropertiesMode Turns Temporary View Properties mode on or off. In this mode, any changes made to the view are temporary and will be discarded once the mode is disabled.
Equals Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
EvaluateAllParameterValues Evaluates all the parameters' values of the element. (Inherited from Element ) Element
EvaluateParameterValues Evaluate the parameters' values of the element on the given parameter ID set. (Inherited from Element ) Element
GetBackground Returns the current background set for the view.
GetCalloutParentId Gets ID of the callout parent view.
GetCategoryHidden Checks if elements of the given category are set to be invisible (hidden) in this view.
GetCategoryOverrides Gets graphic overrides for a category in view.
GetColorFillSchemeId Returns id of the color fill scheme element applied to the view.
GetCropRegionShapeManager Returns an object for managing view crop region shape.
GetCropRegionShapeManagerForReferenceCallout Returns an object for managing view crop region shape for reference callout.
GetDependentElements Get all elements that, from a logical point of view, are the children of this Element. (Inherited from Element ) Element
GetDependentViewIds Get the ids of dependent views.
GetDepthCueing Returns the current depth cueing settings for the view.
GetDirectContext3DHandleOverrides Returns DirectContext3D handle overrides object for the view.
GetElementOverrides Gets graphic overrides for an element in the view.
GetEntity Returns the existing entity corresponding to the Schema if it has been saved in the Element, or an invalid entity otherwise. (Inherited from Element ) Element
GetEntitySchemaGuids Returns the Schema guids of any Entities stored in this element. (Inherited from Element ) Element
GetExternalFileReference Gets information pertaining to the external file referenced by the element. (Inherited from Element ) Element
GetExternalResourceReference Gets the ExternalResourceReference associated with a specified external resource type. (Inherited from Element ) Element
GetExternalResourceReferenceExpanded Gets the collection of ExternalResourceReference associated with a specified external resource type. (Inherited from Element ) Element
GetExternalResourceReferences Gets the map of the external resource references referenced by the element. (Inherited from Element ) Element
GetExternalResourceReferencesExpanded Gets the expanded map of the external resource references referenced by the element. (Inherited from Element ) Element
GetFilterOverrides Gets graphic overrides that a filter applies to the view.
GetFilters Gets the filters applied to the view.
GetFilterVisibility Gets the visibility of the elements associated with a filter.
GetGeneratingElementIds Returns the ids of the element(s) that generated the input geometry object. (Inherited from Element ) Element
GetGeometryObjectFromReference Retrieve one geometric primitive contained in the element given a reference. (Inherited from Element ) Element
GetHashCode Serves as the default hash function. (Inherited from Object ) Object
GetIsFilterEnabled Identifies if the filter is enabled in this view.
GetLinkOverrides Gets the graphic overrides of a RevitLinkType or RevitLinkInstance in view.
GetMaterialArea Gets the area of the material with the given id. (Inherited from Element ) Element
GetMaterialIds Gets the element ids of all materials present in the element. (Inherited from Element ) Element
GetMaterialVolume Gets the volume of the material with the given id. (Inherited from Element ) Element
GetModelToProjectionTransforms Gets the transforms from the model space to the view projection space.
GetMonitoredLinkElementIds Provides the link instance IDs when the element is monitoring. (Inherited from Element ) Element
GetMonitoredLocalElementIds Provides the local element IDs when the element is monitoring. (Inherited from Element ) Element
GetNonControlledTemplateParameterIds Returns a list of parameters that are not marked as included when this view is used as a template.
GetOrderedFilters Gets the filters applied to the view in the order they are applied.
GetOrderedParameters Gets the parameters associated to the element in order. (Inherited from Element ) Element
GetParameter Retrieves a parameter from the element given identifier. (Inherited from Element ) Element
GetParameterFormatOptions Returns a FormatOptions override for the element Parameter, or a default FormatOptions if no override exists. (Inherited from Element ) Element
GetParameters Retrieves the parameters from the element via the given name. (Inherited from Element ) Element
GetPhaseStatus Gets the status of a given element in the input phase (Inherited from Element ) Element
GetPlacementOnSheetStatus Determines if this view placed on a sheet completely or partially.
GetPointCloudOverrides Returns point cloud overrides object for the view.
GetPrimaryViewId Get the id of the primary view.
GetReferenceCallouts Returns element ids of all reference callouts in the view.
GetReferenceElevations Returns element ids of all reference elevations in the view.
GetReferenceSections Returns element ids of all reference sections in the view.
GetSketchyLines Returns the current sketchy lines settings for the view.
GetSubelements Returns the collection of element subelements. (Inherited from Element ) Element
GetTemplateParameterIds Returns a list of parameter ids that may be controlled when this view is assigned as a template.
GetTemporaryViewPropertiesId When Temporary View Properties mode is in progress it provides view id that overrode settings for current view. Outside Temporary View Properties mode InvalidElementId will be returned.
GetTemporaryViewPropertiesName When Temporary View Properties mode is in progress, name of applied template is returned. Outside Temporary View Properties mode, empty string will be returned.
GetType Gets the Type of the current instance. (Inherited from Object ) Object
GetTypeId Returns the identifier of this element's type. (Inherited from Element ) Element
GetValidTypes() Obtains a set of types that are valid for this element. (Inherited from Element ) Element
GetViewDisplayModel Returns the current view display model settings for the view.
GetWorksetVisibility Returns the visibility settings of a workset for this particular view.
GetWorksharingDisplayMode Gets the current worksharing display mode for this view.
HasDetailLevel Check if the view has a Detail Level property
HasDisplayStyle Indicates if view has a DisplayStyle property
HasPhases Returns true if this Element has the properties CreatedPhaseId and DemolishedPhaseId. (Inherited from Element ) Element
HasViewDiscipline Indicates if the view has a Discipline property
HasViewTransforms Returns true if the view reports model space to view projection space transforms.
HideActiveWorkPlane Hide the active work plane of the view.
HideCategoriesTemporary Set multiple categories to be temporarily hidden in the view.
HideCategoryTemporary Set one category to be temporarily hidden in the view.
HideElements Sets the elements to be hidden in the view.
HideElementsTemporary Set multiple elements to be temporarily hidden in the view. To hide a group completely, you must also include all members of all groups and nested groups in your input.
HideElementTemporary Set one element to be temporarily hidden in the view. To hide a group completely, you must also include all members of all groups and nested groups in your input, therefore you should use the version of this method that accepts multiple element ids as input.
IsCategoryOverridable Checks whether the category can have graphic overrides in this view.
IsCreatedPhaseOrderValid Returns true if createdPhaseId and demolishedPhaseId are in order. (Inherited from Element ) Element
IsDemolishedPhaseOrderValid Returns true if createdPhaseId and demolishedPhaseId are in order. (Inherited from Element ) Element
IsElementVisibleInTemporaryViewMode Identifies if the input element is visible for the temporary view mode for this view.
IsExternalFileReference Determines whether this Element represents an external file. (Inherited from Element ) Element
IsFilterApplied Indicates if a filter is applied to the view.
IsHidden Identifies if the element has been permanently hidden in the view. (Inherited from Element ) Element
IsInTemporaryViewMode Returns true if the view is in a particular temporary view mode.
IsMonitoringLinkElement Indicate whether an element is monitoring any elements in any linked models. (Inherited from Element ) Element
IsMonitoringLocalElement Indicate whether an element is monitoring other local elements. (Inherited from Element ) Element
IsolateCategoriesTemporary Set categories to be temporarily isolated in the view.
IsolateCategoryTemporary Set one category to be temporarily isolated in the view.
IsolateElementsTemporary Set multiple elements to be temporarily isolated in the view. To isolate a group completely, you must also include all members of all groups and nested groups in your input.
IsolateElementTemporary Set one element to be temporarily isolated in the view. To isolate a group completely, you must also include all members of all groups and nested groups in your input, therefore you should use the version of this method that accepts multiple element ids as input.
IsPhaseCreatedValid Returns true if createdPhaseId is an allowed value for the property CreatedPhaseId in this Element. (Inherited from Element ) Element
IsPhaseDemolishedValid Returns true if demolishedPhaseId is an allowed value for the property DemolishedPhaseId in this Element. (Inherited from Element ) Element
IsTemporaryHideIsolateActive Indicates if the view is temporarily hiding or isolating elements or categories.
IsTemporaryViewPropertiesModeEnabled Returns true when Temporary View Properties mode is in progress, false otherwise.
IsValidType(ElementId) Checks if given type is valid for this element. (Inherited from Element ) Element
IsValidViewScale This validator checks that the view scale is in the allowable range.
IsValidViewTemplate Verifies that the view represented by templateId can be set as the controlling view template for this view.
IsViewValidForTemplateCreation Verifies that the view is valid for template creation.
IsWorksetVisible Indicates whether the workset is visible in this view.
LookupParameter Attempts to find a parameter on the element which has the given name. (Inherited from Element ) Element
Print() Print this view with the default view template and using the print setting of the current active document.
Print(Boolean) Print this view with the default view template, and either the view's document's print setting or the print setting of the current active document.
Print(View) Print this view with the given view template and using the print setting of the current active document.
Print(View, Boolean) Print this view with the given view template, and either the view's document's print setting or the print setting of the current active document.
RefersToExternalResourceReference Determines whether this Element uses external resources associated with a specified external resource type. (Inherited from Element ) Element
RefersToExternalResourceReferences Determines whether this Element uses external resources. (Inherited from Element ) Element
RemoveCalloutParent Replaces callout parent ID with InvalidElementId.
RemoveFilter Removes a filter from the view.
RemoveLinkOverrides Deletes the graphical link overrides in the current view.
RestoreCalloutParent Restores callout parent ID to the original view ID if that view is still available.
SetBackground Sets the background for the view. Background can only be set for 3d views and for Sections/Elevations.
SetCategoryHidden Sets if elements of the given category will be visible in this view.
SetCategoryOverrides Sets graphic overrides for a category in view.
SetColorFillSchemeId Applies color fill scheme to this view.
SetDepthCueing Sets the depth cueing settings for the view.
SetElementOverrides Sets graphic overrides for an element in the view.
SetEntity Stores the entity in the element. If an Entity described by the same Schema already exists, it is overwritten. (Inherited from Element ) Element
SetFilterOverrides Sets the overrides associated with a filter.
SetFilterVisibility Sets the visibility of the elements associated with a filter.
SetIsFilterEnabled Sets the filter enabled flag.
SetLinkOverrides Sets the graphic overrides of a RevitLinkType or RevitLinkInstance in the view.
SetNonControlledTemplateParameterIds Sets the parameters that will not be included when this view is used as a template.
SetSketchyLines Sets the sketchy lines settings for the view.
SetViewDisplayModel Sets the view display model settings for the view.
SetWorksetVisibility Sets visibility for a workset in this view.
SetWorksharingDisplayMode Sets the worksharing display mode for this view.
ShowActiveWorkPlane Show the active work plane of the view.
SupportedColorFillCategoryIds Returns collection of all category ids that correspond to elements that can potentially be colored in this view according to a color fill scheme. The set may be different depending on the view type.
SupportsRevealConstraints Checks that the view can have the Reveal Constraints mode activated.
SupportsWorksharingDisplayMode Checks whether this view supports the given worksharing display mode.
ToString Returns a string that represents the current object. (Inherited from Object ) Object
UnhideElements Sets the elements to be shown in the given view if they are currently hidden.