Example #1
0
        private void btn_get_model_Click(object sender, EventArgs e)
        {
            btn_get_model.Enabled = false;
            lbl_model_status.Text = "Loading...";

            allParts = teklaHandler.getModel();

            update_model_label();
            update_button_status();

            btn_get_model.Enabled = true;
        }
Example #2
0
        public static partCollection getPartInfo(partCollection allParts, ModelObjectEnumerator myEnum)
        {
            while (myEnum.MoveNext())
            {
                if (myEnum.Current is Part)
                {
                    allParts.parts.Add(new elementData(myEnum.Current as Part));
                }
                else if (myEnum.Current is Assembly)
                {
                    allParts.assemblys.Add(new elementData(myEnum.Current as Assembly));
                }
            }

            return(allParts);
        }
Example #3
0
        public static partCollection getModel()
        {
            Model          myModel  = new Model();
            partCollection allParts = new partCollection();

            if (myModel.GetConnectionStatus())
            {
                System.Type[] selectionType = new System.Type[3];

                selectionType.SetValue(typeof(Beam), 0);
                selectionType.SetValue(typeof(ContourPlate), 1);
                selectionType.SetValue(typeof(Assembly), 2);

                ModelObjectEnumerator myEnum = myModel.GetModelObjectSelector().GetAllObjectsWithType(selectionType);

                allParts = getPartInfo(allParts, myEnum);
            }

            return(allParts);
        }