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
4 answers

c#, Autocad, Displaying the properties of hatch

I am writing an AutoCAD plugin using c# and need to display the property of hatch in the middle of the hatched object (e.g., the center of a circle). I have two problems in code: How can I access center of circle? How can I get property of…
Shahgee
  • 3,303
  • 8
  • 49
  • 81
2
votes
3 answers

How can I fix path data as circle in svg?

i have a problem, i convert the circles I drew to Autocad as high quality pdf, then I import this pdf with inkscape or corelDraw, my aim is to export this pdf as svg. No problems so far. but circles in pdf appear as path not circle in svg. There are…
2
votes
1 answer

Automated scripting changes to a CAD file

I am working as part of a project using a piece of third part software that promised, among its other features, to export items to AutoCAD format. Unfortunately it hasn't lived up to its promise and I have been tasked to create a script which will…
Sparky
  • 2,694
  • 3
  • 21
  • 31
2
votes
1 answer

DXF files - How does the normal vector and position relative to this provide full understanding of block position

I have been scratching my head for days understanding how to fully describe a block to insert in DXF. For background I am interested in the rules and behaviour of how to do this, not simply trying to find an existing library. I can create a block…
samp17
  • 547
  • 1
  • 4
  • 16
2
votes
1 answer

How to avoid AutoCAD DWG file being renamed and recreated during save?

I edit DWG files on my virtual drive, created with Cloud Filter API. When I edit DWG file using AutoCAD, the file is being renamed and than recreated. Here is the sequence of operations in file system when I save a file in AutoCAD: I tried several…
2
votes
1 answer

How to connect to an existing document in Pyautocad?

I'm new to pyautocad and trying to work with an existing .dwg file open in a running instance of autoCAD. from pyautocad import Autocad, APoint acad = Autocad(create_if_not_exists=False, visible = True) acad.Application #this gives me an error I…
unbutu
  • 125
  • 2
  • 9
2
votes
1 answer

C#.NET Autocad 2021 API: Accessing specific BlockTableRecords within a given BlockTable?

I'm looking for advice regarding the particulars of the BlockTable class. I know that although you can get an enumerator for all the blocktablerecords a blocktable contains, I can't seem to find a more efficient way of accessing a particular…
Tyler_BB
  • 47
  • 5
2
votes
2 answers

Is There is a way in .net to get centroid for polyline?

I want to get the centroid of polyline2d. I have a polyline from TraceBoundary like so: DBObjectCollection objs = Application.DocumentManager.MdiActiveDocument.Editor.TraceBoundary(Point, false); Polyline polyline = (Polyline)objs[0]; Point2d…
Khalid Omar
  • 2,353
  • 5
  • 35
  • 46
2
votes
2 answers

How to Get AutoCad Geometry Property using .Net Api c#

Hi, How to get AutoCAD drawing object property(Geometry) using .NET API. If, I get the property After I need to store property value in my database. I don't know How to store Autocad object Information in an SQL database. I need Autocad to .net…
JuniorSoft
  • 33
  • 5
2
votes
1 answer

Autolisp not setting block attribute correctly for some users

First time asker, so hopefully I'm describing the problem well enough. We have an Autolisp code in our company that is used by several individuals with the same version of AutoCAD, but for some of the users the lisp has stopped functioning…
Erroreki
  • 23
  • 2
2
votes
2 answers

Splitting a Variable's Output Value Into 2 Lines in Sheet

I am working on a program/macro that intertwines VBA with AutoCAD Mechanical 2020. Based on a userform input, the below variable "cw" is stored to output into the sheet space based on the below line of code. It currently outputs in a single line and…
GoPokes
  • 23
  • 3
2
votes
2 answers

Creating 3D geometry - CAD software

I want to create a 3D geometry of the following image. I could find ways of generating centerlines using image processing tools in Mathematica. But I am not sure how to generate 3D geometry from the skeleton. Could someone suggest CAD software…
Natasha
  • 1,111
  • 5
  • 28
  • 66
2
votes
2 answers

Trying to mirror a drawing using the AutoCAD class on C#

Currently I have an object drawn using the AutoCAD class but I the option to mirror it once drawn. I'm not sure how to go about this. [CommandMethod("DrawTestDoor")] public void DrawTestDoor() { Document acDoc =…
Joelad
  • 492
  • 3
  • 12
2
votes
3 answers

How to edit an AutoCAD PC3 file programmatically

I want to be able to add more default/custom paper sizes to a user's "DWG to PDF" PC3 file in AutoCAD, (or at least be able to read it) but the only way seems to be using the interface that AutoCAD provides. I know where the PC3 files are located,…
braX
  • 11,506
  • 5
  • 20
  • 33
2
votes
1 answer

AutoCAD C#/.Net: expose entities coordinates

My goal is to run my custom dll through AcCoreConsole and make various analysis on DWGs, such as expose Layer names and XY-coordinates on objects. I have managed to get all object in a selection set, and I can loop through the entities. When…