写了几个WPF界面,在addinmangager时没有发现问题,当编到一个addin文件中打包时,报错未能加载文件或程序集“Microsoft.Xaml.Behaviors, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项
修改多次未果,后来想起来Revit无法加载强签名的dll文件,将其更换为已经停止维护的包System.Windows.Interactivity
打包后能够正常运行。
如果我们使用nuget搜索interactivity.dll的包时会提示有新的包可供下载,如果使用这个包进行Revit二次开发应该使用此停止维护更新的dll

Author: Broccoli
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles

2023-05-09
Creating Parts in Revit Secondary Development
Some projects need to use parts to divide floor tiles, like this:Using parts can basically calculate quantities and set data such as paving joints, so below is a method to create parts. 12345678910111213PartUtils.CreateParts(doc,new List<ElementId>(){detailFloor.Id}); doc.Regenerate(); var elementIds = PartUtils.GetAssociatedParts(doc, detailFloor.Id, true, true); var maker = PartUtils.Divi...

2022-09-04
Creating Void Solids for Cutting in Revit Secondary Development
For specific API, please refer to the official documentation. Here is the keyword for cutting Void. OverviewApplication ScenariosIn actual projects, if you want to make a family to cut a component, you need to create a void extrusion, and then execute the cut command to cut off the model component we want to cut.It is widely used in quantity calculation to execute join/cut commands, or connection order in actual engineering.Or in projects with high precision requirements or where the own...

2023-05-16
Breaking an Arc into Multiple Segments
The company plugin’s beam-to-slab function has been updated. The designer requested a feature to split arc beams and align them to the top of the slab. This article only discusses splitting arc beams; ellipses will be updated later. First, let’s look at the arc creation APIThe API provides three methods:The first one is specifying the start point and end point, and finally selecting a point on the arc.The second one is specifying the plane, radius, start angle, and end angle.The third one is...

2022-09-04
Revit Secondary Development Error Loading Microsoft.Xaml.Behaviors
I wrote several WPF interfaces and found no problems when using AddinManager. However, when compiled into an addin file and packaged, it reported an error:Could not load file or assembly “Microsoft.Xaml.Behaviors, PublicKeyToken=b03f5f7f11d50a3a” or one of its dependencies After modifying it many times without success, I remembered that Revit cannot load strong-named dll files, so I replaced it with a package that has stopped maintenance:System.Windows.InteractivityIt runs normally after pack...

2023-06-16
RevitNet 调用 Revit API 中射线法求模型同一个构件出现两个不同值的问题记录
射线法求交是很多三维模型求碰撞和测量间距最常用的节点,但是再使用射线法将target设置为element的时候会发现会出现两个相同的值。下面用楼板距离,下图中会出现两个不同的值,在我修改板厚之后发现正好是板厚的距离,可以猜测射线法会对两个face进行判定相交,但是与我们需要的每个element输出一个值不符,这里需要重新做一次判定或者直接取最小值获得净高。 123456789101112131415161718var intersector = new ReferenceIntersector(classFilter, FindReferenceTarget.Element, modelView); intersector.FindReferencesInRevitLinks = true; var result = intersector.Find(origin, -XYZ.BasisZ); foreach (var context in result) ...

2023-05-22
Error Getting Grid Reference in Revit API
After Revit 2018, the method for obtaining Grid Reference has been modified. You need to use the following code to retrieve it: 12345foreach (Grid grid in grids) { var reference = new Reference(grid); gridReferences.Append(reference); } Previously, you needed to get the Grid’s Curve.Reference to create dimensions: 1gridReferences.Append(grid.Curve.Reference); The change should be made to obtain Grid References more safely and convenie...
Announcement
欢迎访问!右上角可切换中英文。感谢您的阅读!



