.NET

Reply
Mentor
santoshr0114
Posts: 161
Registered: ‎03-21-2012
Message 1 of 9 (288 Views)

Non graphical Window of AutoCAD

288 Views, 8 Replies
07-24-2012 04:56 AM

Hi Guys,

 

I need to perform some operations like count the number of line objects, get block names from a drawing file, etc.

I will not be altering a drawing object, but only getting few data from the drawing

 

I want to perform these operations without opening AutoCAD's Graphical window.

And also to mention i want to get these mentioned data from the AutoCAD database.

 

Is there a way to do so ??

 

Thank You

 

Regards
Santosh
*Expert Elite*
norman.yuan
Posts: 944
Registered: ‎04-27-2009
Message 2 of 9 (277 Views)

Re: Non graphical Window of AutoCAD

07-24-2012 06:35 AM in reply to: santoshr0114

Without lisencing RealDwg froom Autodesk, you still need AutoCAD running in order to use either ObjectDBX COM API, or use .NET API's Database.ReadDwgFile() to collect drawing data from Drawing, rather than open them in AutoCAD editor. Since you ask iin this forum, you would probably start from Database.ReadDwgFile() and go from there.

 

 

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 3 of 9 (266 Views)

Re: Non graphical Window of AutoCAD

07-24-2012 08:32 AM in reply to: santoshr0114

http://through-the-interface.typepad.com/through_the_interface/2007/07/accessing-dwg-f.html

---------------------------



(defun botsbuildbots() (botsbuildbots))
Mentor
santoshr0114
Posts: 161
Registered: ‎03-21-2012
Message 4 of 9 (247 Views)

Re: Non graphical Window of AutoCAD

07-24-2012 09:16 PM in reply to: norman.yuan

Hi norman.yuan,

 

I understand that AutoCAD needs to e running to get the data,

 

Is is possible to use an instance of AutoCAD and use the same instance without graphical presentation to the user, to process the drawing file and close the instance when the task is done.

 

And also i want to call my operation from outside not within AutoCAD.

I don't want to use Netload or any other AutoCAD UI, i just want to create a desktop icon and when double clicked selects a drawing and does the required task.

 

And also i would like to mention again that  "i don't want to edit the drawing, i just want to access the AutoCAD database to get some count information in the drawing"

 

Thank You

Regards
Santosh
Mentor
santoshr0114
Posts: 161
Registered: ‎03-21-2012
Message 5 of 9 (245 Views)

Re: Non graphical Window of AutoCAD

07-24-2012 09:18 PM in reply to: arcticad

Hi Arcticad,

 

I dont want to run a command inside AutoCAD.

 

I already have a program to do my task inside AutoCAD using the Netload and Passing a command.

Now i need to do the same Outside AutoCAD, With minor changes in my program

 

Thank You

Regards
Santosh
Mentor
amitk_189
Posts: 232
Registered: ‎12-15-2011
Message 6 of 9 (235 Views)

Re: Non graphical Window of AutoCAD

07-24-2012 11:29 PM in reply to: norman.yuan

But how will you implement Database.ReadDwgFile file option, i tried this part of code.

Database.ReadDwgFile  will work only inside autocad and not out side autocad.

 

Rgds

Amit

*Expert Elite*
GTVic
Posts: 906
Registered: ‎09-07-2004
Message 7 of 9 (204 Views)

Re: Non graphical Window of AutoCAD

07-25-2012 01:43 PM in reply to: amitk_189

You could do this with the COM interface. This other post contains some information and links:

 

http://forums.autodesk.com/t5/NET/Read-Layers-in-Active-Document-from-external-VB-Net-App/td-p/35476...

*Expert Elite*
norman.yuan
Posts: 944
Registered: ‎04-27-2009
Message 8 of 9 (199 Views)

Re: Non graphical Window of AutoCAD

07-25-2012 02:58 PM in reply to: amitk_189

From external EXE app, you do not use Database.ReadDwgFile() from .NET API, you use ObjectDBX COM API, which is basically the same as you open drawing in AutoCAD editor and then access data in AcadDocument via COM API, but since the drawing is not opened in editor, it is a lot fast.

 

Searching ObjectDBX in VBA forum would brings you a lot old posts on that topic.

Distinguished Mentor
andrewpuller3811
Posts: 759
Registered: ‎07-30-2008
Message 9 of 9 (174 Views)

Re: Non graphical Window of AutoCAD

07-27-2012 05:47 AM in reply to: santoshr0114

You could look into the core console if you are using 2013.

 

Have a look at kean's post here

 

http://through-the-interface.typepad.com/through_the_interface/2012/02/the-autocad-2013-core-console...

 

If this fixed your issue, click on "Accept as Solution"

Andrew Puller
Maitland, NSW, Australia
Windows 7 Enterprise 64bit
Intel core i7 2600 @ 3.40 GHz with 16GB Ram
Civil 3d 2013 64bit

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community