.NET

Reply
Active Member
jjlaseca
Posts: 9
Registered: ‎11-21-2005
Message 1 of 7 (95 Views)

C# application

95 Views, 6 Replies
11-21-2005 04:48 AM
Hello everyone!

I've got some questions

a) I need a .NET application (not dll library) with C# that generates a dwg drawing, is it possible?

b) If it's possible, what I need?

Thanx
*Norman Yuan
Message 2 of 7 (95 Views)

Re: C# application

11-21-2005 07:00 AM in reply to: jjlaseca
A *.dwg file can only be created by AutoCAD (unless you are registered
ObjectDBX, now kown as RealDWG, developer, which requires C++, not .NET
managed code). So, to your question, you can only do it if you/your user
have AutoCAD installed, you app (written in .NET C#/VB.NET or non-.NET
language) just makes/automates AutoCAD to create a *.dwg file.

wrote in message news:5018799@discussion.autodesk.com...
Hello everyone!

I've got some questions

a) I need a .NET application (not dll library) with C# that generates a dwg
drawing, is it possible?

b) If it's possible, what I need?

Thanx
Contributor
Khalique
Posts: 14
Registered: ‎11-14-2005
Message 3 of 7 (95 Views)

Re: C# application

11-21-2005 07:14 AM in reply to: jjlaseca
Hi jjlaseca,
I am vsual studio 2003 developer though I am not very much familiar with autocad. Recently I started on a project (a stand alone application, executable) that starts autocad, loads a drawing and checks for certain blocks and attributes. I am still struggling with it. However, I can tell you how I am doing it.
We have autocad 2005, visual studio 2003 and .Net 2005 autocad libraries, namely Type Library 2005.
After creating the project you need to add reference to type library. Then you add following statements at the top of the code file.
--
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Interop.Common;
--
Here is the code to start the autocad application and load a drawing.
You can write this code in any method that suites your design.
--
private AcadApplication _app;
_app = new Autodesk.AutoCAD.Interop.AcadApplicationClass();
_app.Visible = true;
AcadDocument _doc = _app.Documents.Open(fileName, false, "");
--
This code will give you application and document objects and unlike me, if you are an expert autocad user, you should be able to inspect and understand all the methods and pproperties inside visual studio IDE.
In the Dispose method, you need to close the autocad application
--
if(_app != null)
_app.Quit();
--
Hope this will help.
kr
*J. Daniel Smith
Message 4 of 7 (95 Views)

Re: C# application

11-21-2005 07:22 AM in reply to: jjlaseca
I suspect "acdbmgd.dll" is part of RealDWG, so .NET should be an option in
that enviroment.

Dan

"Norman Yuan" wrote in message
news:5018964@discussion.autodesk.com...
A *.dwg file can only be created by AutoCAD (unless you are registered
ObjectDBX, now kown as RealDWG, developer, which requires C++, not .NET
managed code). So, to your question, you can only do it if you/your user
have AutoCAD installed, you app (written in .NET C#/VB.NET or non-.NET
language) just makes/automates AutoCAD to create a *.dwg file.

wrote in message news:5018799@discussion.autodesk.com...
Hello everyone!

I've got some questions

a) I need a .NET application (not dll library) with C# that generates a dwg
drawing, is it possible?

b) If it's possible, what I need?

Thanx
*Norman Yuan
Message 5 of 7 (95 Views)

Re: C# application

11-21-2005 11:24 AM in reply to: jjlaseca
Yes, it is part of RealDwg, but you need AutoCAD to use that (use that
INSIDE AutoCAD).

"J. Daniel Smith" wrote in message
news:5018994@discussion.autodesk.com...
I suspect "acdbmgd.dll" is part of RealDWG, so .NET should be an option in
that enviroment.

Dan

"Norman Yuan" wrote in message
news:5018964@discussion.autodesk.com...
A *.dwg file can only be created by AutoCAD (unless you are registered
ObjectDBX, now kown as RealDWG, developer, which requires C++, not .NET
managed code). So, to your question, you can only do it if you/your user
have AutoCAD installed, you app (written in .NET C#/VB.NET or non-.NET
language) just makes/automates AutoCAD to create a *.dwg file.

wrote in message news:5018799@discussion.autodesk.com...
Hello everyone!

I've got some questions

a) I need a .NET application (not dll library) with C# that generates a dwg
drawing, is it possible?

b) If it's possible, what I need?

Thanx
Active Member
jjlaseca
Posts: 9
Registered: ‎11-21-2005
Message 6 of 7 (95 Views)

Re: C# application

11-21-2005 11:12 PM in reply to: jjlaseca
Thanx a lot. Your tips have solved part of my problem. See u!!
*Fred Chateau
Message 7 of 7 (95 Views)

Re: C# application

01-03-2006 02:43 PM in reply to: jjlaseca
wrote ...

> This code will give you application and document objects and unlike me, if
> you are an expert autocad user, you should be able to inspect and
> understand all the methods and pproperties inside visual studio IDE. In
> the Dispose method, you need to close the autocad application.

Am I missing something or do you need to know C++ even if you are writing
your ObjectARX application in C#. So far every API I've reviewed lists
classes and methods that refer you to the C++ documentation.

If I need to learn the C++ terminology to use the methods, that's OK, but I
keep seeing C++ pointers in the docs and my concern is that they are
expecting you to write "Unsafe Code" blocks within your C# classes to handle
them.

Regards,

Fred Chateau
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.