Using Dependency Injection for Development in Revit
PrefaceDependency Injection (DI) technology is already quite mature. This article mainly explains the applicable versions in Revit and introduces relevant open-source projects. Version IssuesVersionCurrent dependency injection packages cannot support Revit versions below 2020. This is because the dependencies in the package are inconsistent with Revit’s own dependencies. Therefore, if you are developing with Revit + DI, you need to use version 2020 or higher. If there are other ways, please i...
Revit 使用依赖反转进行开发
前言依赖注入的技术已经很成熟,本文主要是说明一下Revit中的适用版本与介绍相关的开源项目。 版本问题版本目前的依赖注入包无法支持Revit 2020 以下的版本,原因是因为包中的依赖项与Revit本身的依赖项不一致导致的,所以说如果使用Revit + DI 进行开发需要再2020以上 。 如果有其他方式可以通过评论介绍一下,一起交流。 原因因为我常用版本在2019 , 在我使用DI时引用了Microsoft.Extensions.Hosting这个包开发,但是每次开发都是报错,开始时我认为是我的开发引用与这个包内部依赖项冲突,所以单独做了项目进行引用,但是依旧报错,但是更换版本在Revit 2021 可以正常使用,所以怀疑Revit本身加载的依赖项与这个包发生冲突。 于是搜索资料,发现相关的资料很少,在网络上使用Revit + DI 的资料也相对较少,这里找到一个资料中间讲了这个事情,与我的预估基本一致,jimmy在下面回复也是需要通过复杂的方式(IPC)桥接。 How to force a host application to load a .Net addin’s ve...
ObjectARX and Libcurl File Download Issues
Download failure causing CAD crash, error ‘Error handler re-entered. Exiting now’. The reason is that I inherited libcurl-related functions into a class and performed relevant WebAPI interactions within the class. However, because I made a request at the very beginning, I failed to initialize curl, leading to data transfer errors. It just needs to be initialized at the beginning of the function. 123456789101112131415curl = curl_easy_init();/*curl_global_init(CURL_GLOBAL_DEFAULT);*/if (curl)...
objectarx + libcurl下载文件遇到的问题
下载失败导致cad崩溃,报错’Error handler re-entered.Exiting now ‘,原因是因为我将libcurl相关的功能继承到一个类中,在类中进行相关的webapi交互,但是由于最开始进行了请求所以没有将curl进行初始化导致的传递数据错误.只需要在函数开始时进行初始化即可. 123456789101112131415curl = curl_easy_init();/*curl_global_init(CURL_GLOBAL_DEFAULT);*/if (curl){ MessageBoxA(NULL, combinePath.c_str(), "0", 0); FILE* fp = fopen(strFileName.c_str(), "wb"); // 打开文件,准备写入 curl_easy_setopt(curl, CURLOPT_URL, combinePath.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); curl_e...
WebUI API Parameter Configuration Guide
After local deployment, you can access localhost:7860/docs. However, if it’s inaccessible, you can check GitHub or other documents directly. I wrote this article to record the txt2img API parameter types I use in my work. Since I focus more on architectural exterior rendering, I don’t need many details related to characters, so fewer settings are required. For more details, you can refer to this article: Comprehensive Stable Diffusion WebUI API Call Example, Including ControlNet and Segment A...
WebUI 参数设置
本地部署之后通过 localhost:7860/docs可以看到但是如果无法访问,可以直接看github或是其他的文件,通过写这篇文章记录一下自己工作中使用到的txt2img这个API参数类型。由于我更多偏向建筑结构外立面渲染所以很多人物或是细节不需要,会少很多的设置。更详细的可以参照这个文章 全网最全stable diffusion webui API调用示例,包含controlneth和segment anything的API(附json示例) 在线查看base64的网站 :https://www.lddgo.net/convert/base64-to-image在线将本地图片转换成base64的网站: https://www.lddgo.net/convert/imagebasesixsd api github 介绍页 :https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/APIcontrolNet github api 介绍页 : https://github.com/Mikubill/sd-webu...
Libcurl Error 35 Solution
Libcurl code 35 definition:SSL CONNECT ERROR I encountered this issue in the following two situations: SSL certificate verification. You can add corresponding headers to cancel or add verification. 123456789curl_easy_setopt(curl, CURLOPT_URL, combinePath.c_str());curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);curl_easy_setopt(curl, CURLOPT_NOSIGNAL,...
libcurl 报错 35
libcurl code 35 定义:SSL CONNECT ERROR 我这里问题情况会出现以下两种 SSL证书认证,可以添加相应的头取消或是添加验证 123456789curl_easy_setopt(curl, CURLOPT_URL, combinePath.c_str());curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlWriteFunction); 粗心大意,在本地调试使用的https服务端接口忘记调整成’http’协议
Using libcurl to Request WebApi in ObjectARX
Because CAD development requires requesting data from the server, request data through WebAPI set up on the server before, so libcurl was installed to use data in ObjectARX.Open VS2012 x64 Native Tools Command Prompt Supplemental address: I will place the relevant reference configuration images here. The application inside CAD is consistent with the routine. All usage is consistent with the current case, but an error occurred here, which I record here. In the code below, when I ran the progr...
Objectarx 使用libcurl请求WebApi
因为开发cad需要请求服务器的数据,再次之前我在服务器搭设了webapi用户传递数据,所以安装了libcurl在objectarx中使用数据。Open VS2012 x64 Native Tools Command Prompt补充地址: 我在此将相关的引用配置图片,cad里面的应用和常规的一致。 所有的使用与现在的案例一致,但是我这里发生了一个错误,我在此记录一下,在下面这段代码当中,我运行程序,cad报错内存泄漏,定位问题之后发现问题出错在这句 1CURLcode res = curl_easy_perform(curl); 我查看了很多文章都无法解决,后来发现其实是此处的数据传递错误,我的指针传递错误导致的问题,这里是问题代码片段 12345678910111213141516inline BOOL webApi::DownloadFile(const char* Filepath){ // ... curl_easy_setopt(curl, CURLOPT_URL, combinePath.c_str()); curl_easy_setopt...
Creating a Toolbar with Drawer Menu in CAD ObjectARX
Implement creating a toolbar in CAD and adding menu commands, as shown below:Reference article: cad — menu, toolbar, screen menu, enhanced toolbar The main implementation path is to create a dockable window, creating toolbuttons within it, adding commands to the button click events, and displaying the submenu at the button position. For smoother interaction, you need to override the menu style.As mentioned in the article, you can control controls via an XML file, which can omit the steps of...
CAD ObjectArx 二次开发 创建工具栏实现点击button出现抽屉式菜单
实现在CAD中创建工具栏并添加菜单命令,如下图参照文章: cad—菜单,工具栏,屏幕菜单,增强工具栏 主要实现路径是通过创建一个可停靠窗口,并在其中创建toolbutton并给button点击事件添加命令,将子菜单menu显示在button位置,如果需要更加顺滑的交互,需要重写一下menu的样式。像文中所说,可以通过一个xml文件来控制控件,这样可以省略修改交互的步骤,我这里只是做出了单纯横向布置的实现和button边框背景取消,还需要增加自适应修改的内容,让侧边顶部都可以实现。代码逻辑也没有什么可以说的,直接将代码放到下面:Dialog: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911...
ObjectARX 2021 VS2019 Build Error /RTCc rejects conformant code
error C2338: /RTCc rejects conformant code error solution Using VS2019/VS2022 to build the project reports an errorSeverity Code Description Project File Line Suppression State Error C1189 #error: /RTCc rejects conformant code, so it is not supported by the C++ Standard Library. Either remove this compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have received this warning. ArxProject2 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC...
Objectarx 2021使用vs2019生成报错 /RTCc rejects conformant code
error C2338: /RTCc rejects conformant code错误解决 使用VS2019/VS2022生成项目报错严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C1189 #error: /RTCc rejects conformant code, so it is not supported by the C++ Standard Library. Either remove this compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have received this warning. ArxProject2 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\yvals_core.h 1231 修改项目->c/c++->最小类型检查,改为否,清理一下项目即可生成项目...
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
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...
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 ...
配置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
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...
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); /...








