Revit工作集协同模式的API应用探究ppt课件

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
WorksetTable worksetTable = RevitDoc.GetWorksetTable(); WorksetId activeId = worksetTable.GetActiveWorksetId();Workset activeWorkset = worksetTable.GetWorkset(activeId);Workset wallWorkset = worksetTable.GetWorkset(wall.WorksetId);
FilteredWorksetCollector collector = new FilteredWorksetCollector(RevitDoc);collector.OfKind(erWorkset);IList<Workset> worksets = collector.ToWorksets();WorksetKindFilter standardFilter = new WorksetKindFilter(WorksetKind.StandardWorkset, true);collector.WherePasses(standardFilter);
对于大型的设计项目,有效地协同工作、工作共享可以提高建筑设计的效率,优化建筑的经济性,对于设计团队来说无疑是非常重要的话题。本课程将从二次开发的角度,介绍工作共享相关API的设计与使用。
课程简介
Revit工作共享主要工作流程工作共享中的数据操作工作共享中的工作集管理工作共享中的权限管理工作共享的显示模式工作共享相关的事件
ReloadLatest
Transaction trans = new Transaction(RevitDoc, "RL");trans.Start();ReloadLatestOptions options = new ReloadLatestOptions();RevitDoc.ReloadLatest(options);bool isUpdated = RevitDoc.HasAllChangesFromCentral();mit();
SynchronizeWithCentral
SynchronizeWithCentralOptions options = new SynchronizeWithCentralOptions();ment = @"Relinquish Options";RelinquishOptions newRelinqOptions = new RelinquishOptions(false);newRelinqOptions.CheckedOutElements = true;newRelinqOptions.StandardWorksets = false;options.SetRelinquishOptions(newRelinqOptions);TransactWithCentralOptions transOptions = new TransactWithCentralOptions(); CallBack callInst = new CallBack();transOptions.SetLockCallback(callInst);RevitDoc.SynchronizeWithCentral(transOptions, options);
ICollection<ElementId> checkedOutElementIds = WorksharingUtils.CheckoutElements(RevitDoc, elementsToBeCheckedout);
放弃编辑权限
TransactWithCentralOptions transOptions = new TransactWithCentralOptions();RelinquishOptions relinqOptions = new RelinquishOptions(false);relinqOptions.CheckedOutElements = true;relinqOptions.FamilyWorksets = false;relinqOptions.StandardWorksets = false;erWorksets = false; relinqOptions.ViewWorksets = false; // relinquish checked out elementsRelinquishedItems items = WorksharingUtils.RelinquishOwnership(RevitDoc, relinqOptions, transOptions);
WorksetVisibility
View view = getActiveView();WorksetVisibility visibility = view.GetWorksetVisibility(worksetId);view.SetWorksetVisibility(worksetId, WorksetVisibility.Hidden);visibility = view.GetWorksetVisibility(worksetId);view.SetWorksetVisibility(worksetId, eGlobalSetting);visibility = view.GetWorksetVisibility(worksetId);view.SetWorksetVisibility(worksetId, WorksetVisibility.Visible);
刘培珺职务/Autodesk中国研究院 开发经理部门/IPG 2004年毕业于浙江大学CAD&CG国家重点实验室并获得工学博士学位。毕业后加入阿尔卡特从事无线研发工作。2006年加入Autodesk AEC部门,Revit API 团队开发经理,负责Revit API的设计、开发与测试。
认识我
日程
什么是工作共享?
Revit工作协同功能
工作协同主要流程
创建中心文件
打开工作共享
创建本地文件
数据保存
数据提取
数据修改
没有权限
授权
Worksharing API
Save, SaveAs, SaveOptions和WorksharingSaveAsOptionsOpen和OpenOptionsReloadLatest,HasAllChangesFromCentral和ReloadLatestOptionsSynchronizeWithCentral,SynchronizeWithCentralOptions,RelinquishOptions和TransactWithCentralOptions
ElementWorksetFilter
ElementWorksetFilter elmentWorksetFilter = new ElementWorksetFilter(worksetId, false);FilteredElementCollector collector = new FilteredElementCollector(RevitDoc);ICollection<Element> worksetElemsfounds = collector.WherePasses(elmentWorksetFilter).ToElements();
FilteredWorksetCollector和WorksetKindFilter
FilteredWorksetCollector(RevitDoc);
collector.OfKind(erWorkset);
WorksetKindFilter(WorksetKind.StandardWorkset, true);
WorksetDefaultVisibilitySettings
WorksetDefaultVisibilitySettings defaultVisibility = WorksetDefaultVisibilitySettings.GetWorksetDefaultVisibilitySettings(RevitDoc);bool isVisible = defaultVisibility.IsWorksetVisible(worksetId);defaultVisibility.SetWorksetVisibility(worksetId, !isVisible);
工作共享数据操作
Save, SaveAs, SaveOptions, SaveAsOptions和WorksharingSaveAsOptions
Open,OpenOptions和DetachFromCentralOption
OpenOptions openOptions = new OpenOptions();WorksetConfiguration config = openOptions.GetOpenWorksetsConfiguration();if (null == config){ config = new WorksetConfiguration(); openOptions.SetOpenWorksetsConfiguration(config);}config.OpenLastViewed();Document newDoc = RevitApp.OpenDocumentFile(ModelPathUtils.ConvertUserVisiblePathToModelPath("OpenDocument.rvt"), openOptions);
Workset和WorksetTableWorksetDefaultVisibilitySettingsWorksetVisibilityElementWorksetFilterFilteredWorksetCollector和WorksetKindFilter
工作共享中的工作集管理
Workset和WorksetTable
WorksharingDisplaySettings
Document doc = RevitApp.OpenDocumentFile("Workshared.rvt"));Transaction trans = new Transaction(doc, "new trans");trans.Start();WorksharingDisplaySettings settings = WorksharingDisplaySettings.GetOrCreateWorksharingDisplaySettings(doc);ICollection<String> users = settings.GetAllUsersWithGraphicOverrides();mit();
WorksharingDisplayModeWorksharingDisplaySettingsWorksharingDisplayGraphicSettings
工作共享的显示模式
WorksharingDisplayMode
WorksharingDisplayMode wsDisplayMode = view.GetWorksharingDisplayMode(); view.SetWorksharingDisplayMode(WorksharingDisplayMode.CheckoutStatus);
CheckoutElements和RelinquishOwnership
工作共享权限管理
开启工作共享
RevitDoc.EnableWorksharing("abc", "def");Assert.IsTrue(RevitDoc.IsWorkshared);
获得编辑权限
相关文档
最新文档