private static TAS3D.T3DDocument GetT3DDocument(bool Save) { TAS3D.T3DDocument aT3DDocument = null; try { object aObject = System.Runtime.InteropServices.Marshal.GetActiveObject("TAS3D.T3DDocument"); if (aObject != null && aObject is TAS3D.T3DDocument) { aT3DDocument = aObject as TAS3D.T3DDocument; if (Save && !string.IsNullOrEmpty(aT3DDocument.filePath)) { aT3DDocument.Save(aT3DDocument.filePath); } aT3DDocument.Close(); } } catch { } if (aT3DDocument == null) { aT3DDocument = new TAS3D.T3DDocument(); } return(aT3DDocument); }
public bool Save(string path = null) { if (path == null) { path = t3DDocument.filePath; } return(t3DDocument.Save(path)); }
void IDisposable.Dispose() { if (pT3DDocument != null) { if (pSave && pT3DDocument.filePath != null) { pT3DDocument.Save(pT3DDocument.filePath); } pT3DDocument.Close(); pT3DDocument = null; } }