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
1 answer

How to find which Lines and Arcs are connected when imported from DXF?

I am using ezdxf to import a .dxf file into Python. It works smoothly. I get a list of lines and arcs. How do I figure out which lines and arcs are connected to each other? Are they somehow indexed or do I need to search start and end points of…
Tola
  • 254
  • 3
  • 17
3
votes
1 answer

Saving AutoCAD files (.dwg) using Python

I am using win32com to automate some simple tasks in AutoCAD. It's mostly been working quite well except for being able to save files. My goal is to open a (template) file, adjust it depending on what is needed then save the file as a .dwg in…
Jowizo
  • 57
  • 1
  • 5
3
votes
0 answers

Update layer Autocad Map 2014 from c#

I use fdo and c# to connect to spatial data base postgis from Autocad Map 3D, when I insert a new element to a table , the database update attribute 'id' and 'id_rev' (primary key) from a sequence, but in Autocad Map 3d 2014 it appears the new…
jcortega
  • 41
  • 2
3
votes
1 answer

Set and Reset of System Variables - AutoCAD LISP

I'm trying to make drawing wiring diagrams extremely easy in AutoCAD with next to no button presses other than my pre-programmed ones. One involves a LISP that is not playing nicely with setting system variables and then resetting them to what they…
3
votes
1 answer

Moving an AutoCad DXF solid along a 3D path in Mathematica

I came across this post and found belisarius' answer interesting. Wondering whether he someone can post his complete mma code and give some explanation. In general, my question is about how to achieve this kind of annimation/plotting behavior in…
Qiang Li
  • 10,593
  • 21
  • 77
  • 148
3
votes
1 answer

How do I access Quoted Variable Data in AutoLisp?

I'm having trouble accessing the information stored in the lists STPT1 and ENDPT1 which are x(0), y(1), and z(2) coordinates. For instance, after getting a point: (45.4529 21.6384 0.0) when I inspect with Visual LISP (-(NTH 1 STPT1) 0.5) I get a…
3
votes
3 answers

How to create an AutoCAD object through a Lambda expression and return it

I am new-ish to C# programming (and programming in general) but I'm getting my feet wet with AutoCAD development using the AutoDesk .NET API for projects at work. There are certain repetitive tasks in AutoCAD dev that I've been creating helper…
Kefka
  • 89
  • 7
3
votes
2 answers

What does it mean when a dxf vertex with a bulge factor is not followed by an end point?

I have a DXF file that was exported from a drawing of a simple arc that starts at (0, 0), ends at (2, 0) and has a radius of 1.0. I would expect the LWPOLYLINE to be made up of two vertices with the first containing the start point and bulge factor,…
3
votes
2 answers

What is the order of load AutoCAD plugins?

There are few ways of automatic load applications - plugins when AutoCAD starts. I know those: startup suite - attached by GUI List item %appdata%....\support\zwcad2018.lsp ( I use ZWCAD, maybe in Acad, there is another path. The long time ago when…
CAD Developer
  • 1,532
  • 2
  • 21
  • 27
3
votes
1 answer

AutoCad VBA finding the X &Y locations of existing blocks

I am trying to find the x and y locations of blocks already in the AutoCad document on a specific layer. Currently the code is just returning the X-position and ent.InsertionPoint(0) and ent.InsertionPoint (1) returns nothing. Any help would be…
Chris
  • 55
  • 7
3
votes
1 answer

Execute Code On Lisp Exit

I have a lisp written that involves setting a variable, then selecting points inside of a loop. Once I decide that I am done selecting points, I would like to be able to revert that variable back to what it was originally when I press the escape…
Bigbob556677
  • 1,805
  • 1
  • 13
  • 38
3
votes
3 answers

Running AutoCAD from command line only

I would like to run an AutoCAD script, print the resulting drawing to PDF and exit AutoCAD, all without a single click (so we can schedule it on a server). Is that possible with AutoCAD?
dijxtra
  • 2,681
  • 4
  • 25
  • 37
3
votes
1 answer

Rubberduck in Autocad

I see that v2.0: 75% there post mentions Autocad and there is an AutoCADApp.cs file, but I can't seem to find a reference for using Rubberduck outside of Office, under some random host application. There is this Adding a new Host Application to…
Nicu Tofan
  • 1,052
  • 14
  • 34
3
votes
6 answers

The application is in break mode. your app has entered a break state,

I found myself in this same problem than here, I'm using windows forms in a dll (this is for an Autocad plug-in) and I cannot debug my code because I receive "The application is in break mode. your app has entered a break state, but no code is…
user3223834
  • 59
  • 1
  • 1
  • 9
3
votes
3 answers

how to deal with dwg file

I want to use code to analyze dwg file. Any one know any SDK tools to start with?
user496949
  • 83,087
  • 147
  • 309
  • 426