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
2
votes
0 answers

Getting Rid of Diagonals in an AutoCAD Mesh (C#)

I'm trying to draw a wall in AutoCAD which is comprised of a series of rectangles. I want to use meshes to render them as solid objects. I got it so the visuals look mostly like what I want except there are seemingly random diagonal lines in each…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
1 answer

Drawing a box with meshes in AutoCAD (C#)

I've been playing around with AutoCAD API's PolygonMesh class. I want to draw a simple box using meshes. Here is a simple method I wrote to see how PolygonMesh behaves [CommandMethod("TESTSIMPLEMESH")] public void TestSimpleMesh() { // Get the…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
1 answer

Insert a Block at an Angle in AutoCAD (C#)

I'm trying to write a method that will properly draw a block in AutoCAD. Right now this is the best I've got: public static BlockReference DrawBlock(string name, Point3d position, string layerToInsertOn, List attributeValues = null, Distance…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
2 answers

Loading assembly at runtime, Autocad plugin example

After hours spent on this subject (and also dozens of pages visited) i am forced to ask for a help. I have seen a lot of posts on this subject, but i couldn't fix problem i get. Basically, i want to do very simple thing: load assembly from my folder…
miki
  • 380
  • 6
  • 15
2
votes
1 answer

Programmatically get the location of a block in AutoCAD with its ObjectId

I'm trying to write a method to change an existing block in an AutoCAD drawing. In this case, I want to change the length of a block by changing its scale factors. The method I've written will accomplish that by deleting the old block and creating a…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
0 answers

A C# Method to Import Block Definitions into AutoCAD

I'm trying to write a method to programmatically import blocks into a drawing so that my .NET plugin can place instances of those blocks into the drawing. Right now my method looks like this: /// /// Method to…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
1 answer

Entities wrong when importing multiple DXF files

I have 3 different BlockTableRecord's that I want to update. I am loading external .dxf files that contain the entities for each block definition. Now when I delete the old entities and load in the new ones it works perfectly fine but as soon as I…
user2479356
2
votes
2 answers

C# Cannot Bind to Target Method

I'm working on being able to serialize C# objects to AutoCAD entities. I have a method that serializes them and I'm trying to call this method from the AutoCAD command line intended to deserialize them. …
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
2 answers

Using AutoCAD API's Document.SendStringToExecute method correctly

I'm trying to mark my drawing before I programmatically insert a block so that I can programmatically undo the action if it only partially completes because of an error. Right now that insert method looks like this public void…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
2 answers

How to get AutoCAD file (.dwg) to view zoom pan and get entity on web application

I try to get show AutoCAD file (.dwg) to display file And I need to view, pan, zoom and click to view entity So now I use CadLib 4.0 in Win Application can be use, but in Web Application it will can not be to do right that. please hint to find this…
2
votes
2 answers

How to stretch a block programmatically in AutoCAD with C#.NET

I'm trying to write a method that takes a block in a drawing via it's block reference and stretches it out. So far my method looks like this: public static void stretchBlockWithId(ObjectId passedIdOfObjectToUpdate, Distance newXScale, Distance…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
5 answers

How do I check if Point3d is not null?

My approach was... Autodesk.AutoCAD.Geometry.Point3d point = null; but I can't seem to set a Point3d to null. Can anyone tell me why and how I would check whether a Point3d is null? (By Point3D I mean Autodesk.AutoCAD.Geometry.Point3d)
user2479356
2
votes
3 answers

How to update dll/plug-in without restarting AutoCAD?

I have a class library dll that loads AutoCAD scripts from a network folder. However I need a way to ensure the class library can be updated silently. With Windows Form applications I would just use a ClickOnce Deployment and then use…
Bill Peet
  • 477
  • 1
  • 8
  • 23
2
votes
1 answer

Setting up Visual Studio 2013 to Develop AutoCAD 2015 plugins

I'm trying to continue working on my plugins for AutoCAD in Visual Studio 2013. I opened up my project files and all the references to Autodesk libraries were missing. To remedy this, I added references to the following dll files from ObjectARX 2015…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
2
votes
2 answers

Casting a parent class to a child class in C#

I'm writing a plug-in for AutoCAD 2014 using C# and the .NET Framework. I extended Autodesk's Table class like so: public class OpeningDataTable : Autodesk.AutoCAD.DatabaseServices.Table The idea is that I want to pull a table already drawn on an…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90