WorksharingDisplayGraphicSettings Class


Represents the graphical settings that can be assigned to elements in the worksharing display modes.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since: 2012

Syntax

C#
public class WorksharingDisplayGraphicSettings : IDisposable
Visual Basic
Public Class WorksharingDisplayGraphicSettings _
	Implements IDisposable
Visual C++
public ref class WorksharingDisplayGraphicSettings : IDisposable

Examples

Copy C#
public WorksharingDisplayGraphicSettings GetWorksharingDisplaySettings(Document doc, String userName, WorksetId worksetId, bool ownedbyCurrentUser)
{
    WorksharingDisplayGraphicSettings graphicSettings;

    // get or create a WorksharingDisplaySettings current active document
    WorksharingDisplaySettings displaySettings = WorksharingDisplaySettings.GetOrCreateWorksharingDisplaySettings(doc);

    // get graphic settings for a user, if specified
    if (!String.IsNullOrEmpty(userName))
        graphicSettings = displaySettings.GetGraphicOverrides(userName);

    // get graphicSettings for a workset, if specified
    else if (worksetId != WorksetId.InvalidWorksetId)
        graphicSettings = displaySettings.GetGraphicOverrides(worksetId);

    // get graphic settings for the OwnedByCurrentUser status
    else if (ownedbyCurrentUser)
        graphicSettings = displaySettings.GetGraphicOverrides(CheckoutStatus.OwnedByCurrentUser);

    // otherwise get graphic settings for the CurrentWithCentral status
    else
        graphicSettings = displaySettings.GetGraphicOverrides(ModelUpdatesStatus.CurrentWithCentral);

    return graphicSettings;
}
Copy VB.NET
Public Function GetWorksharingDisplaySettings(doc As Document, userName As [String], worksetId__1 As WorksetId, ownedbyCurrentUser As Boolean) As WorksharingDisplayGraphicSettings
    Dim graphicSettings As WorksharingDisplayGraphicSettings

    ' get or create a WorksharingDisplaySettings current active document
    Dim displaySettings As WorksharingDisplaySettings = WorksharingDisplaySettings.GetOrCreateWorksharingDisplaySettings(doc)

    ' get graphic settings for a user, if specified
    If Not [String].IsNullOrEmpty(userName) Then
        graphicSettings = displaySettings.GetGraphicOverrides(userName)

    ' get graphicSettings for a workset, if specified
    ElseIf worksetId__1 <> WorksetId.InvalidWorksetId Then
        graphicSettings = displaySettings.GetGraphicOverrides(worksetId__1)

    ' get graphic settings for the OwnedByCurrentUser status
    ElseIf ownedbyCurrentUser Then
        graphicSettings = displaySettings.GetGraphicOverrides(CheckoutStatus.OwnedByCurrentUser)
    Else

        ' otherwise get graphic settings for the CurrentWithCentral status
        graphicSettings = displaySettings.GetGraphicOverrides(ModelUpdatesStatus.CurrentWithCentral)
    End If

    Return graphicSettings
End Function

Inheritance Hierarchy

System Object
Autodesk.Revit.DB WorksharingDisplayGraphicSettings

See Also