RVTDocs.com
Namespace: Autodesk.Revit.DB Interface: IExportContext

IExportContext.OnLinkBegin

Method
Description:
This method marks the beginning of a link instance to be exported.
Syntax
Examples
/// <summary>
/// This code demonstrates how to process instances of Revit links.
/// </summary>
public RenderNodeAction OnLinkBegin(LinkNode node)
{
   // We can get more information about the Revit Link and its type if we need to
   ElementId symbolId = node.SymbolId;
   RevitLinkType linkType = m_document.GetElement(symbolId) as RevitLinkType;
   String linkDocumentName = linkType.Name;

   // Typically, an export context has to manage a stack of transformation
   // for all nested objects, such as instances, lights, links, etc.
   // A combined transformation needs to be applied to the incoming geometry
   // (providing all geometry is to be flattened in the resultant format.)
   m_TransformationStack.Push(m_TransformationStack.Peek().Multiply(node.GetTransform()));

   // We can either skip this link instance or proceed with rendering it
   return RenderNodeAction.Proceed;
}

/// <summary>
/// This method marks the end of processing a Revit link
/// </summary>
public void OnLinkEnd(LinkNode node)
{
   // Note: This method is invoked even for instances that were skipped.

   // If we maintain a transformation stack, we need to remove the latest one from it.
   m_TransformationStack.Pop();
}
Parameters
Parameter Type Description
node LinkNode
Return Value
Type Description
RenderNodeAction Return RenderNodeAction.Skip if you wish to skip processing this link instance, or return RenderNodeAction.Proceed otherwise.