.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Feasibility of C#.Net and Teigha.Net

12 REPLIES 12
Reply
Message 1 of 13
manohar2375
4132 Views, 12 Replies

Feasibility of C#.Net and Teigha.Net

Hi All,

 

Could you please help me feasibility of C#.Net and Teigha.Net in detail.

 

Urgent please.

 

Thanks in Advance.

 

Regards,

Manohar.

 

 

12 REPLIES 12
Message 2 of 13
Keith.Brown
in reply to: manohar2375

To get an answer in detail you are going to have to be me specific about what you are trying to do?

 

I write very complex plugins in .NET that work for both AutoCAD and BricsCAD which uses Teigha.  So yes, it is feasible.  If you want a more detailed answer then please ask a more detailed question.

Message 3 of 13
manohar2375
in reply to: Keith.Brown

Hi Keith,

 

Thanks for your reply.

 

Please see the detail about my issue:

 

I made a function using C#.Net in AutoCAD which is opening , updating and closing dwg file like this around 300 dwg files need to do in single action but to finish all dwg files, its taking more time. my function source code and computer configuration is good.

 

i thought, if i use Teagha.Net instead of C#.Net , will i get good performance ? or which one is good to do good performance above task ?

 

May i know what are the limitations of C#.Net and Teagha.Net ?

 

Please help me.

 

Thanks in Advance.

Regards,

Manohar.

 

 

 

 

Message 4 of 13
Keith.Brown
in reply to: manohar2375

I think that you are misunderstanding what Teigha is and what C# is.  C# is a programming language.  With it you can create many different application types including AutoCAD plugins.  Teigha.NET is an API that is written for the .NET programming environment.  C#, VB.NET, F#, etc and access and use its API.  If you are programming for AutoCAD then all you need is C#, an IDE like Visual Studio AND to have AutoCAD installed on the machine where you are programming and on the machines that will be running your program.  Essentially, AutoCAD needs to be running in order for your program to work.  Whether it is the full acad.exe or the console.exe you will need one of those to be running.

 

I believe that Teigha.NET is an API that is used with RealDWG and does not need AutoCAD installed in order to be ran.  I am not 100% sure on that but I am sure that Teigha distributes its dlls with Briscad and I program against them there.  However, even if you program with the Teigha.NET dlls instead of the Autocad installed dlls, your code will more than likely but very much the same.   

 

You should not be looking towards the programming language or managed dlls distributed by either AutoCAD or Teigha but instead look at the design of your code and how it is slowing down the process.

 

Someone else could probably chip and and say things more elequently but I believe that the issue is the same no matter how you say it.   

Message 5 of 13
dgorsman
in reply to: Keith.Brown

Teigha is a third-party DWG reader, which operates in a similar manner to the RealDWG.  Its typically several DWG versions behind the Autodesk genuine product.

 

Code (and especially loop) optimization should always be the first stop when things run "slow".  Running that many files in succession in a single AutoCAD session, console or UI, will be slow.  General consensus is to spawn a single console process for each drawing processed.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 6 of 13
JamesMaeding
in reply to: manohar2375

You should have no problem using the Tiegha dwg libraries, in place of the Autocad ones.

 

I have developed extensive code that runs on both, with super minor issues that only someone like me would likely run into.

I mix lisp and .net as I am in the middle of a big transition that has gone one since acad got a .net api.

 

What I recommend to test is you take a tool written for the acad libraries, and save it as another project.

Set a "conditional compilation symbol" of BCAD BCAD16.

Then any pinvoke statements that change for bcad vs acad will be like:

 

#if BCAD16
const string dllname = "brx16.dll";
const string mangname = "?getAt@AcDbRegAppTable@@QEBA?AW4ErrorStatus@Acad@@PEB_WAEAVAcDbObjectId@@_N@Z";
#endif

[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport(dllname, CallingConvention = CallingConvention.ThisCall, CharSet = CharSet.Unicode, EntryPoint = mangname)]

public static extern ErrorStatus getAt(IntPtr symbolTable, string name, out ObjectId id, bool getErased);

 

my using statements look like:

#if ACAD
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;
using Autodesk.AutoCAD.EditorInput;
using AcEd = Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using AcCl = Autodesk.AutoCAD.Colors;
using AcDb = Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using AcGe = Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Windows;
#endif
#if BCAD
using Bricscad.Runtime;
using Teigha.Runtime;
using Bricscad.ApplicationServices;
using AcAp = Bricscad.ApplicationServices.Application;
using Bricscad.EditorInput;
using AcEd = Bricscad.EditorInput;
using Teigha.DatabaseServices;
using AcCl = Teigha.Colors;
using AcDb = Teigha.DatabaseServices;
using Teigha.Geometry;
using AcGe = Teigha.Geometry;
using Bricscad.Windows;
#endif

 

I use bricscad as the platform for my file cleaning tools, so have run on thousands with no problem.

I use it to make colored subdmeshes for tin surfaces, which is a pretty good example of how compatible things are.

If you can find something it will not do, you are likely on the highly bleeding edge of new features, and would then also have the skills to devise a solution not requiring them. Its almost too good to be true, I know.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 7 of 13

@JamesMaeding @dgorsman @Keith.Brown

 

Are you sure that in this forum should be discussed Tiegha? As far as I know Autodesk negatively relates to this. Also this forum is for AutoCAD .NET API.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 8 of 13

I don't see a problem with a clarification of what it is/does without any cheerleading.  If it veers off into how to set up, implement, license, etc. then we are definitely pushing things.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 9 of 13

Alexander,

Autodesk can censor this, but it is the right place if any is.

I think the bigger goal is to get more people using the .net api for both acad and bcad.

That will generate better 3rd party progs and adesk will get some sales from that.

 

Interesting question though - does autocad competition help autodesk or hurt it?

Now that they've gone to rental, I argue they need every bit of competition possible, or their technical people will start to look like dead weight, and go through another round of restructure like a few months ago.

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 10 of 13
JamesMaeding
in reply to: Keith.Brown

Keith Brown is right about focusing on code, not the libraries for speed.

I have tools that read lots of dwg's side database style - meaning without opening in the editor.

They run the same speed in acad or bcad.

 

Having said that, I also find bcad gets around odd issues with custom entities, as it does not have the object enablers so does not try to resolve civil3d styles and so on.

That is exotic though, both run really fast when things are working.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 11 of 13
manohar2375
in reply to: Keith.Brown

Hi Keith,

 

Thanks for your valuable help.

And i will check again my source code also.

 

Could you please share simple sample code to access dwg file using Teigha.Net API. And how to install Teigha.Net dll in my PC and how to start write program using Teigha.Net API in C#.Net.

 

Thanks in Advance.

 

Regards,

Manohar.

Message 12 of 13
Keith.Brown
in reply to: manohar2375

Hi,

 

It is not appropriate to share code for a competitive product on an Autodesk forum.  That being said, I think that you missed the point completely.  More than likely your code will not be different at all.  You will mostl likely have to update your namespaces as was mentioned in a previous reply plus a other few minor changes.

 

If you are able to share what code you have, there are many here who would be willing to share their input on your software design.

Message 13 of 13
JamesMaeding
in reply to: manohar2375

Ok, now I would say this thread should be taken to theswamp, since we are just purely talking about how to implement other parties dwg editing tools.

Having said that, there is no reason to approach it that way.

Instead, ask how it can be done with the realdwg libraries, and just switch out the references to run on the teigha libraries.

The whole point is they are clones of the autodesk libraries, from the programmer's perspective.

Under the hood, they likely do things a bit differently, but who cares.

 

Its the same for lisp too, you write in acad using the vlide as a debugger, and then try in Bcad or any other cad that supports lisp.

Now I would argue this post of mine is not counter autodesk, as I just advertised a reason you need autocad even if your main platform is not.

The vlide is acad only, and a lifesaver.

I guess another reason is you can rent autocad so can enter the market cheaper, ha ha


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost