Hi,
I want to control AutoCAD via the COM API in C# (an out-process app) and get possible intersections / interference objects of an AutoCAD.AcadSurface and AutoCAD.Acad3DSolid.
I tried several methods but none works:
In .NET API (in-process) there is a method Surface.createInterferenceObjects() (see here: https://forums.autodesk.com/t5/net/solid3d-checkinterference-overload-with-other-entities-e-g/m-p/82...)
In C++ ObjectARX there is also a method AcDbSurface::createIntereferenceObjects() (see here: https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/OARXMAC-RefGuide/file...)
Is there a way to do this in COM API in C#? I would be very happy if someone could help me. Many thanks in advance.
I use AutoCAD Mechanical 2019 and Windows 10.
Solved! Go to Solution.
Hi,
I want to control AutoCAD via the COM API in C# (an out-process app) and get possible intersections / interference objects of an AutoCAD.AcadSurface and AutoCAD.Acad3DSolid.
I tried several methods but none works:
In .NET API (in-process) there is a method Surface.createInterferenceObjects() (see here: https://forums.autodesk.com/t5/net/solid3d-checkinterference-overload-with-other-entities-e-g/m-p/82...)
In C++ ObjectARX there is also a method AcDbSurface::createIntereferenceObjects() (see here: https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/OARXMAC-RefGuide/file...)
Is there a way to do this in COM API in C#? I would be very happy if someone could help me. Many thanks in advance.
I use AutoCAD Mechanical 2019 and Windows 10.
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to Solution.
@Anonymous wrote:
Is there a way to do this in COM API in C#? I would be very happy if someone could help me. Many thanks in advance.
Sorry for bad news but in COM API there is no methods for that. But you can create arx-plugin, load it into AutoCAD and communicate with it.
AcDbSurface::createInterferenceObjects and AcDbSurface::booleanIntersect methods can help you.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
@Anonymous wrote:
Is there a way to do this in COM API in C#? I would be very happy if someone could help me. Many thanks in advance.
Sorry for bad news but in COM API there is no methods for that. But you can create arx-plugin, load it into AutoCAD and communicate with it.
AcDbSurface::createInterferenceObjects and AcDbSurface::booleanIntersect methods can help you.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Thank you very much for your quick answer.
I will try to use another solid instead of a surface then.
I chose to use the COM API instead of the .NET API (for an in-process app) because it gives me full control over AutoCAD. What I need to do is insert a solid and get the return value from the interference method and I prefer to let my out-process app control the inputs and outputs instead of handing it over to AutoCAD, executing a custom command and then reading some user variable. (I tried this and find it a bit unsatisfying.)
And I don't know any C++ yet.
Thank you very much for your quick answer.
I will try to use another solid instead of a surface then.
I chose to use the COM API instead of the .NET API (for an in-process app) because it gives me full control over AutoCAD. What I need to do is insert a solid and get the return value from the interference method and I prefer to let my out-process app control the inputs and outputs instead of handing it over to AutoCAD, executing a custom command and then reading some user variable. (I tried this and find it a bit unsatisfying.)
And I don't know any C++ yet.
1. AutoCAD COM/ActiveX API has not been developed for more than 10 years.
2. Out-process is much slower than In-process
I think in your case you can use AcCoreConsole. You can start it from your external application and load .NET-plugin into it to use all functionality of AutoCAD .NET API instead of COM API. This is the fastest and most effective method. IMHO.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
1. AutoCAD COM/ActiveX API has not been developed for more than 10 years.
2. Out-process is much slower than In-process
I think in your case you can use AcCoreConsole. You can start it from your external application and load .NET-plugin into it to use all functionality of AutoCAD .NET API instead of COM API. This is the fastest and most effective method. IMHO.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Can't find what you're looking for? Ask the community or share your knowledge.