简体   繁体   English

如何激活(显示)平面图/层,然后突出显示平面图/层的所有墙壁?

[英]How to activate(display) a floor plan / level and then Highlight all the walls of floor plan/level?

I am trying to activate a view using Revit API.我正在尝试使用 Revit API 激活视图。 What I want to do exactly is to display the level or floor plan view.我想要做的正是显示水平或平面图视图。 So the view I want to activate ( I mean, I want this view to be actually shown on screen) already exists, and I can access its Id.所以我想激活的视图(我的意思是,我希望这个视图实际显示在屏幕上)已经存在,我可以访问它的 Id。

I have seen threads about creating, browsing, filtering views, but nothing on activating it... It's a Floor Plan view.我看过关于创建、浏览、过滤视图的线程,但没有激活它......这是一个平面图视图。 (What I want is that by selecting a level/ floor plan, it displays that level/ floor plan on-screen(it's like opening that floor plan from the already existing Revit model to display on the user screen). And then I want to activate all the walls of that floor plan/ level. (我想要的是,通过选择一个楼层/楼层平面图,它会在屏幕上显示该楼层/楼层平面图(就像从现有的 Revit 模型中打开该楼层平面图以显示在用户屏幕上一样)。然后我想激活该楼层平面图/层的所有墙壁。

This questions was answered here already How can I activate (display) a view (floor plan or Level) using Revit API?此处已回答此问题如何使用 Revit API 激活(显示)视图(平面图或标高)?

c# C#

Here is an example how to switch to the default 3d-view https://thebuildingcoder.typepad.com/blog/2011/09/activate-a-3d-view.html这是一个如何切换到默认 3d 视图的示例https://thebuildingcoder.typepad.com/blog/2011/09/activate-a-3d-view.html

you can do the same with all other available views like this您可以对所有其他可用视图执行相同的操作

UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;

uidoc.ActiveView = yourview;

or with python或使用蟒蛇

Super easy to do:超级容易做到:

# normally you have the ui set at the start of your script
ui = __revit__.ActiveUIDocument 

# then just set the ActiveView as your view (not the ViewId)
ui.ActiveView = yourView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM