2024 Method
Changes 0
M

RevitLinkInstance.Create

Description:
Creates a new instance of a linked Revit project (RevitLinkType).
Remarks:
Instances will be placed origin-to-origin. This function cannot be used to create instances of nested links.
Overloads (2):
Create(Document,ElementId)
public static RevitLinkInstance Create(
	Document document,
	ElementId revitLinkTypeId
)
Return Value RevitLinkInstance The newly-created RevitLinkInstance.
public void CreateLinkInstances(Document doc, ElementId linkTypeId)
{
    // Create revit link instance at origin
    RevitLinkInstance.Create(doc, linkTypeId);
    RevitLinkInstance instance2 = RevitLinkInstance.Create(doc, linkTypeId);
    Location location = instance2.Location;
    // Create a second instance of the link and offset it by 100 feet.
    location.Move(new XYZ(0, -100, 0));
}