예제 #1
0
 public override bool Execute(ExecutionInfo exInfo = null)
 {
     Result = false;
     if (FilePath.IsValid && Write)
     {
         Document.Model.GenerateNodes(new NodeGenerationParameters());
         var etabs = new ETABSClient();
         etabs.Message += HandleMessage;
         ETABSIDMappingTable idMap = new ETABSIDMappingTable();
         etabs.WriteModelToEtabs(FilePath, Document.Model, ref idMap, new ETABSConversionOptions());
         etabs.Close();
         etabs.Release();
         Document.IDMappings[FilePath] = idMap;
         Result = true;
     }
     return(true);
 }
예제 #2
0
        public static TimeSpan WriteToETABS()
        {
            var sw = new Stopwatch();

            ModelDocument doc = new ModelDocument();

            doc.Model.Create.LinearElement(new Line(0, 0, 10, 0));
            doc.Model.Create.LinearElement(new Line(0, 10, 10, 0));
            doc.Model.Create.LinearElement(new Line(0, 0, -10, 0));
            doc.Model.GenerateNodes(new NodeGenerationParameters());
            doc.Model.Add(new LinearElementSet(doc.Model.Elements));
            doc.Model.Add(new NodeSet(doc.Model.Nodes));

            var etabs = new ETABSClient();
            var idMap = new ETABSIDMappingTable();

            etabs.WriteModelToEtabs("C:\\Temp\\Test3.edb", doc.Model, ref idMap);
            etabs.Close();
            etabs.Release();

            sw.Stop();

            return(sw.Elapsed);
        }