社区
Revit,Navisworks建筑施工BIM讨论区
欢迎访问欧特克Revit, Navisworks论坛!分享知识,发帖提问,浏览论坛热帖。
取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How can multiple views be selected to annotate objects in all those views?

10 条回复10
已解决
回复
1 条消息(共 11 条)
liuhaohao970705
533 次查看, 10 条回复

How can multiple views be selected to annotate objects in all those views?

如图所示,我只能在当前视图中实现这一点。

10 条回复10
2 条消息(共 11 条)

Hey!

 

It looks like It can be done by Dynamo. Have you tried using Dynamo for this situation?

 

 

3 条消息(共 11 条)

I'm not familiar with Dynamo. Would using PyRevit make it more convenient to achieve this?

4 条消息(共 11 条)

I am not an expert on pyRevit but, I could not find a way to tag elements in selected views by using pyRevit.

 

I am leaving a link for you to explore your options.

https://forums.autodesk.com/t5/revit-architecture-forum/apply-tag-to-multiple-views-at-once/td-p/101...

 

5 条消息(共 11 条)

liuhaohao970705_0-1732023467725.png

 

谢谢。您能否指导我如何在 Dynamo 中仅选择视图中的可见图元,而不是模型中的所有图元,类似于此本机功能?

6 条消息(共 11 条)

Hi @liuhaohao970705 :

 

使用c#可以使用下面代码,遍历每个视图并且应用多类别注释添加

using (Transaction transaction= new Transaction(doc))
            {
                transaction.Start("TT");
                
                
                var collector = new FilteredElementCollector(doc);
                var views = collector.OfClass(typeof(View)).OfCategory(BuiltInCategory.OST_Views).Cast<View>().Where(v=>
                    (v.ViewType == ViewType.EngineeringPlan || v.ViewType == ViewType.FloorPlan) && v.CanBePrinted); 
                foreach (var view in views)
                {
                    var instances = new FilteredElementCollector(doc, view.Id).WhereElementIsNotElementType()
                        .Where(x => x.GetType() == typeof(FamilyInstance) || x.GetType() == typeof(Pipe))
                        .ToList();

                    foreach (Element instance in instances)
                    {
                        var reference = new Reference(instance);
                    
                        IndependentTag.Create(doc,view.Id,reference,true,TagMode.TM_ADDBY_MULTICATEGORY,TagOrientation.Vertical,XYZ.Zero);
                    }
                
                }
                
                transaction.Commit();
            }

LanHui Xu
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

7 条消息(共 11 条)

但是,这也批注了所有元素,包括视图裁剪边界之外的元素。

8 条消息(共 11 条)

Hi @liuhaohao970705 :

我测试了一下代码,增加了视图裁剪并且修改了边界,视图之外的没有添加标记,您那边出现标记是什么族类别或者批注之后的截图可以上传吗?

scgq425_0-1732085538128.png

scgq425_1-1732085541013.png

 

scgq425_2-1732085617994.png

 

LanHui Xu
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

9 条消息(共 11 条)

现在应该没啥问题,我改成了python代码。想请教一下如果想不标记遮挡的物体该如何筛选,比如我在里面上很多幕墙板,我将裁剪深度拉的很远,但我只想标注最外层的墙板,被最外层遮挡的就不标记,就像revit原生的那个标注所有物件那个功能,被遮挡的就不会被标记。

liuhaohao970705_0-1732089669601.png

 

10 条消息(共 11 条)

Hi @liuhaohao970705 :

目前没有什么好的办法去获得遮挡构件,或者通过其他运算获得,如果你用Dynamo的话可以找一下直接调用Revit命令的按钮,promptcommand这个命令,多类别标记的命令是` ID_BUTTON_TAG_ALL`,每个视图运行一次也可以完成这个操作

RevitCommandId id = RevitCommandId.LookupCommandId("Command命令");
            if (uiApplication.CanPostCommand(id))
            {
                uiApplication.PostCommand(id);
            }

 

···

LanHui Xu
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

11 条消息(共 11 条)

好的 谢谢~

找不到想要的内容?向社区提问或分享您的知识。

到论坛发帖  

”