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

Difference While Doing Customization With DataBase & Without DataBase Services

4 REPLIES 4
Reply
Message 1 of 5
dhimant.bhensdadia
478 Views, 4 Replies

Difference While Doing Customization With DataBase & Without DataBase Services

Hi,

 

I am working on the AutoCAD customization and doing the same by VB.Net & C#.Net. But I just want to know the difference as mentioned below:

 

1. Insert Block In AutoCAD

 

Using VB.Net without using DataBase services

 

Only 1 statement is required to Insert the Block

 

objAcadDocument.ModelSpace.InsertBlock(Required Arguments are here)

 

Using C#.Net with DataBase services

 

There are many statments are there to insert only 1 block

 

Like Start Transaction, Lock the document, Get the Object Id Block etc....

 

So my quetion is that when I have to use DataBase services and when not 

 

                                               OR                                         

 

what is the advantage of doing customization using DataBase services rather than go for wihout DataBase services.?

 

 

 

 

 

4 REPLIES 4
Message 2 of 5

You are mixing .NET API and ActiveX (com)

 

with the .NET API

You would need a transaction requardless of which language you are using

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



(defun botsbuildbots() (botsbuildbots))
Message 3 of 5

The difference you see as to inserting block is NOT the difference of VB.NET and C#. It is the difference of API you use for AutoCAD customizing programming. Namely, you  thought what is simple to do in VB.ENT for inserting, is because that statement uses COM API, which you can also write the same one line code with C#.

 

Considering you rprevious post, it looks like you are just starting to use .NET language to programming AutoCAD. You have 2 options of what API you are to work against: COM API or .NET API.

 

If you have previous AutoCAD VBA programming experience, and you may find some article on the net claimiing moving from AutoCAD VBA to YB.NET is easy and you follow that lead, then, IMO, you are misled, to say the least.

 

You are better off to forget all the VBA stuff and start learning use AutoCAD .NET API, since you choose to use .NET language (VB.NET or C#, not much difference, as the reply to your previous post commeted). You only look back to COM API (as you did in VBA) to see its possible useness in the .NET world AFTER you get the idea of what AutoCAD .NET APIs are and hwo to use them/program with them.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 4 of 5

Thanks for the reply..

so again I have 1 question that when I have to go for COM API & when .NET API.

Is there any extra features are provided in .NET API compare to COM API?


Message 5 of 5
_gile
in reply to: dhimant.bhensdadia

Hi,

 

Just my thought.

As far as you can, avoid using the COM API which is platform dependent. The main case you'd have to use the COM API is building standalone applications.

 

There're much more features provided with the .NET API than with the COM one.

You can compare the managed classes classmap (.NET) with the AutoCAD object Model (COM).

IMO, one of the main examples for a CAD software customization, is that .NET provides Point2d, Point3d, Vector2d and Vector3d objects with their own methods and properties when COM just uses arrays of doubles.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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