C

View

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