private static int getLayerIndex(ObjectLayerInfo li, File3dm f) { File3dmLayerTable layers = f.AllLayers; if (li.Name.Contains(Layer.PathSeparator)) { foreach (Layer l in f.AllLayers) { if (l.FullPath == li.Name) { return(l.Index); } } } else { foreach (Layer l in f.AllLayers) { if (l.Name == li.Name) { return(l.Index); } } } return(-1); }
public File3dmWriter(string path) { File3dm _file = null; if (File.Exists(path)) { try { _file = File3dm.Read(path); _file.Objects.Clear(); _file.AllLayers.Clear(); } catch { } } else { _file = new File3dm(); } m_file = _file; m_layers = _file.AllLayers; m_path = path; }