问题标签 [autocad-plugin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - Serialization Code Causes Unhandled Exception
I am attempting to create a some code that can serialize and deserialize a library of Classes into an AutoCAD drawing. This question has little to do with AutoCAD other than it being the reason why I cannot debug it by normal means. I started this project from this article and successfully got his code to run. However the way his code is structured, It would require me to have all of my classes inherit from his baseobject. As this clearly is a code smell, I knew I needed to create an interface instead. Below is the code that I ended up with.
This first section is the code responsible for doing the serialization into an AutoCAD drawing.
The second section is an example of a class that implements my custom serialization interface
Here is a dummy class I am attempting to test with:
and here is the interface:
When I attempt to run the code inside AutoCAD, All I get is this error. Which leads me to believe there is a simple bug in my initialization of my classes. Non of my breakpoints get hit.
How should I debug this? and where have I screwed up my initialization?
[EDIT]-Here is what is in the "Details":
c# - AutoCAD API 检测层内的形状
我正在使用带有 API 的 Autocad 2012。我正在用 c# 开发。
我要做的是选择某个图层,并“检测”该图层中的所有矩形/正方形。Ultimateley,我希望能够在我“检测到”的所有矩形内绘制(使用它们的坐标)。
到目前为止,我正在使用 LayerTable 类和 GetObjects 将图层与对象关联起来,如下所示:
我似乎无法弄清楚从这里去哪里。如何只选择一层,然后检测其中的形状。就要研究的类/方法而言,有人能指出我正确的方向吗?谢谢。
c# - Hide parent window, but show child window
I'm working on an application that should do the following on start-up:
- Connect to an external application using COM (AutoCAD).
- Send message to the application to run some DLL code (opens a window).
- Hide AutoCAD's window, but keep the DLL's window visible.
I've successfully completed the first 2 steps, but the third is giving me some issues.
I do not know if it is possible to make a child window visible while it's parent is not visible. Every time that I make the child visible or make it the top most window, AutoCAD becomes visible as well.
My objective is to run my DLL code, but keep AutoCAD running in the background, completely invisible to my users. The DLL must be loaded, through AutoCAD, because it allows me to work with AutoCAD's .NET interface as opposed to COM.
In any case, I'm curious if what I'm trying to do is possible, perhaps through some Windows API calls or perhaps something in .NET.
PS: I'm unsure if this window relationship is really a parent-child one. I'm assuming it is though because my window belongs to the AutoCAD application instance due to the DLL loading.
Any help is greatly appreciated. Thanks! :)
EDIT: DLL Code to create a window.
Main Application Code
vb.net - VBA6 -> VBA7 - 将代码转换为 64 位时出现问题 - 将窗口置于前台 (AutoCAD 2014)
我正在转换一些非常旧的 VBA 代码以在 AutoCAD 2014 上运行。到目前为止,我已经转换了所有内容,但表单存在问题(它们是无模式的,需要激活回调来修改窗口属性)。以下是VBA6源代码:
在表格中:
模块(命名为 modModeLessFormFocus):
运行时出现的错误是“AddressOf EnumWindowsProc”上的 UserForm_Activate 中的“类型不匹配”。我尝试使用 PtrSafe 和 PtrLong 将其转换为 64 位,但不可避免地会失败并且程序崩溃。
如果有人足够聪明地转换这一点或指出我正确的方向,我将非常感激。
谢谢
c# - 在 Autocad 中保存图形时发生错误
我尝试使用 ActiveDocument.save() 保存绘图。但是我收到了警告消息,例如“警告保存期间发生错误,我们建议您运行恢复”。谁能帮我解决这个问题。
提前致谢..
c# - 如何在 Autocad.net 2007 中创建 Acad 代理实体?
我有一个像这样的代理对象
但我不知道如何用 C# (autocad.net) 创建相同的
c# - 使用 Lisp 函数将 .NET 插件加载到 AutoCAD 2014
我有一个使用 C# .NET 完成开发的插件。因为我希望 AutoCAD 在启动时加载多个插件,所以我使用 Lisp 脚本,通过一个函数调用加载我的所有插件。由于这是我计划的许多 .NET 插件中的第一个,因此我使用 Lisp 程序来加载每个 DLL 文件。其功能是
其中包含该函数的 Lisp 文件ShowHideLayers.dll
都.bundle
位于 AutoCAD 漫游数据的文件夹中。
但是,当我启动 AutoCAD 并调用 时LoadDLL
,我得到一个错误并且不知道为什么:
我无法确定错误的原因。我错过了什么?
c# - 在 C# 中将父类强制转换为子类
我正在使用 C# 和 .NET Framework 为 AutoCAD 2014 编写插件。我像这样扩展了 Autodesk 的Table
课程:
我的想法是,我想将已经在 AutoCAD 绘图上绘制的表格作为一个实例从绘图中拉出,OpeningDataTable
这样我就可以使用我编写的方法来操作数据。我这样做是这样的:
但是,我收到一条错误消息,提示我无法将Table
对象(父类)转换为OpeningDataTable
对象(子类)。
这个问题有简单的解决方法吗?
c# - 致命错误:AutoCAD C#.NET 插件中未处理的访问异常
我正在编写一个插件,它应该在启动时从二进制文件中读取数据。在启动时,它应该从文件中读取数据并要求用户选择一个位置以在表中显示数据。该插件应该以编程方式最小化表格,然后在 AutoCAD 的命令行中要求用户选择表格应该在的位置
但是,在尝试执行显示的中间代码行以最小化表单时,AutoCAD 崩溃并显示一个对话框,显示“致命错误:未处理的访问冲突读取 0x0000 异常在 206206edh”
我怀疑我必须以编程方式设置 WindowsDoors f 对象才能以编程方式被弄乱,但不确定我是否正确,或者如果我正确,该怎么做
c# - 设置 Visual Studio 2013 以开发 AutoCAD 2015 插件
我正在尝试继续在 Visual Studio 2013 中为 AutoCAD 开发插件。我打开了我的项目文件,并且所有对 Autodesk 库的引用都丢失了。为了解决这个问题,我添加了对来自 ObjectARX 2015 的以下 dll 文件的引用,如随附的 dll 图像所示。我正在使用以下 Autodesk 命名空间:
添加丢失的参考会使错误消失,直到我尝试测试我的程序,此时我得到新的错误,用灰色而不是红色强调 Autodesk 参考,如附图所示。我不知道为什么添加的引用不起作用。可能还值得知道我已经从 Visual Studio 2012 迁移到 Visual Studio 2013 和 AutoCAD 2014 到 AutoCAD 2015