ObjectArx2016 Error Object Does Not Support additem Property or Method
Configuration VS2019 + ObjectArx2016 Here reported error Object does not support additem property or method. The error shows classID error in the file. Modifying the ID value can generate correctly, but checking several files are not satisfied, it should be the ID updated according to the actual update. 1<OBJECT CLASS="itemText" ID="DialogList" ACCESSKEY="d" CLASSID="CLSID:fc1ae18b-0282-42f1-90ae-bbd8f0181013"> For solution and explanation of Cla...
ObjectArx2016 报错 对象不支持 additem属性或方法
配置VS2019 + ObjectArx2016 此处报错对象不支持 additem属性或方法,报错显示文件中的classID错误,修改ID值可以正确生成,但是查阅了几个文件都无法满足,应该是根据实际的更新而更新的ID。 1<OBJECT CLASS="itemText" ID="DialogList" ACCESSKEY="d" CLASSID="CLSID:fc1ae18b-0282-42f1-90ae-bbd8f0181013"> 关于解决办法及ClassID的解释参照:Failed in Creating ArxWizMFCSupport class
配置VS2019 + ObjectArx2016
此处报错对象不支持 additem属性或方法,报错显示文件中的classID错误,修改ID值可以正确生成,但是查阅了几个文件都无法满足,应该是根据实际的更新而更新的ID。 1<OBJECT CLASS="itemText" ID="DialogList" ACCESSKEY="d" CLASSID="CLSID:fc1ae18b-0282-42f1-90ae-bbd8f0181013"> 关于解决办法及ClassID的解释参照:Failed in Creating ArxWizMFCSupport class
Configuring VS2019 + ObjectARX 2016
Here it reports an error Object does not support additem property or method. The error indicates looking for classID in the file. Modifying the ID value can generate correctly, but consulting several files did not satisfy the requirement. It should be an ID updated according to the actual update. 1<OBJECT CLASS="itemText" ID="DialogList" ACCESSKEY="d" CLASSID="CLSID:fc1ae18b-0282-42f1-90ae-bbd8f0181013"> Regarding the solution and explanation of ...
Objectarx MFC 添加ListControl并控制显隐
最主要的是实现一个Button点击将下方的List显示出来,制作成抽屉式菜单工具。这篇文章是想实现点击工具栏并控制List的显隐。 参照: MFC中实现一个控件的隐藏和显示【MFC】判断控件是否为隐藏状态 MFC中查找构件使用ID进行控制,这个和WPF,WinForm的name一样,通过获取这个构件进行操作。控制显隐的接口是:ShowWindow(TRUE),获取构件状态的接口是:int bVisible = ((CWnd*)GetDlgItem(IDC_LIST1))->GetStyle() & WS_VISIBLE; 主要代码: 在初始化的时候,将List修改为隐藏 123456789101112//-----------------------------------------------------------------------------void CMenuBarChildDlg::DoDataExchange (CDataExchange *pDX) { CAcUiDialog::DoDataExchange(pDX); /...
Adding ListControl and Controlling Visibility in ObjectARX MFC
The main objective is to implement a Button click to show the List below, creating a drawer-style menu tool.This article aims to implement clicking on the toolbar to control the visibility of the List. Reference: Implementation of Hiding and Showing a Control in MFC【MFC】Check if a control is hidden In MFC, controls are searched and controlled using IDs, which is the same as the name in WPF and WinForm, operating by acquiring this control. The interface for controlling visibility is: ShowWi...
Revit API Ray Method Returns Two Values for Same Element Analysis
Ray intersection is one of the most commonly used nodes for collision calculation and distance measurement in many 3D models. However, when using the ray method and setting target to element, you will find that two identical values appear.Using floor distance as an example, two different values appear in the figure below. After I modified the slab thickness, I found that it was exactly the distance of the slab thickness. It can be guessed that the ray method determines intersection for both f...
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) ...
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...
Revit二次开发 Grid无法获取reference的报错
在Revit2018以后,修改了Grid的Reference获取办法,需要使用下面的代码进行获取 12345foreach (Grid grid in grids) { var reference = new Reference(grid); gridReferences.Append(reference); } 而在之前是需要获取Grid的Curve.Reference才能进行标注创建 1gridReferences.Append(grid.Curve.Reference); 改动应该是为了更加安全便捷的获取Grid的Refence而做出的修改。关于这个事情的官方回答详情可以看下面这篇文章Invalid Number of References 
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 API  The API provides three methods: The first one is specifying the start point and end point, and finally selecting a point on the arc. T...
Arc 打断拆分成多个线段
公司插件的梁齐斜板功能更新,设计师提出需求可以拆分弧梁,并能对齐到板顶。 本文只讨论拆分弧梁,椭圆再后续更新。 首先看以下弧形的创建apiAPI中提供了三种方法第一种时指定起点与终点,最后选择顶点形成的弧形第二种是指定面,半径,起点角度与终点角度第三种则是弧形中心点,半径,起点角度,终点角度,x向量,y向量 拆分弧形,意思就是如果遇到板边界需要拆分,需要将此弧形按照板边界划分成两个弧形,第一种办法肯定无法实现,后两种的化就需要了解什么是起点角度与终点角度,并如何计算 下面是我的理解,后面彻底完成后再继续补充,可能有些混乱,怕后面忘记(所有的弧形是逆时针旋转) 弧形内部有三个参数(xDir,yDir,normal),这三个参数代表横向向量,纵向向量,和法向量 下面是两个相反的值比较,可以发现法向量在俩面决定了整个弧形方向,此处可以使用右手法则理解   Sending Esc key to RevitHow to listen to keyboard events in Revit Consulted SDK content, but also failed to run. Put it here to see if there is any inspiration later. 123456789101112131415161718192021 // Use custom Revit drag and drop behavior LoadedFamilyDropHandler myhanlder = new ...
Revit二次开发 PromptForFamilyInstancePlacement 方法报错的解决办法
参照 这里是一些使用钩子进行取消的方案,但是在我的函数中运行失败,在这里记录一下后续在研究失败原因 Revit二次开发知识分享(十二)给Revit发送Esc按键如何在Revit中监听键盘事件 查阅SDK的内容,但是也是运行失败,放在这里看看后续有没有启发 123456789101112131415161718192021 // Use custom Revit drag and drop behavior LoadedFamilyDropHandler myhanlder = new LoadedFamilyDropHandler(); UIApplication.DoDragDrop(selectedItem.Tag, myhanlder);/// <summary> /// Custom handler for placement of loaded family types /// </summary> public class LoadedFamilyDrop...
Revit 二次开发 创建零件
有的项目需要使用零件进行地砖的划分,比如这样:  使用零件可以很好的统计数量,设置铺设缝等数据,所以下面提供一个可以创建零件的方法 12345678910111213PartUtils.CreateParts(doc,new List<ElementId>(){detailFloor.Id}); doc.Regenerate(); var elementIds = PartUtils.GetAssociatedParts(doc, detailFloor.Id, true, true); var maker = PartUtils.DivideParts(doc, elementIds, new List<Eleme...
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(do...
Managing Multiple WPF Commands via Dictionary
Developing a family library plugin involves many interactive commands and requires many bindings. Using MVVM to directly bind Commands makes the entire ViewModel too messy. Here, an ICommandManage interface is created to manage Commands. The ValueConvert interface in WPF is used to convert the passed string into an ICommand command. C# 12345678910111213141516171819202122232425public interface ICommandManager { void RegisterCommand(string name, ICommand? command); void Un...
WPF 通过一个dictionary管理多个Command注册
需要开发一个族库插件,中间交互的命令很多,需要很多绑定,使用MVVM 直接绑定Command觉得整个ViewModel会过于杂乱,这里通过创建一个ICommandManage的接口管理Command。通过WPF中ValueConvert接口将传入字符串转换成ICommand命令。 c# 12345678910111213141516171819202122232425public interface ICommandManager { void RegisterCommand(string name, ICommand? command); void UnRegisterCommand(string name); ICommand GetCommand(string name); }public class CommandManager:ICommandManager { private readonly Dictionary<string, ICommand?> ...
Modifying Filled Region Line Styles in Revit API
I made a plugin to automatically calculate the clear height, which requires marking the height with annotation blocks, but boundary lines appeared when it came out, as shown below. Defining width through filledregionType’s lineweight failed, and setting through LineStyleId also failed because directly obtaining LineStyle style only gets lines in Manage -> Line Styles, not the category we need.  Here we ne...
Revit 二次开发修改填充区域线样式
做了一个自动测算净高的插件,需要通过注释块标记高度,但是出来的时候会有边界线,如下图,通过filledregionType的lineweight定义宽度失败,通过LineStyleId进行设置,但是直接获取LineStyle样式只会获取管理->线样式里面的线,没有我们需要的<不可见线>这个分类。  此处需要收集以下GraphStyle找到不可见线Id直接赋值即可,实例中我将绿色的部分进行边界取消  123456789var filter = new FilteredElementCollector(doc); var dates = filter.OfClass(typeof(GraphicsStyle)).ToElements();...






