autocad

Clean Code: Readable Dependency Injection suggestions?

I have a project that adds elements to an AutoCad drawing. I noticed that I was starting to write the same ten lines of code in multiple methods (only showing two for simplicity). Initial Implementation: You will notice that the only thing that really changes is adding a Line instead of a Circle. [CommandMethod("Test", CommandFlags....

AutoCad XData vanishing issue...

I have a C# application that interfaces with AutoCad. It's job is to rip through all of the entities on a model and find the ones that apply to what we're doing by looking for the presence of specific XData tags. The problem is when the drafters move a block to any layer that is marked as "invisible" (i.e. turn layer off) then the xdata...

Programmatically refresh layer usage information

In AutoCAD, through the Layer Properties Manager UI, a user can refresh the usage information for layers in a drawing. The information sometimes get stale when you have layers from xrefs. In your code, when you access the LayerTable for a drawing, its records will not include those layers that it deems as unused (in the Layer Propertie...

Debugging in VS 2010 when the host external program runs in XP compatibility mode

When debugging AutoCAD add-ons you set Visual Studio 2010 to start the AutoCAD exe first. If the AutoCAD .exe properties are set to run in compatibility mode for Windows XP (NOT the Virtual PC XP mode) will it mess things up? ie. is Visual Studio 2010 ok with this? The reason I'm leaning towards running older versions in compatibility m...

Get the extents on a drawing using the database without opening the drawing

In the AutoCAD .NET API, while you have a drawing open, you can get the extents using the environment variables EXTMAX and EXTMIN. However, these variables don't supply correct values when you do NOT have the drawing open. How do you get these same extents without opening the drawing (AKA using the Database)? ...

whats an easy-2-use future webprogramming language icm with AutoCAD?

i'm a surveyor/AutoCAD drawer and wanna increase my workfield into future webprogramming/development with the experience i have from civil engineering. what type of language is common to use with scripts in AutoCAD? ...

Exception "Error Decrpyting Data"when opening drawing

I have a program that does batch processing on some drawings. One of the drawings throws an exception "Error Decrypting Data" when I try to open it. This drawing in particular was generated by a third-party tool other than AutoCAD. In addition, this problem only occurs in AutoCAD 2011. In AutoCAD 2010 it prompts the user that the fil...

How to export autocad file to png using java?

Hi, how can I export an AutoCAD file to PNG format in Java? regards, Wim ...

How I determine if an xref is clipped and also how do I get it's clipping boundaries

In the AutoCAD .NET API you can access xrefs through BlockReference entities in the BlockTableRecord. You know that they are an xref if their parent block table record has the IsFromExternalReference or IsFromOverlayReference property set to true. How do you determine if the xref is clipped? How do you determine what that clipping bou...

Getting Entity data from Autocad

This is a two part question. 1) Is there any way to get a csv file of all the entity data, including xdata, for an autocad dwg, either using autocad or some other method? 2) Is there an easy way to parse a autocad dxf file to get the entity data into a csv file? ...

How to select an Autocad entity by entity name for use in autocad command in a lisp

This might be something simple that I just keep missing but... I can get the entity name but is there anyway to use an entity name assigned to a varible to have an Autocad command use the entity as the selected object to act on? ...