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.?
You are mixing .NET API and ActiveX (com)
with the .NET API
You would need a transaction requardless of which language you are using
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
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.