Ejemplo n.º 1
0
        private static void TestBarReleases()
        {
            cSapModel m_model;

            cOAPI   m_app;
            string  pathToETABS = @"C:\Program Files\Computers and Structures\ETABS 2016\ETABS.exe";
            cHelper helper      = new ETABS2016.Helper();


            //open ETABS if not running - NOTE: this behaviour is different from other adapters
            m_app = helper.CreateObject(pathToETABS);
            m_app.ApplicationStart();

            m_model = m_app.SapModel;

            m_model.InitializeNewModel();
            m_model.File.NewBlank();

            string name = "1";

            m_model.FrameObj.AddByCoord(0, 0, 0, 0, 0, 10, ref name);

            bool[]   ii       = new bool[6];
            bool[]   jj       = new bool[6];
            double[] startVal = new double[6];
            double[] endVal   = new double[6];
            ii[5] = true;
            jj[5] = true;

            int ret = m_model.FrameObj.SetReleases(name, ref ii, ref jj, ref startVal, ref endVal);
        }
Ejemplo n.º 2
0
        //     internal class SectionProp
        //    {

        //    }

        //    internal class Frame
        //   {
        //      internal Line line { get; set; }

        //     internal SectionProp sectionprop { get; set; }



        //  }



        public static bool StartETABS(bool Run)
        {
            ETABS2016.cOAPI   etabs;
            ETABS2016.cHelper hlp = new ETABS2016.Helper();
            etabs = NewMethod(hlp);
            long r;

            r = etabs.ApplicationStart();
            ETABS2016.cSapModel model = etabs.SapModel;
            r = model.InitializeNewModel(eUnits.kN_m_C);
            r = model.File.NewBlank();

            return(true);
        }
Ejemplo n.º 3
0
        /***************************************************/
        /**** Constructors                              ****/
        /***************************************************/

        public ETABSAdapter(string filePath = "", EtabsConfig etabsConfig = null, bool active = false)
        {
            if (active)
            {
                AdapterId = ID;

                this.EtabsConfig = etabsConfig == null ? new EtabsConfig() : etabsConfig;

                Config.SeparateProperties = true;
                Config.MergeWithComparer  = true;
                Config.ProcessInMemory    = false;
                Config.CloneBeforePush    = true;

                //string pathToETABS = System.IO.Path.Combine(Environment.GetEnvironmentVariable("PROGRAMFILES"), "Computers and Structures", "ETABS 2016", "ETABS.exe");
                //string pathToETABS = System.IO.Path.Combine("C:","Program Files", "Computers and Structures", "ETABS 2016", "ETABS.exe");
                string  pathToETABS = @"C:\Program Files\Computers and Structures\ETABS 2016\ETABS.exe";
                cHelper helper      = new ETABS2016.Helper();

                object runningInstance = null;
                if (System.Diagnostics.Process.GetProcessesByName("ETABS").Length > 0)
                {
                    runningInstance = System.Runtime.InteropServices.Marshal.GetActiveObject("CSI.ETABS.API.ETABSObject");

                    m_app   = (cOAPI)runningInstance;
                    m_model = m_app.SapModel;
                    if (System.IO.File.Exists(filePath))
                    {
                        m_model.File.OpenFile(filePath);
                    }
                    m_model.SetPresentUnits(eUnits.N_m_C);
                }
                else
                {
                    //open ETABS if not running - NOTE: this behaviour is different from other adapters
                    m_app = helper.CreateObject(pathToETABS);
                    m_app.ApplicationStart();
                    m_model = m_app.SapModel;
                    m_model.InitializeNewModel(eUnits.N_m_C);
                    if (System.IO.File.Exists(filePath))
                    {
                        m_model.File.OpenFile(filePath);
                    }
                    else
                    {
                        m_model.File.NewBlank();
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public static Frame From_Line(Line line, string sectionprop, int rotation)
        {
            ETABS2016.cOAPI   etabs;
            ETABS2016.cHelper hlp = new ETABS2016.Helper();
            etabs = hlp.GetObject("CSI.ETABS.API.ETABSObject");
            long r;

            ETABS2016.cSapModel model = etabs.SapModel;


            Frame nfrm = new Frame();

            nfrm.line        = line;
            nfrm.sectionprop = sectionprop;
            nfrm.rotation    = rotation;

            Point i = nfrm.line.StartPoint;
            Point j = nfrm.line.EndPoint;

            double xi = i.X;
            double yi = i.Y;
            double zi = i.Z;

            double xj = j.X;
            double yj = j.Y;
            double zj = j.Z;

            string Name = "1";

            r = model.FrameObj.AddByCoord(xi, yi, zi, xj, yj, zj, ref Name);

            nfrm.label = Name;


            return(nfrm);
        }