Exemplo n.º 1
0
        // Token: 0x0600007B RID: 123 RVA: 0x00002FA4 File Offset: 0x000011A4
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Autodesk.Revit.ApplicationServices.Application application = commandData.Application.Application;
            Document          document         = commandData.Application.ActiveUIDocument.Document;
            MessageBoxIcon    icon             = MessageBoxIcon.Exclamation;
            MessageBoxButtons buttons          = MessageBoxButtons.OK;
            string            caption          = "ef | Export To Unity";
            string            versionNumber    = application.VersionNumber;
            string            subVersionNumber = application.SubVersionNumber;

            if (versionNumber != "2019" & versionNumber != "2020")
            {
                MessageBox.Show("This version only works with Revit 2019 or 2020.", caption, buttons, icon);
                return(Result.Failed);
            }
            else
            {
                try
                {
                    AllViews allViews = new AllViews();
                    allViews.ObtainAllViews(commandData);
                    using (ExpDataForm expDataForm = new ExpDataForm(commandData, allViews))
                    {
                        bool flag5 = expDataForm.ShowDialog() == DialogResult.OK;
                        if (flag5)
                        {
                            return(Result.Cancelled);
                        }
                    }
                }
                catch (Exception ex)
                {
                    message = ex.Message;
                    return(Result.Failed);
                }
                return(Result.Succeeded);
            }
        }
Exemplo n.º 2
0
        // Token: 0x06000085 RID: 133 RVA: 0x0000376C File Offset: 0x0000196C
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Autodesk.Revit.ApplicationServices.Application application = commandData.Application.Application;
            Document          document         = commandData.Application.ActiveUIDocument.Document;
            MessageBoxIcon    icon             = MessageBoxIcon.Exclamation;
            MessageBoxButtons buttons          = MessageBoxButtons.OK;
            string            caption          = "ef | Export To Unity";
            string            versionNumber    = application.VersionNumber;
            string            subVersionNumber = application.SubVersionNumber;
            bool   flag = versionNumber != "2018" & versionNumber != "2019" & versionNumber != "2020";
            Result result;

            if (flag)
            {
                MessageBox.Show("This version only works with Revit 2018 or 2019.", caption, buttons, icon);
                return(Result.Succeeded);
            }
            else
            {
                bool flag2 = versionNumber.Contains("2018");
                if (flag2)
                {
                    bool flag3 = subVersionNumber != "2018.1" & subVersionNumber != "2018.2" & subVersionNumber != "2018.3";
                    if (flag3)
                    {
                        MessageBox.Show("This version only works with Revit 2018.1 or more.", caption, buttons, icon);
                        return(Result.Cancelled);
                    }
                }
                string userId       = "manu";
                string userPassword = "******";
                string secret       = "msdlGeekNerdzA";
                bool   flag4        = this.verifyEntitlementEF(userId, userPassword, secret);
                bool   flag5        = flag4;
                if (flag5)
                {
                    try
                    {
                        AllViews allViews = new AllViews();
                        allViews.ObtainAllViews(commandData);
                        using (ExpDataForm expDataForm = new ExpDataForm(commandData, allViews))
                        {
                            bool flag6 = expDataForm.ShowDialog() == DialogResult.OK;
                            if (flag6)
                            {
                                return(Result.Cancelled);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        message = ex.Message;
                        return(Result.Failed);
                    }
                }
                else
                {
                    TaskDialog.Show("Entitlement API", "User do not have entitlement to use the App");
                }
                return(Result.Succeeded);
            }
            return(result);
        }