/// <summary> /// Imports a Dynamo 1.3 File into the current graph /// </summary> /// <param name="viewModel"></param> /// <param name="DynamoFilePath"></param> private static void ImportXMLDynamo(DynamoViewModel viewModel, string DynamoFilePath) { WorkspaceViewModel workspaceViewModel = viewModel.CurrentSpaceViewModel; WorkspaceModel model = viewModel.Model.CurrentWorkspace; //Create two lists for the Selection of the imported model List <string> guidList = new List <string>(); List <dynamic> selectionList = new List <dynamic>(); //Load a XML Document from the Dynamo File\ XmlDocument doc = new XmlDocument(); doc.Load(DynamoFilePath); //Loop over the XML Elements in the Document foreach (XmlElement node in doc.DocumentElement) { try { foreach (XmlElement element in node.ChildNodes) { model.CreateModel(element); XmlAttributeCollection attributes = element.Attributes; foreach (XmlAttribute attribute in attributes) { string attributeName = attribute.Name; string attributeValue = attribute.Value; if (attributeName == "guid") { guidList.Add(attributeValue); } } } } catch { } } # region MAKE ALL IMPORTED ITEMS THE NEW SELECTION //Check Groups #region foreach (AnnotationViewModel groupView in workspaceViewModel.Annotations)