• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    santoshr0114
    Posts: 59
    Registered: ‎03-21-2012

    Non graphical Window of AutoCAD

    224 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

     

    Santosh Ramamurthy
    Software Engineer
    MicroGenesis Consulting Services Pvt. Ltd.
    Please use plain text.
    *Expert Elite*
    Posts: 680
    Registered: ‎04-27-2009

    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.

     

     

    Please use plain text.
    *Expert Elite*
    arcticad
    Posts: 1,250
    Registered: ‎06-21-2004

    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

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



    “We don’t have a snowball’s chance in a blast furnace of surviving this attack unless every one of our units gets into the fight right now!”
    Please use plain text.
    Valued Contributor
    santoshr0114
    Posts: 59
    Registered: ‎03-21-2012

    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

    Santosh Ramamurthy
    Software Engineer
    MicroGenesis Consulting Services Pvt. Ltd.
    Please use plain text.
    Valued Contributor
    santoshr0114
    Posts: 59
    Registered: ‎03-21-2012

    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

    Santosh Ramamurthy
    Software Engineer
    MicroGenesis Consulting Services Pvt. Ltd.
    Please use plain text.
    Distinguished Contributor
    amitk_189
    Posts: 169
    Registered: ‎12-15-2011

    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

    Please use plain text.
    Distinguished Mentor
    Posts: 839
    Registered: ‎09-07-2004

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

    Please use plain text.
    *Expert Elite*
    Posts: 680
    Registered: ‎04-27-2009

    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.

    Please use plain text.
    Distinguished Mentor
    Posts: 661
    Registered: ‎07-30-2008

    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
    Please use plain text.