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 = "模型数据导出"; string versionNumber = application.VersionNumber; string subVersionNumber = application.SubVersionNumber; // 如果版本有问题就弹出对话框 if (versionNumber != "2019" & versionNumber != "2020") { MessageBox.Show("该版本仅可在 Revit2019/2020 平台上运行!", caption, buttons, icon); return(Result.Failed); } else { try { AllViews allViews = new AllViews(); allViews.ObtainAllViews(commandData); //向AllViews的属性ViewListName中增加三维视图的名称 using (ExportViewsToVRForm exportViewsToVRForm = new ExportViewsToVRForm(commandData, allViews)) { if (exportViewsToVRForm.ShowDialog() == DialogResult.OK) { return(Result.Cancelled); } // 更改mtl文件 string folderPath = Path.GetDirectoryName(exportViewsToVRForm.mtlPath); string fileName = Path.GetFileNameWithoutExtension(exportViewsToVRForm.mtlPath); string fileContent = null; } } catch (Exception ex) { message = ex.Message; return(Result.Failed); } return(Result.Succeeded); } }
// 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); } }
// Token: 0x06000078 RID: 120 RVA: 0x00002DB4 File Offset: 0x00000FB4 public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { Autodesk.Revit.ApplicationServices.Application application = commandData.Application.Application; Document document = commandData.Application.ActiveUIDocument.Document; string userId = "manu"; string userPassword = "******"; string secret = "msdlGeekNerdzA"; bool flag = this.verifyEntitlementEF(userId, userPassword, secret); bool flag2 = flag; if (flag2) { try { AllViews allViews = new AllViews(); allViews.ObtainAllViews(commandData); using (FindMatPatternsForm findMatPatternsForm = new FindMatPatternsForm(commandData, allViews)) { bool flag3 = findMatPatternsForm.ShowDialog() == DialogResult.OK; if (flag3) { 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); }
// Token: 0x0600007E RID: 126 RVA: 0x00003188 File Offset: 0x00001388 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 = "VuNerdzA"; bool flag4 = this.verifyEntitlementEF(userId, userPassword, secret); bool flag5 = flag4; if (flag5) { try { AllViews allViews = new AllViews(); allViews.ObtainAllViews(commandData); using (ExportToVUxyzForm exportToVUxyzForm = new ExportToVUxyzForm(commandData, allViews)) { bool flag6 = exportToVUxyzForm.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); } }
public CheckExportContext(Document document, AllViews allViews) { this.m_document = document; this.m_TransformationStack.Push(Transform.Identity); this.m_AllViews = allViews; }
// Token: 0x06000075 RID: 117 RVA: 0x00002B94 File Offset: 0x00000D94 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"; Result result; if (flag) { MessageBox.Show("This version only works on Revit 2018.", caption, buttons, icon); return(Result.Succeeded); } else { bool flag2 = subVersionNumber != "2018.1" & subVersionNumber != "2018.2" & subVersionNumber != "2018.3"; if (flag2) { MessageBox.Show("This version only works on Revit 2018.1 or more.", caption, buttons, icon); return(Result.Succeeded); } else { bool flag3 = document.ActiveView.ViewType != ViewType.ThreeD; if (flag3) { MessageBox.Show("The active view must be a 3D view type."); return(Result.Succeeded); } else { bool flag4 = document.ActiveView.ViewType == ViewType.ThreeD & document.ActiveView.IsTemplate; if (flag4) { MessageBox.Show("The active view is a template view and is not exportable."); return(Result.Succeeded); } else { try { AllViews allViews = new AllViews(); allViews.ObtainAllViews(commandData); using (ExpAnimForm expAnimForm = new ExpAnimForm(commandData, allViews)) { bool flag5 = expAnimForm.ShowDialog() == DialogResult.OK; if (flag5) { return(Result.Cancelled); } } } catch (Exception ex) { message = ex.Message; return(Result.Failed); } return(Result.Succeeded); } } } } }
// Token: 0x060000AC RID: 172 RVA: 0x0000BD34 File Offset: 0x00009F34 public FindMatPatternsForm(ExternalCommandData commandData, AllViews families) { this.InitializeComponent(); this.p_commandData = commandData; this.m_AllViews = families; }
// Token: 0x0600008E RID: 142 RVA: 0x00003DD8 File Offset: 0x00001FD8 public ExpAnimForm(ExternalCommandData commandData, AllViews families) { this.InitializeComponent(); this.p_commandData = commandData; this.m_AllViews = families; }