Questions tagged [autocad-plugin]

External libraries (AutoLISP, ObjectARX, .NET) that can be integrated into AutoCAD for customization.

AutoCAD can be customized/enhanced using AutoCAD plugins, which are external libraries that can be developed and integrated into AutoCAD. The three widely used customization API's include AutoLISP, ObjectARX and AutoCAD.Net.

368 questions
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

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

Fatal Error: Unhandled Access Exception in AutoCAD C#.NET plugin

I'm writing a plugin that is supposed to read data from a binary file on startup. Upon starting up it is supposed to read the data from the file and ask the user to select a location to display the data in the table. The plugin is supposed to…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
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
2
votes
1 answer

Location and usage of AcadApplication for AutoCAD 2022

I am trying to find out how I can get AutoCAD to recognize a running instance. However I am running into an issue where the AcadApplication is not recognized does not exist on Application as outlined in the code below. I am making this to avoid…
2
votes
1 answer

"using" in C# - do helper functions called from within a using statement use the included IDisposable object?

I'm developing a plugin application for AutoCAD 2021 using the ObjectARX C#.Net framework. I'm trying to refactor it / make the code easier to understand at the moment, as I'll be returning to school soon and I'm currently the only full-time coder…
Tyler_BB
  • 47
  • 5
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

How to let user select entities or KWord in AutoLISP?

In my command I want to let user select entities, but if he wants, he should be able to use KWord. Something like command with prompt: Select elements od [Settings]: I know that I can use KWord while entsel. But entsel allows me to select only one…
CAD Developer
  • 1,532
  • 2
  • 21
  • 27
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…
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
2 answers

How to call a function from a DLL in AutoCAD via custom menu?

In AutoCAD, I learned how to make a custom menu item via Customize User Interface by making a command with the following Macro: After selecting the created custom menu, a "Security - Unsigned Executable File" dialog would launch: How do I write…
libzz
  • 589
  • 2
  • 10
  • 29
1 2
3
24 25