/// <summary>Initializes a new instance of the <see cref="MDesignation"/> class.</summary> public MDesignation() : base() { _hearings = new System.Collections.Generic.HashSet<Hearing>(); _partyAmendmentLeaveOfCourts = new System.Collections.Generic.HashSet<PartyAmendmentLeaveOfCourt>(); _refOrderDetails = new System.Collections.Generic.HashSet<RefOrderDetail>(); }
/// <summary>Initializes a new instance of the <see cref="Liquidator"/> class.</summary> public Liquidator() : base() { _liquidatorAddresses = new System.Collections.Generic.HashSet<LiquidatorAddress>(); _liquidatorAliases = new System.Collections.Generic.HashSet<LiquidatorAlias>(); _liquidatorPICs = new System.Collections.Generic.HashSet<LiquidatorPIC>(); }
/// <summary>Initializes a new instance of the <see cref="MFilingFee"/> class.</summary> public MFilingFee() : base() { _mFilingFeeChargingMechanisms = new System.Collections.Generic.HashSet<MFilingFeeChargingMechanism>(); _mHRGBeforeTypes = new System.Collections.Generic.HashSet<MHRGBeforeType>(); _requestDocDetails = new System.Collections.Generic.HashSet<RequestDocDetail>(); }
//internal ListView markedList; ////private bool _contentLoaded; public MarkedRecordPage() { ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this); this.InitializeComponent(); this.markedList.Items.Clear(); this.groups = this.dataService.GetEntGroupList(); }
/// <summary>Initializes a new instance of the <see cref="MPersonIDType"/> class.</summary> public MPersonIDType() : base() { _mCPCompanyIdType = new System.Collections.Generic.HashSet<CaseParty>(); _mCPPersonIdType = new System.Collections.Generic.HashSet<CaseParty>(); _mCPAICDCompanyIdTypeCode = new System.Collections.Generic.HashSet<CasePartyAICDetail>(); _mCPAICDPersonIdTypeCode = new System.Collections.Generic.HashSet<CasePartyAICDetail>(); _casePartyBailorInfos = new System.Collections.Generic.HashSet<CasePartyBailorInfo>(); _mBODDCompanyIdType = new System.Collections.Generic.HashSet<BankruptcyOtherDefDetail>(); _mBODDPersonIdType = new System.Collections.Generic.HashSet<BankruptcyOtherDefDetail>(); _childInfos = new System.Collections.Generic.HashSet<ChildInfo>(); _deceasedIdentifications = new System.Collections.Generic.HashSet<DeceasedIdentification>(); _mLCompanyIdType = new System.Collections.Generic.HashSet<Liquidator>(); _mLPersonIdType = new System.Collections.Generic.HashSet<Liquidator>(); _liquidatorPICs = new System.Collections.Generic.HashSet<LiquidatorPIC>(); _travelPassInfos = new System.Collections.Generic.HashSet<TravelPassInfo>(); _mDCPCompanyIdType = new System.Collections.Generic.HashSet<DocCaseParty>(); _mDCPPersonIdType = new System.Collections.Generic.HashSet<DocCaseParty>(); _mDCPAICDCompanyIdTypeCode = new System.Collections.Generic.HashSet<DocCasePartyAICDetail>(); _mDCPAICDPersonIdTypeCode = new System.Collections.Generic.HashSet<DocCasePartyAICDetail>(); _docCasePartyBailorInfos = new System.Collections.Generic.HashSet<DocCasePartyBailorInfo>(); _lABParties = new System.Collections.Generic.HashSet<LABParty>(); _lABPartyHistories = new System.Collections.Generic.HashSet<LABPartyHistory>(); _fileInspections = new System.Collections.Generic.HashSet<FileInspection>(); }
/// <summary>Initializes a new instance of the <see cref="MNOACode"/> class.</summary> public MNOACode() : base() { _natureOfApplications = new System.Collections.Generic.HashSet<NatureOfApplication>(); _mSummonsParams = new System.Collections.Generic.HashSet<MSummonsParam>(); _rMNOAForumHrgTypes = new System.Collections.Generic.HashSet<RMNOAForumHrgType>(); }
/// <summary>Initializes a new instance of the <see cref="MOccupation"/> class.</summary> public MOccupation() : base() { _caseParties = new System.Collections.Generic.HashSet<CaseParty>(); _childInfos = new System.Collections.Generic.HashSet<ChildInfo>(); _docCaseParties = new System.Collections.Generic.HashSet<DocCaseParty>(); }
/// <summary>Initializes a new instance of the <see cref="MActingInCapacity"/> class.</summary> public MActingInCapacity() : base() { _casePartyAICDetails = new System.Collections.Generic.HashSet<CasePartyAICDetail>(); _liquidatorPICs = new System.Collections.Generic.HashSet<LiquidatorPIC>(); _docCasePartyAICDetails = new System.Collections.Generic.HashSet<DocCasePartyAICDetail>(); }
/// <summary>Initializes a new instance of the <see cref="MHRGBeforeType"/> class.</summary> public MHRGBeforeType() : base() { _hearingsEstimatedHRGBeforeTypeCode = new System.Collections.Generic.HashSet<Hearing>(); _hearings = new System.Collections.Generic.HashSet<Hearing>(); _paymentHRGDatesDocDetails = new System.Collections.Generic.HashSet<PaymentHRGDatesDocDetail>(); }
/// <summary>Initializes a new instance of the <see cref="DocCasePartyAICDetail"/> class.</summary> public DocCasePartyAICDetail() : base() { _docCasePartyAICAddresses = new System.Collections.Generic.HashSet<DocCasePartyAICAddress>(); _docCasePartyAICAliases = new System.Collections.Generic.HashSet<DocCasePartyAICAlias>(); _aDMWAInfos = new System.Collections.Generic.HashSet<ADMWAInfo>(); }
/// <summary>Initializes a new instance of the <see cref="EMSCheque"/> class.</summary> public EMSCheque() : base() { _eMSPaymentCheques = new System.Collections.Generic.HashSet<EMSPaymentCheque>(); _eMSChequeHistorys = new System.Collections.Generic.HashSet<EMSChequeHistory>(); _eMSStateFunds = new System.Collections.Generic.HashSet<EMSStateFund>(); }
/// <summary>Initializes a new instance of the <see cref="PaymentInDocDetail"/> class.</summary> public PaymentInDocDetail() : base() { _paymentInDocFSDetails = new System.Collections.Generic.HashSet<PaymentInDocFSDetail>(); _paymentOutPayInDetails = new System.Collections.Generic.HashSet<PaymentOutPayInDetail>(); _notPaymentToCourtDocDetails = new System.Collections.Generic.HashSet<NotPaymentToCourtDocDetail>(); }
/// <summary>Initializes a new instance of the <see cref="MRelationship"/> class.</summary> public MRelationship() : base() { _aDDependants = new System.Collections.Generic.HashSet<ADDependant>(); _caseParties = new System.Collections.Generic.HashSet<CaseParty>(); _oSPDRelations = new System.Collections.Generic.HashSet<OSPDRelation>(); _docCaseParties = new System.Collections.Generic.HashSet<DocCaseParty>(); }
/// <summary>Initializes a new instance of the <see cref="EMSPaymentVoucherFinal"/> class.</summary> public EMSPaymentVoucherFinal() : base() { _eMSPaymentVoucherAdms = new System.Collections.Generic.HashSet<EMSPaymentVoucherAdm>(); _eMSCourtCommissions = new System.Collections.Generic.HashSet<EMSCourtCommission>(); _eMSPaymentVoucherFinalOthers = new System.Collections.Generic.HashSet<EMSPaymentVoucherFinalOther>(); _eMSPaymentVoucherMiscs = new System.Collections.Generic.HashSet<EMSPaymentVoucherMisc>(); }
/// <summary>Initializes a new instance of the <see cref="MMaritalStatus"/> class.</summary> public MMaritalStatus() : base() { _caseParties = new System.Collections.Generic.HashSet<CaseParty>(); _childInfos = new System.Collections.Generic.HashSet<ChildInfo>(); _deceasedInfos = new System.Collections.Generic.HashSet<DeceasedInfo>(); _docCaseParties = new System.Collections.Generic.HashSet<DocCaseParty>(); }
/// <summary>Initializes a new instance of the <see cref="MPartyType"/> class.</summary> public MPartyType() : base() { _caseParties = new System.Collections.Generic.HashSet<CaseParty>(); _mCasePartyTypeCode = new System.Collections.Generic.HashSet<DocCaseParty>(); _mSubCasePartyTypeCode = new System.Collections.Generic.HashSet<DocCaseParty>(); _subCaseParties = new System.Collections.Generic.HashSet<SubCaseParty>(); }
/// <summary>Initializes a new instance of the <see cref="MPrison"/> class.</summary> public MPrison() : base() { _casePartyCriminalInfoCustodyPrisonCode = new System.Collections.Generic.HashSet<CasePartyCriminalInfo>(); _casePartyCriminalInfoRemandPrisonCode = new System.Collections.Generic.HashSet<CasePartyCriminalInfo>(); _docCasePartyCriminalInfoCustodyPrisonCode = new System.Collections.Generic.HashSet<DocCasePartyCriminalInfo>(); _docCasePartyCriminalInfoRemandPrisonCode = new System.Collections.Generic.HashSet<DocCasePartyCriminalInfo>(); }
public MessageCenterWindow() { ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this); this.InitializeComponent(); this.InitEventHandler(); this.messageCenter = new MessageCenterViewModel(); this.groups = this.dataService.GetEntGroupList(); }
/// <summary>Initializes a new instance of the <see cref="ChargeInfo"/> class.</summary> public ChargeInfo() : base() { _drugInfos = new System.Collections.Generic.HashSet<DrugInfo>(); _offenceInfos = new System.Collections.Generic.HashSet<OffenceInfo>(); _rCriminalLegislationInfos = new System.Collections.Generic.HashSet<RCriminalLegislationInfo>(); _sentenceInfos = new System.Collections.Generic.HashSet<SentenceInfo>(); }
/// <summary>Initializes a new instance of the <see cref="RefOrderDetail"/> class.</summary> public RefOrderDetail() : base() { _paymentInDocDetails = new System.Collections.Generic.HashSet<PaymentInDocDetail>(); _paymentOutDocDetails = new System.Collections.Generic.HashSet<PaymentOutDocDetail>(); _serviceOfDocInfos = new System.Collections.Generic.HashSet<ServiceOfDocInfo>(); _notPaymenttoCourtDocDetails = new System.Collections.Generic.HashSet<NotPaymentToCourtDocDetail>(); }
/// <summary>Initializes a new instance of the <see cref="EMSAdmProperty"/> class.</summary> public EMSAdmProperty() : base() { _eMSSales = new System.Collections.Generic.HashSet<EMSSale>(); _eMSAdmExecs = new System.Collections.Generic.HashSet<EMSAdmExec>(); _eMSAdmReleases = new System.Collections.Generic.HashSet<EMSAdmRelease>(); _eMSAdmPropertyLists = new System.Collections.Generic.HashSet<EMSAdmPropertyList>(); }
/// <summary>Initializes a new instance of the <see cref="MRace"/> class.</summary> public MRace() : base() { _caseParties = new System.Collections.Generic.HashSet<CaseParty>(); _childInfos = new System.Collections.Generic.HashSet<ChildInfo>(); _infantInfos = new System.Collections.Generic.HashSet<InfantInfo>(); _docCaseParties = new System.Collections.Generic.HashSet<DocCaseParty>(); }
/// <summary>Initializes a new instance of the <see cref="EMSSale"/> class.</summary> public EMSSale() : base() { _eMSSaleAdverts = new System.Collections.Generic.HashSet<EMSSaleAdvert>(); _eMSSaleAppraisers = new System.Collections.Generic.HashSet<EMSSaleAppraiser>(); _eMSSaleAgents = new System.Collections.Generic.HashSet<EMSSaleAgent>(); _eMSSaleBuyers = new System.Collections.Generic.HashSet<EMSSaleBuyer>(); _eMSAdmClaims = new System.Collections.Generic.HashSet<EMSAdmClaim>(); }
/// <summary>Initializes a new instance of the <see cref="LACInfo"/> class.</summary> public LACInfo() : base() { _casePartyLACDetails = new System.Collections.Generic.HashSet<CasePartyLACDetail>(); _casePartyLACDetailsHistories = new System.Collections.Generic.HashSet<CasePartyLACDetailsHistory>(); _docCasePartyLACDetails = new System.Collections.Generic.HashSet<DocCasePartyLACDetail>(); _lACCancellationInfos = new System.Collections.Generic.HashSet<LACCancellationInfo>(); _lACDocumentDetails = new System.Collections.Generic.HashSet<LACDocumentDetail>(); }
/// <summary>Initializes a new instance of the <see cref="CriminalClaimInfo"/> class.</summary> public CriminalClaimInfo() : base() { _criminalClaimHonorariumInfos = new System.Collections.Generic.HashSet<CriminalClaimHonorariumInfo>(); _criminalClaimInterpreterFeeInfos = new System.Collections.Generic.HashSet<CriminalClaimInterpreterFeeInfo>(); _criminalClaimMiscellaneousInfos = new System.Collections.Generic.HashSet<CriminalClaimMiscellaneousInfo>(); _criminalClaimProfessionalFeeInfos = new System.Collections.Generic.HashSet<CriminalClaimProfessionalFeeInfo>(); _criminalClaimWitnessInfos = new System.Collections.Generic.HashSet<CriminalClaimWitnessInfo>(); }
/// <summary>Initializes a new instance of the <see cref="MDocCode"/> class.</summary> public MDocCode() : base() { _checkListSubmissions = new System.Collections.Generic.HashSet<CheckListSubmission>(); _documentInfos = new System.Collections.Generic.HashSet<DocumentInfo>(); _mDocControls = new System.Collections.Generic.HashSet<MDocControl>(); _rMCDRAutoFixTimeLines = new System.Collections.Generic.HashSet<RMCDRAutoFixTimeLine>(); _rMDocCodeLawfirmGroups = new System.Collections.Generic.HashSet<RMDocCodeLawfirmGroup>(); _rMDocCodePCConditions = new System.Collections.Generic.HashSet<RMDocCodePCCondition>(); }
/// <summary>Initializes a new instance of the <see cref="Solicitor"/> class.</summary> public Solicitor() : base() { _caseSolicitors = new System.Collections.Generic.HashSet<CaseSolicitor>(); _caseSolicitorHistories = new System.Collections.Generic.HashSet<CaseSolicitorHistory>(); _docCaseSolicitors = new System.Collections.Generic.HashSet<DocCaseSolicitor>(); _lABPartySolicitors = new System.Collections.Generic.HashSet<LABPartySolicitor>(); _lABPartySolicitorHistories = new System.Collections.Generic.HashSet<LABPartySolicitorHistory>(); //_lACUmbrellaUsers = new System.Collections.Generic.HashSet<LACUmbrellaUser>(); }
/// <summary>Initializes a new instance of the <see cref="MCurrency"/> class.</summary> public MCurrency() : base() { _bankruptcyInfos = new System.Collections.Generic.HashSet<BankruptcyInfo>(); _liquidatedClaims = new System.Collections.Generic.HashSet<LiquidatedClaim>(); _documentInfos = new System.Collections.Generic.HashSet<DocumentInfo>(); _paymentInDocDetails = new System.Collections.Generic.HashSet<PaymentInDocDetail>(); _paymentInDocFSDetails = new System.Collections.Generic.HashSet<PaymentInDocFSDetail>(); _notPaymenttoCourtDocDetails = new System.Collections.Generic.HashSet<NotPaymentToCourtDocDetail>(); }
/// <summary>Initializes a new instance of the <see cref="MForumType"/> class.</summary> public MForumType() : base() { _caseInfos = new System.Collections.Generic.HashSet<CaseInfo>(); _caveatInfos = new System.Collections.Generic.HashSet<CaveatInfo>(); _documentInfos = new System.Collections.Generic.HashSet<DocumentInfo>(); _mHRGBeforeTypes = new System.Collections.Generic.HashSet<MHRGBeforeType>(); _mRulesOfCourtOrders = new System.Collections.Generic.HashSet<MRulesOfCourtOrder>(); _rMNOAForumHrgTypes = new System.Collections.Generic.HashSet<RMNOAForumHrgType>(); }
/// <summary>Initializes a new instance of the <see cref="LABParty"/> class.</summary> public LABParty() : base() { _lABPartyAddresses = new System.Collections.Generic.HashSet<LABPartyAddress>(); _lABPartyAddressHistories = new System.Collections.Generic.HashSet<LABPartyAddressHistory>(); _lABPartyHistories = new System.Collections.Generic.HashSet<LABPartyHistory>(); _lABPartySolicitors = new System.Collections.Generic.HashSet<LABPartySolicitor>(); _lABPartySolicitorHistories = new System.Collections.Generic.HashSet<LABPartySolicitorHistory>(); _lACInfos = new System.Collections.Generic.HashSet<LACInfo>(); }
} // WorkOrderRouting.FK_WorkOrderRouting_Location_LocationID public Production_Location() { ModifiedDate = System.DateTime.Now; Production_ProductInventories = new System.Collections.Generic.List <Production_ProductInventory>(); Production_WorkOrderRoutings = new System.Collections.Generic.List <Production_WorkOrderRouting>(); }
private System.Collections.Generic.IList <Department> GetDepart(System.Collections.Generic.IList <long> id, System.Collections.Generic.ICollection <Department> departList) { System.Collections.Generic.IList <long> ID = new System.Collections.Generic.List <long>(); if (id.Count > 0) { foreach (long lg in id) { foreach (Department dep in departList) { if (dep.Pid == lg) { this.GetClickdepart.Add(dep); ID.Add(dep.Id); } } } this.GetDepart(ID, departList); } return(this.GetClickdepart); }
} // FactResellerSales.FK_FactResellerSales_DimPromotion public DimPromotion() { FactInternetSales = new System.Collections.Generic.List <FactInternetSale>(); FactResellerSales = new System.Collections.Generic.List <FactResellerSale>(); }
public static void SetListContent <P, D>(P prefab, Transform parent, List <P> itemList, System.Collections.Generic.ICollection <D> dataList, SetDataContentFunc <P, D> setContentFunc, int start = 0, int count = 0) where P : MonoBehaviour { SetListContent <P, D>(prefab, parent, itemList, dataList, null, setContentFunc, start, count); }
/// <summary> /// Implementation of the command binding event for the IFC export command. /// </summary> /// <param name="sender">The event sender (Revit UIApplication).</param> /// <param name="args">The arguments (command binding).</param> public void OnIFCExport(object sender, CommandEventArgs args) { try { // Prepare basic objects UIApplication uiApp = sender as UIApplication; UIDocument uiDoc = uiApp.ActiveUIDocument; Document activeDoc = uiDoc.Document; TheDocument = activeDoc; // Note that when exporting multiple documents, we are still going to use the configurations from the // active document. IFCExportConfigurationsMap configurationsMap = new IFCExportConfigurationsMap(); configurationsMap.Add(IFCExportConfiguration.GetInSession()); configurationsMap.AddBuiltInConfigurations(); configurationsMap.AddSavedConfigurations(); String mruSelection = null; if (m_mruConfiguration != null && configurationsMap.HasName(m_mruConfiguration)) { mruSelection = m_mruConfiguration; } PotentiallyUpdatedConfigurations = false; IFCExport mainWindow = new IFCExport(uiApp, configurationsMap, mruSelection); mainWindow.ShowDialog(); // If user chose to continue if (mainWindow.Result == IFCExportResult.ExportAndSaveSettings) { int docsToExport = mainWindow.DocumentsToExport.Count; // This shouldn't happen, but just to be safe. if (docsToExport == 0) { return; } bool multipleFiles = docsToExport > 1; // prompt for the file name SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.AddExtension = true; String defaultDirectory = m_mruExportPath != null ? m_mruExportPath : null; if (defaultDirectory == null) { String revitFilePath = TheDocument.PathName; if (!String.IsNullOrEmpty(revitFilePath)) { defaultDirectory = Path.GetDirectoryName(revitFilePath); } } if ((defaultDirectory == null) || (!System.IO.Directory.Exists(defaultDirectory))) { defaultDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); } string defaultExt = mainWindow.GetFileExtension(); fileDialog.FileName = multipleFiles ? Properties.Resources.MultipleFiles : GenerateFileNameFromDocument(mainWindow.DocumentsToExport[0], null); fileDialog.DefaultExt = defaultExt; fileDialog.Filter = mainWindow.GetFileFilter(); fileDialog.InitialDirectory = defaultDirectory; bool?fileDialogResult = fileDialog.ShowDialog(); // If user chooses to continue if (fileDialogResult.HasValue && fileDialogResult.Value) { // change options IFCExportConfiguration selectedConfig = mainWindow.GetSelectedConfiguration(); // Prompt the user for the file location and path String fullName = fileDialog.FileName; String path = Path.GetDirectoryName(fullName); String fileName = multipleFiles ? string.Empty : Path.GetFileName(fullName); // This option should be rarely used, and is only for consistency with old files. As such, it is set by environment variable only. String use2009GUID = Environment.GetEnvironmentVariable("Assign2009GUIDToBuildingStoriesOnIFCExport"); bool use2009BuildingStoreyGUIDs = (use2009GUID != null && use2009GUID == "1"); string unsuccesfulExports = string.Empty; // In rare occasions, there may be two projects loaded into Revit with the same name. This isn't supposed to be allowed, but can happen if, // e.g., a user creates a new project, exports it to IFC, and then calls Open IFC. In this case, if we export both projects, we will overwrite // one of the exports. Prevent that by keeping track of the exported file names. ISet <string> exportedFileNames = new HashSet <string>(); foreach (Document document in mainWindow.DocumentsToExport) { TheDocument = document; // Call this before the Export IFC transaction starts, as it has its own transaction. IFCClassificationMgr.DeleteObsoleteSchemas(document); Transaction transaction = new Transaction(document, "Export IFC"); transaction.Start(); FailureHandlingOptions failureOptions = transaction.GetFailureHandlingOptions(); failureOptions.SetClearAfterRollback(false); transaction.SetFailureHandlingOptions(failureOptions); // Normally the transaction will be rolled back, but there are cases where we do update the document. // There is no UI option for this, but these two options can be useful for debugging/investigating // issues in specific file export. The first one supports export of only one element //exportOptions.AddOption("SingleElement", "174245"); // The second one supports export only of a list of elements //exportOptions.AddOption("ElementsForExport", "174245;205427"); if (multipleFiles) { fileName = GenerateFileNameFromDocument(document, exportedFileNames) + "." + defaultExt; fullName = path + "\\" + fileName; } // Prepare the export options IFCExportOptions exportOptions = new IFCExportOptions(); ElementId activeViewId = GenerateActiveViewIdFromDocument(document); selectedConfig.ActiveViewId = selectedConfig.UseActiveViewGeometry ? activeViewId.IntegerValue : -1; selectedConfig.UpdateOptions(exportOptions, activeViewId); bool result = document.Export(path, fileName, exportOptions); Dictionary <ElementId, string> linksGUIDsCache = new Dictionary <ElementId, string>(); if (result) { // Cache for links guids if (selectedConfig.ExportLinkedFiles == true) { Autodesk.Revit.DB.FilteredElementCollector collector = new FilteredElementCollector(document); collector.WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_RvtLinks); System.Collections.Generic.ICollection <ElementId> rvtLinkInstanceIds = collector.ToElementIds(); foreach (ElementId linkId in rvtLinkInstanceIds) { Element linkInstance = document.GetElement(linkId); if (linkInstance == null) { continue; } Parameter parameter = linkInstance.get_Parameter(BuiltInParameter.IFC_GUID); if (parameter != null && parameter.HasValue && parameter.StorageType == StorageType.String) { String sGUID = parameter.AsString(), sGUIDlower = sGUID.ToLower(); foreach (KeyValuePair <ElementId, string> value in linksGUIDsCache) { if (value.Value.ToLower().IndexOf(sGUIDlower) == 0) { sGUID += "-"; } } linksGUIDsCache.Add(linkInstance.Id, sGUID); } } } } else { unsuccesfulExports += fullName + "\n"; } // Roll back the transaction started earlier, unless certain options are set. if (result && (use2009BuildingStoreyGUIDs || selectedConfig.StoreIFCGUID)) { transaction.Commit(); } else { transaction.RollBack(); } // Export links if (selectedConfig.ExportLinkedFiles == true) { exportOptions.AddOption("ExportingLinks", true.ToString()); ExportLinkedDocuments(document, fullName, linksGUIDsCache, exportOptions); exportOptions.AddOption("ExportingLinks", false.ToString()); } } if (!string.IsNullOrWhiteSpace(unsuccesfulExports)) { using (TaskDialog taskDialog = new TaskDialog(Properties.Resources.IFCExport)) { taskDialog.MainInstruction = string.Format(Properties.Resources.IFCExportProcessError, unsuccesfulExports); taskDialog.MainIcon = TaskDialogIcon.TaskDialogIconWarning; TaskDialogResult taskDialogResult = taskDialog.Show(); } } // Remember last successful export location m_mruExportPath = path; } } // The cancel button should cancel the export, not any "OK"ed setup changes. if (mainWindow.Result == IFCExportResult.ExportAndSaveSettings || mainWindow.Result == IFCExportResult.Cancel) { if (PotentiallyUpdatedConfigurations) { configurationsMap = mainWindow.GetModifiedConfigurations(); configurationsMap.UpdateSavedConfigurations(); } // Remember last selected configuration m_mruConfiguration = mainWindow.GetSelectedConfiguration().Name; } } catch (Exception e) { using (TaskDialog taskDialog = new TaskDialog(Properties.Resources.IFCExport)) { taskDialog.MainInstruction = Properties.Resources.IFCExportProcessGenericError; taskDialog.MainIcon = TaskDialogIcon.TaskDialogIconWarning; taskDialog.ExpandedContent = e.ToString(); TaskDialogResult result = taskDialog.Show(); } } }
/// <summary> /// External Event Implementation /// </summary> /// <param name="app"></param> public void Execute(UIApplication app) { try { UIDocument uidoc = app.ActiveUIDocument; Document doc = uidoc.Document; //Selection m_elementsToHide = uidoc.Selection; //SelElementSet.Create(); List <ElementId> elementsToBeIsolated = new List <ElementId>(); List <ElementId> elementsToBeHidden = new List <ElementId>(); List <ElementId> elementsToBeSelected = new List <ElementId>(); // IS ORTHOGONAL if (v.OrthogonalCamera != null) { if (v.OrthogonalCamera.ViewToWorldScale == null || v.OrthogonalCamera.CameraViewPoint == null || v.OrthogonalCamera.CameraUpVector == null || v.OrthogonalCamera.CameraDirection == null) { return; } //type = "OrthogonalCamera"; var zoom = UnitUtils.ConvertToInternalUnits(v.OrthogonalCamera.ViewToWorldScale, DisplayUnitType.DUT_METERS); var CameraDirection = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.OrthogonalCamera.CameraDirection.X, v.OrthogonalCamera.CameraDirection.Y, v.OrthogonalCamera.CameraDirection.Z); var CameraUpVector = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.OrthogonalCamera.CameraUpVector.X, v.OrthogonalCamera.CameraUpVector.Y, v.OrthogonalCamera.CameraUpVector.Z); var CameraViewPoint = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.OrthogonalCamera.CameraViewPoint.X, v.OrthogonalCamera.CameraViewPoint.Y, v.OrthogonalCamera.CameraViewPoint.Z); var orient3d = ARUP.IssueTracker.Revit.Classes.Utils.ConvertBasePoint(doc, CameraViewPoint, CameraDirection, CameraUpVector, true); View3D orthoView = null; //if active view is 3d ortho use it if (doc.ActiveView.ViewType == ViewType.ThreeD) { View3D ActiveView3D = doc.ActiveView as View3D; if (!ActiveView3D.IsPerspective) { orthoView = ActiveView3D; } } if (orthoView == null) { IEnumerable <View3D> viewcollector3D = get3DViews(doc); //try to use default 3D view if (viewcollector3D.Any() && viewcollector3D.Where(o => o.Name == "{3D}" || o.Name == "BCFortho").Any()) { orthoView = viewcollector3D.Where(o => o.Name == "{3D}" || o.Name == "BCFortho").First(); } } using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Open orthogonal view") == TransactionStatus.Started) { //create a new 3d ortho view if (orthoView == null) { orthoView = View3D.CreateIsometric(doc, getFamilyViews(doc).First().Id); orthoView.Name = "BCFortho"; } orthoView.DisableTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate); orthoView.SetOrientation(orient3d); trans.Commit(); } } uidoc.ActiveView = orthoView; //adjust view rectangle // **** CUSTOM VALUE FOR TEKLA **** // // double x = touple.Item2 // **** CUSTOM VALUE FOR TEKLA **** // double customZoomValue = (MyProjectSettings.Get("useDefaultZoom", doc.PathName) == "1") ? 1 : 2.5; double x = zoom / customZoomValue; XYZ m_xyzTl = uidoc.ActiveView.Origin.Add(uidoc.ActiveView.UpDirection.Multiply(x)).Subtract(uidoc.ActiveView.RightDirection.Multiply(x)); XYZ m_xyzBr = uidoc.ActiveView.Origin.Subtract(uidoc.ActiveView.UpDirection.Multiply(x)).Add(uidoc.ActiveView.RightDirection.Multiply(x)); uidoc.GetOpenUIViews().First().ZoomAndCenterRectangle(m_xyzTl, m_xyzBr); } else if (v.PerspectiveCamera != null) { if (v.PerspectiveCamera.FieldOfView == null || v.PerspectiveCamera.CameraViewPoint == null || v.PerspectiveCamera.CameraUpVector == null || v.PerspectiveCamera.CameraDirection == null) { return; } var zoom = v.PerspectiveCamera.FieldOfView; double z1 = 18 / Math.Tan(zoom / 2 * Math.PI / 180); //focale 1 double z = 18 / Math.Tan(25 / 2 * Math.PI / 180); //focale, da controllare il 18, vedi PDF double factor = z1 - z; var CameraDirection = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.PerspectiveCamera.CameraDirection.X, v.PerspectiveCamera.CameraDirection.Y, v.PerspectiveCamera.CameraDirection.Z); var CameraUpVector = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.PerspectiveCamera.CameraUpVector.X, v.PerspectiveCamera.CameraUpVector.Y, v.PerspectiveCamera.CameraUpVector.Z); XYZ oldO = ARUP.IssueTracker.Revit.Classes.Utils.GetXYZ(v.PerspectiveCamera.CameraViewPoint.X, v.PerspectiveCamera.CameraViewPoint.Y, v.PerspectiveCamera.CameraViewPoint.Z); var CameraViewPoint = (oldO.Subtract(CameraDirection.Divide(factor))); var orient3d = ARUP.IssueTracker.Revit.Classes.Utils.ConvertBasePoint(doc, CameraViewPoint, CameraDirection, CameraUpVector, true); View3D perspView = null; IEnumerable <View3D> viewcollector3D = get3DViews(doc); if (viewcollector3D.Any() && viewcollector3D.Where(o => o.Name == "BCFpersp").Any()) { perspView = viewcollector3D.Where(o => o.Name == "BCFpersp").First(); } using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Open perspective view") == TransactionStatus.Started) { if (null == perspView) { perspView = View3D.CreatePerspective(doc, getFamilyViews(doc).First().Id); perspView.Name = "BCFpersp"; } perspView.DisableTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate); perspView.SetOrientation(orient3d); // turn on the far clip plane with standard parameter API if (perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_ACTIVE_FAR).HasValue) { Parameter m_farClip = perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_ACTIVE_FAR); m_farClip.Set(1); } // reset far clip offset if (perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_OFFSET_FAR).HasValue) { Parameter m_farClipOffset = perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_OFFSET_FAR); m_farClipOffset.SetValueString("35"); } // turn off the far clip plane with standard parameter API if (perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_ACTIVE_FAR).HasValue) { Parameter m_farClip = perspView.get_Parameter(BuiltInParameter.VIEWER_BOUND_ACTIVE_FAR); m_farClip.Set(0); } perspView.CropBoxActive = true; perspView.CropBoxVisible = true; trans.Commit(); } } uidoc.ActiveView = perspView; } else if (v.SheetCamera != null)//sheet { //using (Transaction trans = new Transaction(uidoc.Document)) //{ // if (trans.Start("Open sheet view") == TransactionStatus.Started) // { IEnumerable <View> viewcollectorSheet = getSheets(doc, v.SheetCamera.SheetID); if (!viewcollectorSheet.Any()) { MessageBox.Show("No Sheet with Id=" + v.SheetCamera.SheetID + " found."); return; } uidoc.ActiveView = viewcollectorSheet.First(); uidoc.ActiveView.DisableTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate); uidoc.RefreshActiveView(); // trans.Commit(); // } //} XYZ m_xyzTl = new XYZ(v.SheetCamera.TopLeft.X, v.SheetCamera.TopLeft.Y, v.SheetCamera.TopLeft.Z); XYZ m_xyzBr = new XYZ(v.SheetCamera.BottomRight.X, v.SheetCamera.BottomRight.Y, v.SheetCamera.BottomRight.Z); uidoc.GetOpenUIViews().First().ZoomAndCenterRectangle(m_xyzTl, m_xyzBr); } else { return; } //apply BCF clipping planes to Revit section box View3D view3D = doc.ActiveView as View3D; if (view3D != null) { if (v.ClippingPlanes != null) { if (v.ClippingPlanes.Count() > 0) { var result = getBoundingBoxFromClippingPlanes(doc, v.ClippingPlanes); if (result != null) { BoundingBoxXYZ computedBox = result.Item1; Transform rotate = result.Item2; using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Apply Section Box") == TransactionStatus.Started) { view3D.IsSectionBoxActive = true; view3D.SetSectionBox(computedBox); if (rotate != null) { // Transform the View3D's section box with the rotation transform computedBox.Transform = computedBox.Transform.Multiply(rotate); // Set the section box back to the view (requires an open transaction) view3D.SetSectionBox(computedBox); } } trans.Commit(); } } } } } //select/hide elements if (v.Components != null && v.Components.Any()) { if (v.Components.Count > 100) { var result = MessageBox.Show("Too many elements attached. It may take for a while to isolate/select them. Do you want to continue?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result == MessageBoxResult.No) { uidoc.RefreshActiveView(); return; } } FilteredElementCollector collector = new FilteredElementCollector(doc, doc.ActiveView.Id).WhereElementIsNotElementType(); System.Collections.Generic.ICollection <ElementId> collection = collector.ToElementIds(); foreach (var e in v.Components) { var bcfguid = IfcGuid.FromIfcGUID(e.IfcGuid); int authoringToolId = string.IsNullOrWhiteSpace(e.AuthoringToolId) ? -1 : int.Parse(e.AuthoringToolId); var ids = collection.Where(o => bcfguid == ExportUtils.GetExportId(doc, o) | authoringToolId == Convert.ToInt32(doc.GetElement(o).UniqueId.Substring(37), 16)); if (ids.Any()) { // handle visibility if (e.Visible) { elementsToBeIsolated.Add(ids.First()); } else { elementsToBeHidden.Add(ids.First()); } // handle selection if (e.Selected) { elementsToBeSelected.Add(ids.First()); } } } if (elementsToBeHidden.Count > 0) { using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Hide Elements") == TransactionStatus.Started) { uidoc.ActiveView.HideElementsTemporary(elementsToBeHidden); } trans.Commit(); } } else if (elementsToBeIsolated.Count > 0) { using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Isolate Elements") == TransactionStatus.Started) { uidoc.ActiveView.IsolateElementsTemporary(elementsToBeIsolated); } trans.Commit(); } } if (elementsToBeSelected.Count > 0) { using (Transaction trans = new Transaction(uidoc.Document)) { if (trans.Start("Select Elements") == TransactionStatus.Started) { uidoc.Selection.SetElementIds(elementsToBeSelected); } trans.Commit(); } } } uidoc.RefreshActiveView(); } catch (Exception ex) { TaskDialog.Show("Error!", "exception: " + ex); } }
} // ProductModelProductDescriptionCulture.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID public Production_ProductDescription() { Rowguid = System.Guid.NewGuid(); ModifiedDate = System.DateTime.Now; Production_ProductModelProductDescriptionCultures = new System.Collections.Generic.List <Production_ProductModelProductDescriptionCulture>(); }
} // EmployeeDepartmentHistory.FK_EmployeeDepartmentHistory_Department_DepartmentID public HumanResources_Department() { ModifiedDate = System.DateTime.Now; HumanResources_EmployeeDepartmentHistories = new System.Collections.Generic.List <HumanResources_EmployeeDepartmentHistory>(); }
public void SetStatus(System.Collections.Generic.ICollection <string> statusMessages) { }
public FornecedorViewModel() { DataCriacao = System.DateTime.Now; Estoque = new System.Collections.Generic.List <Estoque>(); }
} // SalesOrderHeader.FK_SalesOrderHeader_CreditCard_CreditCardID public Sales_CreditCard() { ModifiedDate = System.DateTime.Now; Sales_PersonCreditCards = new System.Collections.Generic.List <Sales_PersonCreditCard>(); Sales_SalesOrderHeaders = new System.Collections.Generic.List <Sales_SalesOrderHeader>(); }
protected Collection(System.Collections.Generic.ICollection <T> collection) { _collection = collection; }
static void Main(string[] args) { MultiDictionary <int, string> dictionary = new MultiDictionary <int, string>(); dictionary.Add(1, "one"); dictionary.Add(2, "two"); dictionary.Add(3, "three"); dictionary.Add(1, "ich"); dictionary.Add(2, "nee"); dictionary.Add(3, "sun"); ICollection <string> values1 = dictionary.Values; StringBuilder sb = new StringBuilder(); if (dictionary.Count > 0) { Console.WriteLine("complete list:"); Console.WriteLine(); int i = 1; iter = dictionary.GetEnumerator(); while (iter.MoveNext()) { sb.Append("Key: "); sb.Append(iter.Current.Key.ToString()); sb.Append(" Value: "); sb.Append(iter.Current.Value.ToString()); Console.WriteLine(sb.ToString()); i++; sb.Clear(); } Console.WriteLine(); } System.Collections.Generic.ICollection <int> keys = dictionary.Keys; ICollection <string> values2 = dictionary.Values; bool test = dictionary.Contains(3, "three"); bool test2 = dictionary.Remove(3, "three"); bool test3 = dictionary.Contains(3, "three"); Console.WriteLine(); Console.WriteLine("list after removing {3,three}"); iter = dictionary.GetEnumerator(); if (dictionary.Count > 0) { int i = 1; while (iter.MoveNext()) { sb.Append("Key: "); sb.Append(iter.Current.Key.ToString()); sb.Append(" Value: "); sb.Append(iter.Current.Value.ToString()); Console.WriteLine(sb.ToString()); i++; sb.Clear(); } } Console.WriteLine(); bool test4 = dictionary.Remove(3); bool test5 = dictionary.Contains(3, "sun"); Console.WriteLine("list after removing key number 3:"); Console.WriteLine(); iter = dictionary.GetEnumerator(); if (dictionary.Count > 0) { int i = 1; while (iter.MoveNext()) { sb.Append("Key: "); sb.Append(iter.Current.Key.ToString()); sb.Append(" Value: "); sb.Append(iter.Current.Value.ToString()); Console.WriteLine(sb.ToString()); i++; sb.Clear(); } } }
} // BusinessEntityContact.FK_BusinessEntityContact_ContactType_ContactTypeID public Person_ContactType() { ModifiedDate = System.DateTime.Now; Person_BusinessEntityContacts = new System.Collections.Generic.List <Person_BusinessEntityContact>(); }
public void SetStatus(System.Collections.Generic.ICollection <string> statusMessages) { //InfoMessagesPanel.Text = string.Join("<br>", new List<string>(statusMessages).ToArray()); }
/// <summary>The subSpans are ordered in the same doc, so there is a possible match. /// Compute the slop while making the match as short as possible by advancing /// all subSpans except the last one in reverse order. /// </summary> private bool ShrinkToAfterShortestMatch() { matchStart = subSpans[subSpans.Length - 1].Start(); matchEnd = subSpans[subSpans.Length - 1].End(); System.Collections.Generic.Dictionary <byte[], byte[]> possibleMatchPayloads = new System.Collections.Generic.Dictionary <byte[], byte[]>(); if (subSpans[subSpans.Length - 1].IsPayloadAvailable()) { System.Collections.Generic.ICollection <byte[]> payload = subSpans[subSpans.Length - 1].GetPayload(); foreach (byte[] pl in payload) { if (!possibleMatchPayloads.ContainsKey(pl)) { possibleMatchPayloads.Add(pl, pl); } } } System.Collections.Generic.List <byte[]> possiblePayload = null; int matchSlop = 0; int lastStart = matchStart; int lastEnd = matchEnd; for (int i = subSpans.Length - 2; i >= 0; i--) { Spans prevSpans = subSpans[i]; if (collectPayloads && prevSpans.IsPayloadAvailable()) { System.Collections.Generic.ICollection <byte[]> payload = prevSpans.GetPayload(); possiblePayload = new System.Collections.Generic.List <byte[]>(payload.Count); possiblePayload.AddRange(payload); } int prevStart = prevSpans.Start(); int prevEnd = prevSpans.End(); while (true) { // Advance prevSpans until after (lastStart, lastEnd) if (!prevSpans.Next()) { inSameDoc = false; more = false; break; // Check remaining subSpans for final match. } else if (matchDoc != prevSpans.Doc()) { inSameDoc = false; // The last subSpans is not advanced here. break; // Check remaining subSpans for last match in this document. } else { int ppStart = prevSpans.Start(); int ppEnd = prevSpans.End(); // Cannot avoid invoking .end() if (!DocSpansOrdered(ppStart, ppEnd, lastStart, lastEnd)) { break; // Check remaining subSpans. } else { // prevSpans still before (lastStart, lastEnd) prevStart = ppStart; prevEnd = ppEnd; if (collectPayloads && prevSpans.IsPayloadAvailable()) { System.Collections.Generic.ICollection <byte[]> payload = prevSpans.GetPayload(); possiblePayload = new System.Collections.Generic.List <byte[]>(payload.Count); possiblePayload.AddRange(payload); } } } } if (collectPayloads && possiblePayload != null) { foreach (byte[] pl in possiblePayload) { if (!possibleMatchPayloads.ContainsKey(pl)) { possibleMatchPayloads.Add(pl, pl); } } } System.Diagnostics.Debug.Assert(prevStart <= matchStart); if (matchStart > prevEnd) { // Only non overlapping spans add to slop. matchSlop += (matchStart - prevEnd); } /* Do not break on (matchSlop > allowedSlop) here to make sure * that subSpans[0] is advanced after the match, if any. */ matchStart = prevStart; lastStart = prevStart; lastEnd = prevEnd; } bool match = matchSlop <= allowedSlop; if (collectPayloads && match && possibleMatchPayloads.Count > 0) { matchPayload.AddRange(possibleMatchPayloads.Keys); } return(match); // ordered and allowed slop }
private void InitData() { this.stafflist = this.dataService.GetStaffList(); this.groups = this.dataService.GetEntGroupList(); }
} // BusinessEntityAddress.FK_BusinessEntityAddress_AddressType_AddressTypeID public Person_AddressType() { Rowguid = System.Guid.NewGuid(); ModifiedDate = System.DateTime.Now; Person_BusinessEntityAddresses = new System.Collections.Generic.List <Person_BusinessEntityAddress>(); }
/// <summary> /// 修改表内所有字段 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entities"></param> /// <returns></returns> public virtual Task <int> UpdateEntityList <T>(System.Collections.Generic.ICollection <T> entities) where T : class { GetDbSet <T>().UpdateRange(entities.ToArray()); return(SaveChangesAsync()); }
public static void SetListContent <P, D>(P prefab, Transform parent, List <P> itemList, System.Collections.Generic.ICollection <D> dataList, IsItemEnabledFunc <P, D> isItemEnabledFunc, SetDataContentFunc <P, D> setContentFunc, int start = 0, int count = 0) where P : MonoBehaviour { if (itemList == null) { return; } if (dataList == null) { foreach (var item in itemList) { item.gameObject.SetActive(false); } } else { if (count == 0 || (start + count) > dataList.Count) { count = dataList.Count - start; } while (itemList.Count < count) { itemList.Add(AddChild(parent, prefab)); } var emu = dataList.GetEnumerator(); for (int i = 0; i < start && emu.MoveNext(); ++i) { } for (int i = 0; i < itemList.Count; ++i) { if (emu.MoveNext()) { int index = start + i; var item = itemList[i]; var data = emu.Current; if (isItemEnabledFunc != null) { if (!isItemEnabledFunc(index, data)) { item.gameObject.SetActive(false); continue; } } itemList[i].gameObject.SetActive(true); if (setContentFunc != null) { setContentFunc(index, item, data); } } else { itemList[i].gameObject.SetActive(false); } } } }
public Resposta() { TbAtividades = new System.Collections.Generic.List <Atividade>(); }
} // Many to many mapping public AspNetRole() { AspNetUsers = new System.Collections.Generic.List <AspNetUser>(); }
} // UserSubscriptions.FK_dbo.UserSubscriptions.AspNetUsers_UserId public AppointmentDiary() { StatusEnum = 0; UserSubscriptions = new System.Collections.Generic.List <UserSubscription>(); }
} // CanBo.FK_CanBo_DanToc public dmKieuCanBo() { IsDeleted = false; CanBo = new System.Collections.Generic.List <CanBo>(); }
public void MusicTagsChanged(System.Collections.Generic.ICollection <int> newTags, Data.TagCategoryCombination categoryCombination, int fadeTime) { }
/// <summary> /// Generate Viewpoint /// </summary> /// <param name="elemCheck"></param> /// <returns></returns> public VisualizationInfo generateViewpoint(int elemCheck) { try { UIDocument uidoc = uiapp.ActiveUIDocument; Document doc = uidoc.Document; VisualizationInfo v = new VisualizationInfo(); XYZ centerIMP = new XYZ(); string type = ""; double zoomValue = 1; if (uidoc.ActiveView.ViewType != ViewType.ThreeD) //is a 2D view { XYZ TL = uidoc.GetOpenUIViews()[0].GetZoomCorners()[0]; XYZ BR = uidoc.GetOpenUIViews()[0].GetZoomCorners()[1]; v.SheetCamera = new SheetCamera(); v.SheetCamera.SheetID = uidoc.ActiveView.Id.IntegerValue; v.SheetCamera.TopLeft = new IssueTracker.Classes.BCF2.Point(TL.X, TL.Y, TL.Z); v.SheetCamera.BottomRight = new IssueTracker.Classes.BCF2.Point(BR.X, BR.Y, BR.Z); } else { View3D view3D = (View3D)uidoc.ActiveView; if (!view3D.IsPerspective) //IS ORTHO { XYZ TL = uidoc.GetOpenUIViews()[0].GetZoomCorners()[0]; XYZ BR = uidoc.GetOpenUIViews()[0].GetZoomCorners()[1]; double xO = (TL.X + BR.X) / 2; double yO = (TL.Y + BR.Y) / 2; double zO = (TL.Z + BR.Z) / 2; //converto to METERS centerIMP = new XYZ(xO, yO, zO); double dist = TL.DistanceTo(BR) / 2; //custom sectet value to get solibri zoom value from Corners of Revit UiView XYZ diagVector = TL.Subtract(BR); // **** CUSTOM VALUE FOR TEKLA **** // //zoomValue = UnitUtils.ConvertFromInternalUnits(dist * Math.Sin(diagVector.AngleTo(view3D.RightDirection)), DisplayUnitType.DUT_METERS); // **** CUSTOM VALUE FOR TEKLA **** // double customZoomValue = (MyProjectSettings.Get("useDefaultZoom", doc.PathName) == "1") ? 1 : 2.5; zoomValue = UnitUtils.ConvertFromInternalUnits(dist * Math.Sin(diagVector.AngleTo(view3D.RightDirection)), DisplayUnitType.DUT_METERS) * customZoomValue; type = "OrthogonalCamera"; } else // it is a perspective view { centerIMP = uidoc.ActiveView.Origin; type = "PerspectiveCamera"; zoomValue = 45; } ViewOrientation3D t = ConvertBasePoint(centerIMP, uidoc.ActiveView.ViewDirection, uidoc.ActiveView.UpDirection, false); //ViewOrientation3D t = new ViewOrientation3D(centerIMP, uidoc.ActiveView.UpDirection, uidoc.ActiveView.ViewDirection); XYZ c = t.EyePosition; XYZ vi = t.ForwardDirection; XYZ up = t.UpDirection; if (type == "OrthogonalCamera") { v.OrthogonalCamera = new OrthogonalCamera(); v.OrthogonalCamera.CameraViewPoint.X = UnitUtils.ConvertFromInternalUnits(c.X, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraViewPoint.Y = UnitUtils.ConvertFromInternalUnits(c.Y, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraViewPoint.Z = UnitUtils.ConvertFromInternalUnits(c.Z, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraUpVector.X = UnitUtils.ConvertFromInternalUnits(up.X, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraUpVector.Y = UnitUtils.ConvertFromInternalUnits(up.Y, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraUpVector.Z = UnitUtils.ConvertFromInternalUnits(up.Z, DisplayUnitType.DUT_METERS); v.OrthogonalCamera.CameraDirection.X = UnitUtils.ConvertFromInternalUnits(vi.X, DisplayUnitType.DUT_METERS) * -1; v.OrthogonalCamera.CameraDirection.Y = UnitUtils.ConvertFromInternalUnits(vi.Y, DisplayUnitType.DUT_METERS) * -1; v.OrthogonalCamera.CameraDirection.Z = UnitUtils.ConvertFromInternalUnits(vi.Z, DisplayUnitType.DUT_METERS) * -1; v.OrthogonalCamera.ViewToWorldScale = zoomValue; } else { v.PerspectiveCamera = new PerspectiveCamera(); v.PerspectiveCamera.CameraViewPoint.X = UnitUtils.ConvertFromInternalUnits(c.X, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraViewPoint.Y = UnitUtils.ConvertFromInternalUnits(c.Y, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraViewPoint.Z = UnitUtils.ConvertFromInternalUnits(c.Z, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraUpVector.X = UnitUtils.ConvertFromInternalUnits(up.X, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraUpVector.Y = UnitUtils.ConvertFromInternalUnits(up.Y, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraUpVector.Z = UnitUtils.ConvertFromInternalUnits(up.Z, DisplayUnitType.DUT_METERS); v.PerspectiveCamera.CameraDirection.X = UnitUtils.ConvertFromInternalUnits(vi.X, DisplayUnitType.DUT_METERS) * -1; v.PerspectiveCamera.CameraDirection.Y = UnitUtils.ConvertFromInternalUnits(vi.Y, DisplayUnitType.DUT_METERS) * -1; v.PerspectiveCamera.CameraDirection.Z = UnitUtils.ConvertFromInternalUnits(vi.Z, DisplayUnitType.DUT_METERS) * -1; v.PerspectiveCamera.FieldOfView = zoomValue; } // handle section box if enabled if (view3D.IsSectionBoxActive) { BoundingBoxXYZ sectionBox = view3D.GetSectionBox(); // Note that the section box can be rotated and transformed. // So the min/max corners coordinates relative to the model must be computed via the transform. Transform trf = sectionBox.Transform; XYZ max = sectionBox.Max; //Maximum coordinates (upper-right-front corner of the box before transform is applied). XYZ min = sectionBox.Min; //Minimum coordinates (lower-left-rear corner of the box before transform is applied). // Transform the min and max to model coordinates XYZ maxInModelCoords = trf.OfPoint(max); XYZ minInModelCoords = trf.OfPoint(min); // Convert to shared coordinates maxInModelCoords = ARUP.IssueTracker.Revit.Classes.Utils.ConvertToFromSharedCoordinate(doc, maxInModelCoords, false); minInModelCoords = ARUP.IssueTracker.Revit.Classes.Utils.ConvertToFromSharedCoordinate(doc, minInModelCoords, false); // Convert to project unit DisplayUnitType lengthUnitType = DisplayUnitType.DUT_METERS; maxInModelCoords = new XYZ(UnitUtils.ConvertFromInternalUnits(maxInModelCoords.X, lengthUnitType), UnitUtils.ConvertFromInternalUnits(maxInModelCoords.Y, lengthUnitType), UnitUtils.ConvertFromInternalUnits(maxInModelCoords.Z, lengthUnitType)); minInModelCoords = new XYZ(UnitUtils.ConvertFromInternalUnits(minInModelCoords.X, lengthUnitType), UnitUtils.ConvertFromInternalUnits(minInModelCoords.Y, lengthUnitType), UnitUtils.ConvertFromInternalUnits(minInModelCoords.Z, lengthUnitType)); // Add to BCF clipping planes v.ClippingPlanes = ARUP.IssueTracker.Revit.Classes.Utils.GetClippingPlanesFromBoundingBox(maxInModelCoords, minInModelCoords, trf, doc); } } //COMPONENTS PART FilteredElementCollector collector = new FilteredElementCollector(doc, doc.ActiveView.Id).WhereElementIsNotElementType(); System.Collections.Generic.ICollection <ElementId> collection = null; if (elemCheck == 0) { collection = collector.ToElementIds(); } else if (elemCheck == 1) { collection = uidoc.Selection.GetElementIds(); } if (null != collection && collection.Any()) { v.Components = new List <IssueTracker.Classes.BCF2.Component>(); foreach (var eId in collection) { Guid guid = ExportUtils.GetExportId(doc, eId); string ifcguid = IfcGuid.ToIfcGuid(guid).ToString(); v.Components.Add(new ARUP.IssueTracker.Classes.BCF2.Component(doc.Application.VersionName, eId.ToString(), ifcguid)); } } return(v); } catch (System.Exception ex1) { TaskDialog.Show("Error!", "exception: " + ex1); } return(null); }
public override void ExportToDataTable(DataTable dataTable) { if (dataTable == null) { return; } base.DataTable = dataTable; ElementList elementList = base.TableInfo.ObjectList as ElementList; foreach (Element element in elementList.Elements) { Document document = element.Document; bool[] array = new bool[] { default(bool), true }; for (int i = 0; i < array.Length; i++) { bool flag = array[i]; if (!flag || element is HostObject) { System.Collections.Generic.ICollection <ElementId> materials = MaterialQuantitiesList.GetMaterials(element, flag); if (materials != null && materials.Count > 0) { foreach (ElementId current in materials) { if (current.IntegerValue != ElementId.InvalidElementId.IntegerValue && document.GetElement(current) is Material) { try { double materialArea = element.GetMaterialArea(current, flag); double num = flag ? 0.0 : element.GetMaterialVolume(current); DataRow dataRow = this.GetDataRow(new object[] { element.Id.IntegerValue, current.IntegerValue, flag }); if (dataRow == null) { dataRow = dataTable.NewRow(); Utility.Assign(dataRow, APIObjectList.ColumnRes("ColN_CST_ElementId"), element.Id.IntegerValue); Utility.Assign(dataRow, APIObjectList.ColumnRes("ColN_CST_MaterialId"), current.IntegerValue); Utility.Assign(dataRow, APIObjectList.ColumnRes("ColN_CST_AsPaint"), flag); dataTable.Rows.Add(dataRow); } Utility.Assign(dataRow, APIObjectList.ColumnRes("ColN_CST_Area"), materialArea); Utility.Assign(dataRow, APIObjectList.ColumnRes("ColN_CST_Volume"), num); } catch (System.Exception arg) { Log.WriteWarning("Cannot get material id {0} of element {1}. " + arg, new object[] { current, element.Id }); } } } } } } } }