Web Api Server Deployment Issue Record
Server Information: System: Windows Server 2008 R2 Error: Connection id “0HMGNTPDIIA4M“.Request id “0HMGNTPDIIA4M:00000002“:An unhandled exception was thrownManually clicking exe file under publish found can run, but port is default 5000 not website port opened by myself. Because during server deployment I directly put publish folder under website folder, causing path to become “root/publish/*”, put files inside publish folder under target path or modify path in IIS log in can solv...
Web Api 服务端发布问题记录
服务器信息: 系统: Windows Server 2008 R2 错误: Connection id “0HMGNTPDIIA4M“.Request id “0HMGNTPDIIA4M:00000002“:An unhandled exception was thrown手动点击publish下面的exe文件发现可以运行,但是端口是默认的5000不是自己开通的网站端口,因为服务器部署的时候我直接将publish文件夹放到网站文件夹下面,导致路径变成“root/publish/*”,将publish文件夹里面的文件放到目标路径下面或者在IIS修改路径登录即可解决。 下面几篇博客是解决这类问题的博客,如果我的情况不符合可以参照下方的连接 Connection id “0HMGNTPDIIA4M“.Request id “0HMGNTPDIIA4M:00000001“:An unhandled exception was thrown Ocelot.Authorization.Middleware.AuthorizationMiddleware[0] ...
创建链接模型标注
创建链接模型标注创建Floor等有实体形状的标注今天在回答Revit API Forum的问题的时候发现一个问题,如何获取链接模型的reference从而实现标注Reference to Grid and Level from link,我便使用CreateLinkReference(doc)这个方法直接获取,结果创建dimension失败报错有无效的reference,后来debug直接获取手动创建的link reference成功标注,觉得是获取的reference的问题,后台查阅refernce的strign字符串发现不一致后来看到这篇文章Revit处理链接文件标注Reference,修改后创建dimension成功,应该是转换的refernce-stable出现问题所以直接获取创建失败。 123456789101112131415161718192021222324252627var floor = RevitCommandData.Document.GetElement(5676918) as Floor; var reference = floo...
Creating Dimensions for Linked Models in Revit
Creating Dimensions for Linked ModelsCreating Dimensions for Elements with Solid Geometry like FloorsToday, while answering a question on the Revit API Forum about how to get the reference of a linked model to implement dimensioning Reference to Grid and Level from link, I used the CreateLinkReference(doc) method to get it directly, but the dimension creation failed.The error reported an invalid reference. Later, I debugged and successfully dimensioned using a manually created link reference,...
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...
Revit二次开发 创建空心模型并与指定构件剪切
具体API可以查阅官方文档,这里提供剪切的关键词Void 总述应用场景在实际项目中,想要做一个族剪切构件,需要创建一个空心拉伸,然后执行剪切命令剪切掉我们希望剪切的模型构件在算量的时候应用比较广执行连接/剪切命令,或者实际工程中的连接顺序或是在精度要求高或者业主拖着不给结算的项目中也会出现一些稀奇古怪的要求,比如我遇到这个结构梁剪切建筑墙 基本逻辑 首先将结构链接模型中的结构梁的Solid取出 获取所有墙,与上一步获取的结构梁Solid做交集,取出相交Solid 第二步会产生两个方向 [ ] 每个InsertSolid都作为一个族生成 [x] 合并成一个大的InsetSolid几何,在一个族中执行相应的名称分别创建 生成空心形体之后(我这里使用的空心拉伸)修改族参数(加载时剪切的空心)到族中,这一步网络上的都是手动改无法契合这个功能的要求,所以下面我会提供一段代码 放置到指定位置执行构件间剪切的操作 完成 创建空心族创建族文件这一步代替的实际操作就是 File ->New File -> Category的操作,我们获取到族文档才能在文档中绘制形状和修改...
Revit 二次开发 未能加载文件或程序集“Microsoft.Xaml.Behaviors”或它的某一个依赖项
写了几个WPF界面,在addinmangager时没有发现问题,当编到一个addin文件中打包时,报错未能加载文件或程序集“Microsoft.Xaml.Behaviors, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项 修改多次未果,后来想起来Revit无法加载强签名的dll文件,将其更换为已经停止维护的包System.Windows.Interactivity打包后能够正常运行。 如果我们使用nuget搜索interactivity.dll的包时会提示有新的包可供下载,如果使用这个包进行Revit二次开发应该使用此停止维护更新的dll
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...
.net core application error The required library hostfxr.dll could not be found
Programs generated by .Net Core and Framework. .Net Core needs to be applied in the running environment. Sending it directly to others will cause an error. 12345678:\Program Files (x86)\***>.\copyfiles.exeA fatal error occurred. The required library hostfxr.dll could not be found.If this is a self-contained application, that library should exist in [C:\Program Files (x86)\BiMass\].If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dot...
.net core application报错The required library hostfxr.dll could not be found.
.Net Core和Framework生成的程序,.Net Core需要再运行环境中应用,直接扔给其他人会报错 12345678:\Program Files (x86)\***>.\copyfiles.exeA fatal error occurred. The required library hostfxr.dll could not be found.If this is a self-contained application, that library should exist in [C:\Program Files (x86)\BiMass\].If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the run...
Creating Revit Installer with Inno Setup
Previously, I packaged files through NSIS, and later I found Inno Setup. After using it, I found that Inno is slightly better than NSIS personally, and the entire operation interface is much simpler than NSIS. There is a localization version that can be added, but I use the English original version here. Wizard Settings Create a new file wizard after installation File-> New Click Next to enter the setting interface Because most of the packaged installation packages are placed in specified...
Inno Setup 创建Revit安装包
之前通过NSIS打包文件后来发现Inno Setup,使用了一下发现相较于NSIS个人感觉Inno稍微好一点,整个操作界面会比NSIS要简洁许多,有汉化版可以添加我这里用的是英文原版 向导设置 安装后创建新的文件向导 File-> New 点击Next进入设置界面 因为打包的安装包大部分是放在指定的文件夹中所以选择文件夹3. 因为Revit插件是基于Reivt二次开发的插件所以没有启动项勾选下面的即可,如果有其他的文件也可以,这个地方我没有尝试加入文件夹,后续的文件夹我直接再脚本中新增同样因为没有启动项我们也不需要创建开始菜单,这里点掉就可以了4. 添加许可文件等信息5. 添加安装权限这个位置后续也是可以通过脚本编辑 6. 选择语言,因为我没有安装汉化包所以只有选择英文6. 其他设置 7. 完成,之后进入脚本编辑内容 脚本设置具体的内容可以看Inno的API进行学习操作,这里说一下我用到的节点 有时我们需要将安装包中某些文件安装到系统路径中,Inno这里提供了一些系统路径的节点,可以看API中Constants节点,其中 {app} 用户安装路径 {localappda...
Inno Setup External Program Launch Error with Spaces in Path
When the installation package completes the installation, it can start an external program to copy the Revit Addin file to the corresponding version file location. However, I use 12[Run]Filename: "{app}\CopyFiles.exe" ;Description:"修改文件" ; Parameters:{app}; StatusMsg: "正在配置信息"; Flags: runhidden If the correct installation path selected by the user is C:\Program Files (x86) default path, passing the string will automatically split into an arra...
Inno-Setup 读取带空格路径导致无法启动外部程序
安装包完成安装时可以启动外部程序将Revit的Addin文件复制到相应的版本文件位置中,但是我使用 12[Run]Filename: "{app}\CopyFiles.exe" ;Description:"修改文件" ; Parameters:{app}; StatusMsg: "正在配置信息"; Flags: runhidden 如果用户安装选择的C:\Program Files (x86)默认路径将会导致传入的字符串自动分割为数组导致程序运行错误 去stackflow提问,找到解决方案,下面把解决方案和相应连接放到下方有类似情况的可以参照下面的连接解决。因为Pascal语句中””代表’ , 来源:pascal中的双引号为什要打6个单引号 所以需要将上面的语句修改为 12[Run]Filename: "{app}\CopyFiles.exe" ;Description:"修改文件" ; Parameters:"...
WPF Snipping Tool Implementation
Last week I needed to write a snipping tool on the product. I found that the articles on the blog only had the step of capturing the screen, or required following an official account for marketing, so I wrote one myself. I found an open source framework on github today. If you are ready to start writing, you can refer to that framework. https://github.com/WPFDevelopersOrg/WPFDevelopers I just finished writing it and recorded the problems I encountered to prevent forgetting them later. @[toc...
WPF 截图工具
上周需要再产品上编写一个截图工具,发现博客上的文章都是只有截取屏幕这一步,或是需要关注公众号之类的营销,便自己撸了一个,今天在github上发现了一个开源的框架,如果准备开始写的可以参照那个框架。 https://github.com/WPFDevelopersOrg/WPFDevelopers 刚刚写完便记录一下自己遇到的问题,防止后面忘掉。 @[toc] 在渲染canvas的时候报错:System.ArgumentException:“值不在预期的范围内。”12345678910var renderTargetBitmap = new RenderTargetBitmap(Convert.ToInt32(_AllScreenWidth), Convert.ToInt32(_AllScreenHeight), 96d, 96d, PixelFormats.Default); renderTargetBitmap.Render(Capture_Canvas); var targetRec = new Int3...
QT release MYSQL an instance of QCoreApplication is required for loading driver plugins
做了一个局域网验证与注册的工具,使用debug下可以正常使用,准备release打包的时候出错,报错 ()QSqlDatabase: QMYSQL driver not loadedQSqlDatabase: available drivers:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins 因为在debug的情况下可以加载mysql驱动所以应该是第三条错误引发的问题,需要先排除前面两个的嫌疑 1 首先在pro文件中添加release调试的功能 QT 设置release调试 12QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFOQMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 发现是connection的时候报错,应该是第三条报错导致的问题,在连接Mysql数据库前添加plugins文件夹的位置 解决方案:QS...
QT release MYSQL an instance of QCoreApplication is required for loading driver plugins
做了一个局域网验证与注册的工具,使用debug下可以正常使用,准备release打包的时候出错,报错 ()QSqlDatabase: QMYSQL driver not loadedQSqlDatabase: available drivers:QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins 因为在debug的情况下可以加载mysql驱动所以应该是第三条错误引发的问题,需要先排除前面两个的嫌疑 1 首先在pro文件中添加release调试的功能 QT 设置release调试 12QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFOQMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 发现是connection的时候报错,应该是第三条报错导致的问题,在连接Mysql数据库前添加plugins文件夹的位置 解决方案:QS...
Creating WPF Window in Revit Multi-Version Library Project
WPF based on .Net Core First of all, I would like to recommend our Revit secondary development open source project RevitApiWrapper In the open source framework, a multi-version generation framework is provided. Instead of using the original .netframework framework, it is changed to .net core framework. You can directly modify it. If you need custom modifications, you can refer to jimmy’s blog which provides basic implementation and configuration. .net core Project How to add WPF windows in ...
Revit 多版本类库项目创建WPF窗体
WPF基于.Net Core 首先向大家安利一下我们的Reivt二次开发开源项目RevitApiWrapper 在开源的框架中,提供了一个多版本生成的框架,不再使用原有的.netframework框架改为.net core框架,可以直接拿过来修改一下,如果有需要自定义修改的可以参照jimmy的博客里面提供了基本的讲解和配置 .net core 项目 如何在类库项目中添加WPF窗体网络上有很多办法,添加WPF的typeid或者创建组件的形式,但是使用的时候发现都不可以在此框架使用,附上链接有需要的也可以参照博客修改尝试一下 设置C#类库项目中可以添加WPF元素在普通的”类库”项目中添加 WPF 的 Window 对象 通过项目创建一个类库项目,右键添加发现没有WPF窗口,可以打开csproj文件新建group,将下面的话添加进去。 12345678<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> <OutputType>Librar...












