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

AutoCAD type library not working in Windows 10

I have an ancient program that I use for reading and writing data from AutoCAD. This program is written in Delphi 5. I have tried to update it to a newer release but several of the libraries I use no longer exist and it is a huge program with lots…
FireGuy
  • 29
  • 2
2
votes
1 answer

How to show thumbnail of a dwg-File in a excel VBA Userform

I want to write a little DMS to tag and save ACAD files. For this i am using Excel VBA. Using with ACAD 2014 / 2015 / 2019. Step 1 - save drawing: When copy some parts of the drawing, there is a copy in %temp% and something like a WindowsMetaFile…
Chris
  • 75
  • 1
  • 9
2
votes
2 answers

Autolisp routine only works sometimes

I had to change the text styles and width attributes of several blocks in Autocad. There was 10-30 blocks on each dwg and nearly 100 dgs and I could not be bothered to manually convert each block to the new…
BlueLightning42
  • 344
  • 4
  • 15
2
votes
1 answer

How to edit AutoCAD Layer Description using ezdxf

I want to know how to edit AutoCAD's Layer Description property. I have referenced the ezdxf documentation but I do not know how. Please tell me an example of how to use it.
leez
  • 85
  • 8
2
votes
1 answer

drawing line close to polyline

I have a Triangle as a polyline and I want to draw an Altitude. I give the command "line" or "_line" the right points but AutoCAD draws the line from the vertex to the adjacent vertex. It's not just in AutoLISP, AutoCAD won't let me draw a line from…
2
votes
1 answer

Is there a way to extract AutoCAD Drawings and Pictures from an OLEObject field in a table?

Just for some background, I'm a mechanical engineer at a company and the older folks here created a database in Access 2003 which basically takes an AutoCAD Drawing or a Picture OLE and plops it in a nicely framed report with a bunch of other…
Rafael
  • 81
  • 1
  • 11
2
votes
1 answer

VBA In AutoCAD Errors Inconsistently When Referencing Excel

I have a program that looks at a list of .dwg files in an excel file, opens the drawings one at a time, pulls the properties for given block references, then dumps those properties into a new sheet in the original excel file. This code runs…
John
  • 21
  • 4
2
votes
3 answers

How do I write a DXF code for a POLYLINE?

I´m trying to create a program based on C++ that calculates a function values on a given range and then the program proceeds to create a DXF file in order for it to be Graphed. The issue that I´m having it´s with the DXF part this is the code that…
JDelgado
  • 99
  • 1
  • 6
2
votes
0 answers

I want to change the bit depth of an image in R

I have been trying to get autocad to print a georeferenced photo in any format. Every time I get a photo from a private company it will not plot, however, geotiffs of the same format from my local government plot just fine. After testing may…
spmoose
  • 63
  • 1
  • 12
2
votes
3 answers

Reference both Excel 2003 and 2007 into Autocad-VBA project

I am writing a VBA (Visual Basic for Applications) script for AutoCAD. It uses Autocad as a graphical engine and Excel for displaying the results.... The problem is, that some of the users are using Excel 2003, and the other are using Excel 2007. To…
Artur Iwan
  • 1,151
  • 2
  • 10
  • 17
2
votes
1 answer

Creating Xlines in AutoCad 2019 using Excel VBA

I am making Excel VBA code for AutoCad to create a simple Xline. I made circles and lines, but Xline cancels out at the last moment. The code will go through all the steps, it plugs in Xline, then centers it as 0,0 but then it has an issue with the…
Stacie
  • 85
  • 10
2
votes
1 answer

Embed html in AutoCAD

Does anyone know of a way to embed html into Autocad? I want to be able to click on an object and a window within Autocad pop-up with some pictures and text in a table. I'm hoping there's a way that looks similar to a Google earth kml when the…
Dale
  • 19
  • 1
  • 6
2
votes
1 answer

Export coordinates of Text entities

I want to extract all the coordinates and the text itself of a specific layer into a CSV file. I am using the Mac version of AutoCAD 2018. DATAEXTRACT seems to be not available on Mac and -ATTEXT always writes: “0 records in extract file.” With…
richardXYZ
  • 33
  • 5
2
votes
1 answer

How can I refer to AutoCAD block

I having autocad project where is 1 dynamic block which I'm trying to change from excel. Here is vba script which I'm using to change block: Dim dybprop As Variant, i As Integer Dim bobj As AcadEntity For Each bobj In ACADApp.ModelSpace If…
2
votes
1 answer

AutoCAD - Save as DXF in Sub Folder

I found this code online to save a selection from an AutoCAD DWG into a DXF format in the project folder. I am not well versed in AutoLISP. What do I need to change to save all of these drawings in a subfolder called "CNC Parts"? ;save selection as…