Open new document from .NET C# API

 Hi,

I am trying to find a way to open a new document from .NET API

In AutoCAD API this is the way:
Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Add("templateName");

But in BricsCAD API the equivalent Add method is missing
Thanks.

Comments

  • @Luis Ángel Diosdado: Hi, I am trying to find a way to open a new document from .NET API In AutoCAD API this is the way: Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Add("templateName"); But in BricsCAD API the equivalent Add method is missing Thanks.

    I had to deal with this last week. You need to add the BricscadApp(BricscadApp can be found in C:\Program Files (x86)\Bricsys\BricsCAD V15 en_US\API\COM) reference. If you're coding for both Programs(Acad and Bcad) the USING alias would look like such: #if BCAD using AcBc = BricscadApp; #endif #if ACAD using AcBc = AutoCAD; #endif etc etc... AcBc.AcadApplication app = AcAp.Application.AcadApplication as AcBc.AcadApplication; AcBc.AcadDocument doc = app.Documents.Open(path, false, null);

  • In "...API/COM" there are only these files: ax_bricscadapp.h ax_bricscadapp_i.c ax_bricscaddb.h ax_bricscaddb_i.c axbricscadapp1.tlb axbricscaddb1.tlb I am working with Windows 8.1, and I have tried v14 and v15 both in 32 and 64 bits, but I can not find Bricscadapp.dll anywhere. Thanks.

  •  You dont adding references from folder api/com , you must add references in visual studio selecting COM tab. 

    Bricscadapp.dll and BricscadDb.dll are registered COM dll

  • Like so:
    imagerefs.png
  • Adding this reference solves my question

    Thanks for your invaluable help.

  • @Chris Schildmeier:I'm new to BricsCAD API.Net programming, what object is AcAp in your code :AcBc.AcadApplication app = AcAp.Application.AcadApplication as AcBc.AcadApplication;I had to deal with this last week. You need to add the BricscadApp(BricscadApp can be found in C:\Program Files (x86)\Bricsys\BricsCAD V15 en_US\API\COM) reference. If you're coding for both Programs(Acad and Bcad) the USING alias would look like such: #if BCAD using AcBc = BricscadApp; #endif #if ACAD using AcBc = AutoCAD; #endif etc etc... AcBc.AcadApplication app = AcAp.Application.AcadApplication as AcBc.AcadApplication; AcBc.AcadDocument doc = app.Documents.Open(path, false, null);

This discussion has been closed.