public frm_ECCAProgram(ECCAProject myProject)
        {
            InitializeComponent();
            Project      = myProject;
            selectedBeam = new ECCABeam();

            RefreshScreen();
        }
        public frm_ECCAProgram(ECCABeam selectedBeam)
        {
            InitializeComponent();
            Project = new ECCAProject();
            bool isunique;

            Project.BeamCollection.AddBeam(selectedBeam, out isunique);
            RefreshScreen();
        }
        public frm_ECCAProgram(ECCAProject myProject, ECCABeam newBeam)
        {
            InitializeComponent();
            bool isunique;

            Project = myProject;
            Project.BeamCollection.AddBeam(newBeam, out isunique);

            if (isunique)
            {
                selectedBeam = newBeam;
            }
            else
            {
                selectedBeam = Project.BeamCollection.GetBeam(newBeam);
            }

            LoadBeamToInterface();
        }
Example #4
0
 public ECCAEngine(ECCAProject ECCAProjectClass)
 {
 }
Example #5
0
 public MainWindow(ECCAProject myProject, int ElementId)
 {
     InitializeComponent();
 }
Example #6
0
 public MainWindow(ECCAProject myProject)
 {
     InitializeComponent();
 }
 public frm_ECCAProgram()
 {
     InitializeComponent();
     Project      = new ECCAProject();
     selectedBeam = new ECCABeam();
 }
Example #8
0
        public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
                                                ref string message, ElementSet elements)
        {
            UIApplication app   = commandData.Application;
            UIDocument    uidoc = app.ActiveUIDocument;
            Document      doc   = uidoc.Document;

            string expetedfilesavepath = "";

            if (doc.IsWorkshared)
            {
                expetedfilesavepath = ModelPathUtils.ConvertModelPathToUserVisiblePath(doc.GetWorksharingCentralModelPath());
            }
            else
            {
                expetedfilesavepath = doc.PathName;
            }

            string MyECCAFile = Path.GetDirectoryName(expetedfilesavepath) + "\\ECCalcAidFile.bin";



            ECCAProject myProject = new ECCAProject(MyECCAFile);

            try
            {
                IList <ElementId> selectedElements = uidoc.Selection.GetElementIds().ToList();
                if (selectedElements.Count > 0)
                {
                    Element selectedBeam        = doc.GetElement(selectedElements[0]);
                    bool    validStructuralBeam = ValidateStructuralBeam(selectedBeam);

                    if (validStructuralBeam == true)
                    {
                        ECCABeam newBeam = ConvertToECCABeam(selectedBeam);


                        if (!(myProject.BeamCollection.IsUnique(newBeam)))
                        {
                            MessageBox.Show("Note this beam already exisits in the collection, do you want to reset its properties?", "Warning ", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                        }


                        frm_ECCAProgram ECCAMainProgram = new frm_ECCAProgram(myProject, newBeam);


                        ECCAMainProgram.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("The element you selected cannot be read as a structural beam");
                    }
                }

                //serialisation test
            }
            catch (Exception ex)
            {
            }

            return(Result.Succeeded);
        }