Non graphical Window of AutoCAD

Non graphical Window of AutoCAD

Anonymous
Not applicable
2,280 Views
8 Replies
Message 1 of 9

Non graphical Window of AutoCAD

Anonymous
Not applicable

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

 

0 Likes
2,281 Views
8 Replies
Replies (8)
Message 2 of 9

norman.yuan
Mentor
Mentor

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.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 9

arcticad
Advisor
Advisor

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

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



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 4 of 9

Anonymous
Not applicable

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

0 Likes
Message 5 of 9

Anonymous
Not applicable

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

0 Likes
Message 6 of 9

amitnkukanur
Collaborator
Collaborator

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

Senior Software Engineer
0 Likes
Message 7 of 9

GTVic
Advisor
Advisor

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...

0 Likes
Message 8 of 9

norman.yuan
Mentor
Mentor

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.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 9 of 9

andrewpuller3811
Advisor
Advisor

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 a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.

Andrew Puller
Maitland, NSW, Australia
Windows 11
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2023
0 Likes