public SAMTBDDocument(string path, bool readOnly = false) { this.readOnly = readOnly; if (string.IsNullOrWhiteSpace(path)) { return; } if (File.Exists(path)) { FileInfo fileInfo = new FileInfo(path); if (Core.Query.Locked(fileInfo)) { readOnly = true; } } if (File.Exists(path)) { if (readOnly) { TBDDocument.openReadOnly(path); } else { TBDDocument.open(path); } } else { TBDDocument.create(path); } }
public static bool TBD3dVisualisation(string tbdFile, bool run = false) { if (!run) { return(false); } if (string.IsNullOrEmpty(tbdFile)) { BH.Engine.Base.Compute.RecordError("Please provide a valid TBD file path"); return(false); } TBDDocument tbdDocument = new TBDDocument(); if (tbdDocument != null) { tbdDocument.openReadOnly(tbdFile); tbdDocument.ShowVisualisation(); } return(true); }