public static IDatasmithExporterUIModule Get() { global::System.IntPtr cPtr = DatasmithFacadeCSharpPINVOKE.IDatasmithExporterUIModule_Get(); IDatasmithExporterUIModule ret = (cPtr == global::System.IntPtr.Zero) ? null : new IDatasmithExporterUIModule(cPtr, false); return(ret); }
public Result Execute(ExternalCommandData InCommandData, ref string OutCommandMessage, ElementSet OutElements) { IDirectLinkUI DirectLinkUI = IDatasmithExporterUIModule.Get()?.GetDirectLinkExporterUI(); DirectLinkUI?.OpenDirectLinkStreamWindow(); return(Result.Succeeded); }
public void OnEndExport() { if (RootCache.LinkedDocumentsCache.Count > 0) { ProcessLinkedDocuments(); } RootCache.Purge(DatasmithScene, false); ModifiedLinkedDocuments.Clear(); ExportedLinkedDocuments.Clear(); RootCache.ClearModified(); RootCache.ExportedElements.Clear(); string OutputPath = null; IDirectLinkUI DirectLinkUI = IDatasmithExporterUIModule.Get()?.GetDirectLinkExporterUI(); if (DirectLinkUI != null) { OutputPath = DirectLinkUI.GetDirectLinkCacheDirectory(); } else { OutputPath = Path.Combine(Path.GetTempPath(), SceneName); } Directory.CreateDirectory(OutputPath); DatasmithScene.ExportAssets(OutputPath); DatasmithScene.BuildScene(SceneName); bool bUpdateOk = DatasmithDirectLink.UpdateScene(DatasmithScene); SyncCount++; // Control metadata export via env var REVIT_DIRECTLINK_WITH_METADATA. // We are not interested of its value, just if it was set. if (null != Environment.GetEnvironmentVariable("REVIT_DIRECTLINK_WITH_METADATA")) { Debug.Assert(MetadataTask == null); // We cannot have metadata export running at this point (must be stopped in OnBeginExport) MetadataCancelToken = new CancellationTokenSource(); MetadataTask = Task.Run(() => ExportMetadata()); } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IDatasmithExporterUIModule obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }