A base class to manage the creation of schemas and entities of those schemas.
Exemple #1
0
        /// <summary>
        /// Called by all methods defined partial classes in .\EStorageSchemaDefinitions.  See EStorageBundle1.cs for an example.
        /// </summary>
        /// <param name="bundle"></param>
        private void AddSchemaAndEntityImplementation(EStorageBundle bundle)
        {
            Transaction tAddEntity = new Transaction(m_revitApp.ActiveUIDocument.Document, "Add Entity of: " + bundle.SchemaName);

            tAddEntity.Start();
            foreach (ElementId id in m_revitApp.ActiveUIDocument.Selection.GetElementIds())
            {
                Element element = m_revitApp.ActiveUIDocument.Document.GetElement(id);
                Entity  entity  = bundle.CreateEntityOfSchema();
                element.SetEntity(entity);
            }
            tAddEntity.Commit();
        }
Exemple #2
0
 /// <summary>
 /// Called by all methods defined partial classes in .\EStorageSchemaDefinitions.  See EStorageBundle1.cs for an example.
 /// </summary>
 /// <param name="bundle"></param>
 private void AddSchemaAndEntityImplementation(EStorageBundle bundle)
 {
     Transaction tAddEntity = new Transaction(m_revitApp.ActiveUIDocument.Document, "Add Entity of: " + bundle.SchemaName);
      tAddEntity.Start();
      foreach (ElementId id in m_revitApp.ActiveUIDocument.Selection.GetElementIds())
      {
     Element element = m_revitApp.ActiveUIDocument.Document.GetElement(id);
     Entity entity = bundle.CreateEntityOfSchema();
     element.SetEntity(entity);
      }
      tAddEntity.Commit();
 }