2023 Method
Changes 0
M

RevitLinkType.CreateFromIFC

Description:
Creates a new Revit link type from an existing Revit file created via import by reference of an asscoiated IFC file.
Remarks:

This function is one of a series of steps necessary for linking an IFC file. To understand how it is used in context, please download the IFC open source code, and look in the Revit.IFC.Import project at Importer.ImportIFC(ImporterIFC importer), under the IFCImportAction.Link branch.

This function regenerates the input document. While the options argument allows specification of a path type, the input path argument must be a full path. Relative vs. absolute determines how Revit will store the path, but it needs a complete path to find the linked document initially.
Overloads (2):
CreateFromIFC(Document,ExternalResourceReference,String,Boolean,RevitLinkOptions)
public static LinkLoadResult CreateFromIFC(
	Document document,
	ExternalResourceReference resourceReference,
	string revitLinkedFilePath,
	bool recreateLink,
	RevitLinkOptions options
)
  • document
    The document in which to create the Revit link.
  • resourceReference
    An external resource reference describing the source of the IFC file used in creation.
  • String
    revitLinkedFilePath
    The path of the existing Revit file that contains elements created via an import by reference operation. This must be a full path.
  • Boolean
    recreateLink
    If true, the existing Revit file created via an import by reference operation will be updated based on the information in the IFC file. If false, the existing Revit file will be used as-is.
  • options
    An options class for loading Revit links.
Return Value LinkLoadResult An object containing the results of creating and loading the Revit link type. It contains the ElementId of the new link.