Sets the graphic overrides of a
RevitLinkType
or
RevitLinkInstance
in the view.
Namespace:
Autodesk.Revit.DB
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:
2024
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- linkId
-
Type:
Autodesk.Revit.DB
ElementId
The id of the RevitLinkType or RevitLinkInstance .
- linkDisplaySettings
-
Type:
Autodesk.Revit.DB
RevitLinkGraphicsSettings
Settings representing all link graphic overrides in the view.
Examples
Copy
C#
public static void UpdateOverridesInView(View view, ElementId linkElementId, ElementId linkedViewId)
{
RevitLinkGraphicsSettings settings = new RevitLinkGraphicsSettings();
settings.LinkVisibilityType = LinkVisibility.ByLinkView;
settings.LinkedViewId = linkedViewId;
using(Transaction transaction = new Transaction(view.Document, "Set link graphical overrides"))
{
transaction.Start();
view.SetLinkOverrides(linkElementId, settings);
transaction.Commit();
}
}
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentException | The input id is not a valid RevitLinkInstance or RevitLinkType id. -or- Setting link overrides to type LinkVisibility.Custom is not supported via the API. -or- The LinkedViewId of linkDisplaySettings has incorrect value for the specified LinkVisibilityType. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions InvalidOperationException | The view type does not support Visibility/Graphics Overriddes. -or- The view does not support link graphical overrides. |