Questions tagged [autocad]

Drafting and design software.

AutoCAD is produced by Autodesk Inc. It is a base product for many of their software offerings that are designed for specific tasks such as architectural, mechanical and civil drafting. AutoCAD is customizable by means of several APIs.

  • Autolisp - A flavor of LISP.
  • VBA - Microsoft VBA became available as an API during the release of AutoCAD 14 prior to 2000. Autodesk has warned that VBA will not be supported in releases after 2012... but it is, even in native 64-bit for the 1st time in v2014.
  • Managed .NET - A managed .NET API is currently the customization platform of choice for many AutoCAD programmers. Of the .NET languages C# is currently the most popular but VB.NET has a stronger-than-usual following because of AutoCAD's VBA history.
  • the JavaScript API was introduced in v2014.
  • ObjectARX/ObjectDBX - A native C++ based API that became available during the release of AutoCAD 13. Less popular than the .NET API because it requires writing much more code and more complex code to accomplish most tasks. Some types of projects (complex custom objects) can only be done via this API.

Autodesk also licenses two stand-alone AutoCAD environments to develop on top of, RealDWG and AutoCAD OEM. OEM has a user interface and RealDWG does not. The licensing model for each is very different - OEM is licensed as a percentage of each sale, RealDWG has fixed license costs.

There is an independent reverse-engineered library that is compatible with AutoCAD made by the Open Design Alliance. Compatibility can lag a little when Autodesk does its 3-yearly binary shuffle and changes the file format. AutoCAD v 2013 changed the application's internal structure, as well as the file format.

The ODA is not open-source nor is it free (as in beer but it is free as in speech) and is not necessarily cheaper than Autodesk's licensing, depending on if / how many sales you make. ODA's Teigha is used as the basis for products like IntelliCAD etc. You can build stand-alone applications on it.

Resources

1395 questions
3
votes
3 answers

Monitoring a particular file closure c#

I am developing a windows application to compliment our web application, it is a small document management system like dropbox, I have to automatically sync the files on its closure, for e.g. if a .dwg (AUTOCAD) file is opened through my…
midhun
  • 39
  • 4
3
votes
1 answer

C# Code to Control AutoCAD's Camera

In AutoCAD 2015 you can use this camera control to instantly get different views of your model And by clicking on an entity or group first and then a part of the cube it'll zoom in onto that entity or group. Is there a way to do that…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
3
votes
2 answers

Using C# to Join AutoCAD Entities into a Block Programmatically

I'm trying to write a method that prompts the user to select all the entities they want to combine into a block and then joins them together into a block and returns the block reference. Right now it looks like this. ///
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
3
votes
3 answers

Using Editor class in AutoCAD to execute commands

I'm trying to create a button that, when pressed, marks the position of the drawing. Right now the method looks like this. [CommandMethod("MARKPOS", CommandFlags.Session)] public void MarkPosition() { Editor ed =…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
3
votes
3 answers

C# Drawing Oracle Spatial Geometries

I need to create a simple app which can display geometries from Oracle Spatial in C#. These geometries are exported from AutoCAD Map 3D 2010 to Oracle Spatial. I need to pan, zoom, manage layers of these objects, events (like right click to popup a…
Keeper
  • 3,516
  • 1
  • 18
  • 29
3
votes
3 answers

Is there a way to get all Polylines in autocad (.dwg) using C#?

I don't want to select the specific polyline in runtime. Is there a way to directly get all polylines in .dwg file using C# without selection during runtime ? AutoCAD has a command called DATAEXTRACTION to get related information for different…
tony.0919
  • 1,145
  • 5
  • 16
  • 27
3
votes
4 answers

AutoCAD eNotOpenForWrite

I'm programming an AutoCAD plugin in C#.NET. I need a way to set Table.IsReadEnabled and Table.IsWriteEnabled to true. I have a method called addRow() shown here: public void addRow(String[] data) { OpenCloseTransaction tr =…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
3
votes
5 answers

Using Lisp (or AutoLisp) how good is the associative lists performance?

I'm doing an AutoLisp project which uses long associative structures to do heavy geometrical processing - so I'm curious about the associative list intense use timing results. How simple/complex is the implementation? It uses some data structure or…
user13383
  • 33
  • 1
  • 3
3
votes
2 answers

Opening AutoCAD from Windows Forms Application

I am writing a program using a Windows Form in C# that models 3d objects and then is supposed to open AutoCAD from the .NET framework to draw the objects, and I'm trying to figure out the best way to do that. I've tried previously opening AutoCAD…
Archer
  • 492
  • 1
  • 4
  • 12
3
votes
4 answers

SaveAs in COM hanging AutoCAD

I'm implementing an application which uses COM in AutoCAD's ObjectARX interface to automate drawing actions, such as open and save as. According to the documentation, I should be able to call AcadDocument.SaveAs() and pass in a filename, a "save as…
Andy Shellam
  • 15,403
  • 1
  • 27
  • 41
3
votes
7 answers

Generate identical Hashcodes for approximately-similar numbers

I'm creating an application in C# 3.5 that uses the AutoCAD API to read a 2D AutoCAD drawing, make changes to the drawing using defined business logic, then adjust it back in AutoCAD. Due to the nature of the logic, the shape of the drawing has to…
Andy Shellam
  • 15,403
  • 1
  • 27
  • 41
3
votes
1 answer

AutoCad: Getting 'Invalid object array exception' in Late Binding while copying Objects

I have two drawings, dg1 and dg2. I have defined a block 'b1' in dg1 which I want to copy in dg2. It works well in Early Binding but giving error when I try code in late binding. The code in question is: private void Form1_Load(object sender,…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
3
votes
1 answer

Open a new instance of AutoCAD via Python

Does anyone have any experience using Python with AutoCAD? I'm just trying, as a test to see if I can open a new instance of AutoCAD via Python and though that PyAutocad worked well (feel free to offer other suggestions, if you have any). Anyway…
prestonsmith
  • 758
  • 1
  • 9
  • 29
3
votes
6 answers

How to close a file in Autocad using C# keeping acad.exe running?

I am using visual studio 2010 and I am having a .DWG file which I want to open in autocad. Till now I have used this. Process p = new Process(); ProcessStartInfo s = new ProcessStartInfo("D:/Test File/" + fileName); p.StartInfo = s; p.Start(); But…
Rahul
  • 1,070
  • 3
  • 21
  • 47
3
votes
1 answer

SOAP request from within an AutoLISP/AutoCAD macro

We have built a webservice for a client that uses AutoCAD. They have a macro that runs in AutoCAD that builds a SOAP request. But they have not figured out how to actually send() the soap request to us. So the XML is all proper and ready to go, they…
mschmidt42
  • 1,065
  • 1
  • 9
  • 12