Click here to Skip to main content
15,892,927 members
Everything / AutoCAD

AutoCAD

AutoCAD

Great Reads

by Vahe Karamian
Programming in itself is no small task. Graphics programming complicate things a tab-bit more!
by Kurt Swaim
An introduction on how to create AutoCAD plug-in, followed by an in depth discussion on how to update title blocks on AutoCAD drawings
by Member 10522374
This library was created to parse the AutoCad Dxf format.
by Vitaliy Sytnik
On the Internet you can find a lot of different information about creating drawings in SVG format. Often an editor is used to open an DXF and export as SVG. Looking through the SVG code it is immediately obvious that there is a lot of excess. An SVG file created in one editor may not always be corre

Latest Articles

by Member 10522374
This library was created to parse the AutoCad Dxf format.
by Kurt Swaim
An introduction on how to create AutoCAD plug-in, followed by an in depth discussion on how to update title blocks on AutoCAD drawings
by Vahe Karamian
Programming in itself is no small task. Graphics programming complicate things a tab-bit more!
by VR Karthikeyan
Automating the drawing process in AutoCAD using programming to improve the productivity of the design engineers.

All Articles

Sort by Score

AutoCAD 

6 Dec 2019 by Vahe Karamian
Programming in itself is no small task. Graphics programming complicate things a tab-bit more!
10 Dec 2011 by Mehdi Gholam
If filepath is a variable then you should remove the quotes around it:if(File.Exists(filePath)){ acApp.Documents.Open(filePath);}If not then try mapping the share folder to a drive name instead of using the \\computername\sharefolder syntax.
10 Apr 2011 by Espen Harlinn
You may try using GetRunningObjectTable[^] to get IRunningObjectTable[^] and see if you are able to get access to the running instance of AutoCad. .Net version of IRunningObjectTable[^]It might be worth a try :)RegardsEspen Harlinn
18 Oct 2013 by codestar007
Look at this:AutoCad .Net Developers Guide[^]This introduction describes the concepts of exposing AutoCAD® objects through a managed .NET application programming interface (API).and even this alsohttp://adndevblog.typepad.com/autocad/wpf/[^]
10 Feb 2015 by Danilo Corallo
Hi there, I wrote something in WPF a few months ago...You can find it here: WpfDxfViewer.
30 Jun 2010 by Shiva S.S
Hi everyone,I am develpoing a small vb.net forms application. From that trying to load the Autocad using the following code.Dim mycadAp As AcadApplicationmycadAp = CreateObjec(AutoCAD.Application)mycadAp.Visible = TRUEWhen creating the application for first time, it works fine. Loads...
17 Aug 2010 by Christian Graus
If you don't know anything about C#, why have you spent a couple of days on this, and why do you have this task at all ? C# has NO Autocad support, you'd be best to ask this in an Autocad forum, or just plain reading the documentation.That you 'don't know a lot about C#' and that you are...
10 Apr 2011 by Nish Nishant
It seems to me that the first attempt locks the file, so the 2nd attempt cannot open it normally (and thus defaults to readonly mode). You are doing something wrong here. Have you gone through their documentation...
14 Jun 2011 by Roger Wright
I suggest that you begin with some study time on the AutoCAD .Net Developers Guide[^] website. Although I use AutoCAD a lot at work, I haven't explored the site thoroughly, but from perusing it tonight I see that there is a bunch of good information there if I ever need it.
6 Aug 2011 by Richard MacCutchan
The web site is automatically forwarding your browser to the second link; there is nothing you can do about this.
30 Nov 2011 by Manoj K Bhoir
Try the following link :A Vector Type for C#Or Check following Code :VB.Net Code :Public Shared Function ON_3dVectorAngle(ByVal v0 As On3dVector, ByVal v1 As On3dVector) _ As Double ' Unitize the input vectors v0.Unitize() v1.Unitize() Dim dot As Double =...
10 Dec 2011 by RaviRanjanKr
Found Similar question there-[Printing AutoCad DWF and DWG files][^] where an answer suggested by an OP is to used those with VS2k5 was to use the installer that installs a wizard in VS that sets everything up for you right away. It is the ObjectARX SDK, found here: ObjectARX[^] and other...
3 Aug 2012 by Sandeep Mewara
Based on what I read on internet, it might be related to code implementation. Have a look at this discussion: Saving and Closing a Drawing[^]Try something like:doc.Database.SaveAs(srcFile, DwgVersion.Current)//then close itdoc.CloseAndDiscard();
4 Jul 2013 by Ron Beyer
You can do VRML, although its really not supported well.I would use something like Unity3D[^] to do this. Then the user just has to install a plug-in and they can run your app. You can also publish on multiple platforms (iOS, Android) without much additional work. Scripting is done in C# and...
7 Mar 2014 by leon de boer
Okay we need to check which Autocadd library you are usingDxfAttributeDefinition is used by WoutWare CadLib librariesDxfAttribute is also included in WoutWare CadLib libraries So I am going to guess it is that one.When you ask these sorts of questions it is important you tell...
5 Apr 2014 by CHill60
Try this blog[^] - if you have "admin" rights then that should get you all of the vaultsThe AutoDesk developer network[^] might be able to give more assistanceI found these using the google query Quote:query names vaults Autodesk Vault Professional - there are other links from that
20 Sep 2016 by OriginalGriff
"Not running properly" is one of the error reports we get that is completely useless - it tells us nothing, except that you have a problem (which we knew anyway because otherwise you wouldn't be asking a question).So in future, tell us what it does that you didn't expect, or doesn't do that...
1 Feb 2020 by Kurt Swaim
An introduction on how to create AutoCAD plug-in, followed by an in depth discussion on how to update title blocks on AutoCAD drawings
2 Jul 2010 by koolprasad2003
have you tried with register this dll in GAC.... :)
10 Apr 2011 by Stuart Nathan
I think the answer is that it takes a little time for the object to be made after the CreateObject statement.So I created a timer and started it immediately after this statement.In the timer event I use GetObject to return the Autocad object and it seems to work.But whatever I do, the...
15 May 2018 by AhmedOsamaMoh
Dear sir now i am search the net a lot and a lot , I tried many things but no waynow i have autocad 2007 + .net frame work 2 + vs2005 + C#what should i do to solve such problem??
5 Aug 2011 by beratxt
Hi GuysI have a trouble with this website https://ebeyanname.gib.gov.tr/giris.html . After I navigate this link in webBrowser Control , Website is directed to automatically https://ebeyanname.gib.gov.tr/index.html . So , I have trouble to show in webBrowser this link .How can i solve this...
23 Aug 2011 by walterhevedeich
If you got this code from one of the articles here in CP, you may want to post it its forum section. The author is always the best person to ask about his code.
29 Aug 2011 by reddy.krishna09
i just wanna know that what are the technologies languages etc. should be learned by me so as to develop the software application like AutoCad may not be the whole thing on my own either taking some ones help or building only some parts of it which is used to design a house and its interiors
29 Nov 2011 by Member 8420085
hi,for my project i need two SELECTABLE line at first & then the angel of them in vb.netpleaseee help me,can i import autocad or coreldraw toolbox controls to my project form?thats the famous angular dimension in them
10 Dec 2011 by OriginalGriff
You have basically three options:1) Write your own .DWG file parser and print from that - lots of work.2) Use a third party control - as SA said, lots of problems.3) Use the application which knows the files best: Autocad.If you can't do (3), then you have a lot of work ahead of you!
11 Dec 2011 by M_Mogharrabi
I'm trying to open an autocad file on a shared folder but it fails with comexception saying file was not found, but file exists. Here's the code: ("filePath" is the path to the file and acApp is a reference to Autocad object.)if(File.Exists(filePath)){ ...
2 Jan 2012 by M_Mogharrabi
Hi all,I've found a code to open a dwg file in autocad with objectARX commands.this code works successfully when i wrote it in a Class Library project, but the problem is happened when i want to place this code in my windows application.It gives me this error message : The type...
8 Jan 2012 by yongbam
my program is screen capture program of autocad and i have a problembecause i cannot disapper autocad's cursorautocad's cursor is block to see dots located by cursor positioncould anybody help me ???????my program's action is not in autocad it's only capture screen of windows include...
8 Jan 2012 by «_Superman_»
Screen capture does not normally capture the mouse cursor.Do you mean mouse cursor or the blinking caret?If it is the mouse cursor, you could try ShowCursor(FALSE); to hide it.If it is the blinking caret, you could try HideCaret.
23 Feb 2012 by vuongocanh
I want to create project with Autocad Arx Object.I need a simple example to begin writing.Please help me!
4 Mar 2012 by thatraja
Here tutorial for youObjectARX & Dummies[^]
3 Apr 2012 by ramesh4128
Hi, can you please explain the what are the types of meshes in grids Thanks
20 Jan 2013 by Mahesh Singh27
Dear All,I have a AutoCAD 2006 Drawing File, opened in AutoCAD.And i want to open the same file again as read only, in the same session of AutoCAD.Is it possible or not? If yes then how?Please guide me.Thanks
21 Mar 2013 by tanghuawei
How to draw a rectangle in the AutoCAD through the C# program, and clip the rectangular area
10 May 2013 by Balkrishna Patel
Hi Stephan,if you want to find particular form is already opened or active. i thing the following may help you.List CurrentActiveForms = System.Windows.Forms.Application.OpenForms.OfType().ToList();if(CurrentActiveForms.Count == 0){ // No match form found...
28 May 2013 by Matt Riemenschneider
Not new to programming, but am new to VStudio and SQL Server. I'm taking the step from Access DB's to SQL Server. I'm looking for a strategy to develop my SQLServer DB (tables etc) while also working on developing my application that will be distributed to access it in visual studio and would...
28 May 2013 by Corporal Agarn
1) Do not use Microsoft's convert from Access to SQL, or at least make sure what is happening. We have zip codes that are float because the person who did the conversion did not know what they were doing. They are no longer here.2) Think about a three tier implementation. At lest one...
4 Jul 2013 by Mesa1993
Hello everyone I want to create a scene using 3ds max, add some c++ or c# controllers to be able to walk through the scene (using arrows for examples) and make it accessable via the internet ?is that even possible???in other words, I want to create a 3d book store and puplish it on the...
9 Aug 2013 by Madhu from Bangalore
we have a requirement in my project Autocad 2008, I am creating table in autocad using lines, after creating table i want get serial number(1,2,3..) automatically when i click on particular boxes in a table. Eaxample : when i click on a box first time it will display as 1 number, and...
18 Oct 2013 by Mahesh Alappuzha
Hai,I want to know is it possible to load an AutoCAD file in WPF applications? Any suggestions regarding this?
11 Dec 2013 by Shah Sneha
Bricscad remove hatch and give borderI have download software for converting pdf to dwg but it gives hatch issues in dwg file so please help me to remove hatch layer and if i have remove hatch then border is not displaying
28 Feb 2014 by Richard MacCutchan
See http://sourceforge.net/projects/itextsharp/[^] for creating PDF files.
1 Apr 2014 by Ankit Chaturvedi
I have just started learning the Vault API. I have just managed to get a login window running. Now I want to get the names of all the vaults from the login dropdown. Is it possible? and if it is can someone tell me what to search on google for this?
7 Aug 2014 by Member 10905252
I am trying to develop an application for autocad.i am using the following namespaces :using System;using System.IO;using System.Text;using System.Collections;using System.Windows.Forms;using System.Collections.Generic;using System.Runtime.InteropServices;using...
9 Sep 2014 by Cá Cơm
Hi!Can some one fix this problem? plz!---I have a class that descripted as the followings:/// /// A class that contains all CommandMethod/// public class Commands{ // This class have NO constructor [CommandMethod("CommandName", "commandGroup",...
1 Oct 2014 by MukeshSagar
Check the following...
7 Dec 2014 by widy angjaya
Is There Any Jquery Plugin for Autocad viewer? Especially dwg file format.
7 Dec 2014 by Kornfeld Eliyahu Peter
The problem is that DWG is a proprietary format so software that can handle it is not free for most...(you can use Google to easily find them).There are some plugins that can enable viewing DWG files (I know some for Chrome) but those force the client to install them...If this site is just...
15 Feb 2015 by Riyaz Mohammad
Hi everybody, can any one guide to do the simple windows application which open autocad 3d file and display like 'autodesk dwg trueview' application.In that i want to generate pan,zoom,full extent and 3d orbit view tools.Thanks Advance
16 Feb 2015 by johannesnestler
simple? hmm...Your question is quite general and here is not the right place to ask for it (Richard MacCutchan mentioned it).But some common basic steps involve. * Inform and understand the dwg-format (or the Format you will base your Viewer on). a great format If I remember right :-(*...
1 Mar 2015 by Nikolai.Kimi
Dear All,Good day to all.Appreciate if someone could assist me on this error code. The error is Method 'OwnerID' of object 'IAcadBlock' failed.Been trying google this error but nothing prevail.When I debug it, the error point to this line.Appreciate help on this matter' Create...
18 Mar 2015 by Member 9977262
I am trying to decal sketch on mesh using exponential map. While generating exponential map, I am calculating plane by initial point on mesh and normal calculated on mesh by that point. then algorithm calculates nearest vertices from that point and traverse to them by edges.Then Edges are...
27 Apr 2015 by Member 11646792
Hi, I'm editing a image, loading it in a pictureBox. When i've done the changes i want to save the image as a .dwg file, but when i want to open the file AUTOCAD doesnt recognise so i'm not able to open the file on AUTOCAD. Is there any way which i can obtain a correct .dwg file, from a...
27 Apr 2015 by Dave Kreskowiak
Unless you have a library that knows how to write a DWG file, you're going to have to write one. The built in stuff in .NET doesn't know anything at all about how to write a DWG file.
4 Aug 2015 by Mathew Soji
Please refer the below links for some reference .AutoCAD Drawing Using C#[^]http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-4875.htm[^]http://www.a1vbcode.com/snippet-4257.asp[^]
2 Oct 2015 by farghabil
I want View AutoCAD DWG File in c# (Free)I'm Search on the Internet Some Day But not Found Any Thing Usable.
12 Jan 2016 by VR Karthikeyan
Hi, refer the following code,AcadApplication Acad = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");string ActiveDocumentName = Acad.ActiveDocument.Name; // gets name of active documentstring ActiveDocumentPath = Acad.ActiveDocument.FullName; // gets name with path of...
7 Jun 2016 by Member 8223929
I am trying to write a command that will extract the Bill of materials data out of an Autocad Mechanical drawing. It can be done in Autocad Mechanica , but I'd like to automate it.[Link on how to do it in Autocad]The code extract below finds the Parts List object (a table of the bill of...
7 Jul 2016 by CPallini
Both are good (the choice heavily depends on the skills of the developer) and you might also mix them. Code development process could be a bit faster using C#, but, again, it depends on your skills and experience with such programming languages.
7 Jul 2016 by F-ES Sitecore
C++ would be faster, however the fact that you had to even ask this question makes me think the task is probably beyond your capabilities.
7 Jul 2016 by CPallini
This page suggests a positive answer: Appropriate Uses For SQLite[^].
7 Jul 2016 by Richard MacCutchan
You already posted this question at What is the best option for rendering and why (opengl, eyeshot, etc)[^]. Please do not repost.
7 Jul 2016 by Patrice T
The fact that you have to ask which language to use is an indication of your lack of skills and experience to conduct such a project.You can expect that actual AutoCad took more than 100 human year to get where it is today. Even limiting your self to 2D, a far cry from actual product, it is...
14 Jul 2016 by @j@y123
[CommandMethod("FindAllHatches...
20 Jul 2016 by @j@y123
[CommandMethod("ha")] public static void FindAllHatches() { float x = 25, y = 15, z; Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; Document acDoc = Application.DocumentManager.MdiActiveDocument; var db =...
20 Jul 2016 by lukeer
The MousePosition property of your Form, Panel, whatever you're drawing your stuff on will tell you where the mouse pointer is.Bear in mind that you get screen co-ordinates, even though you're calling a control's method. To print something, you will typically need control co-ordinates....
26 Jul 2016 by @j@y123
[CommandMethod("NLTAG")] public void ListAttributes() { Document acDoc = Application.DocumentManager.MdiActiveDocument; Editor ed=Application.DocumentManager.MdiActiveDocument.Editor; Database db =...
27 Jul 2016 by @j@y123
using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.EditorInput;using Autodesk.AutoCAD.Geometry;using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.Windows.ToolPalette;using System;using System.Collections.Generic;using...
10 Aug 2016 by NathanRO
1. You need to target the appropriate ObjectARX development SDK from Autodesk for 2015, not 2011, and recomplie. You can obtain it via the following link:http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=773204[^]IAW Autodesk FAQ:"6. Do I have to rebuild my older AutoCAD...
10 Aug 2016 by @j@y123
Hello, I am creating one command in which mtext will be printed,but the problem is that i want to print the text in different format and the system is set on different format.I want to programatically change the text style when command is running.What I have tried:Print mtext in user...
14 Sep 2016 by @j@y123
using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.EditorInput;using Autodesk.AutoCAD.Geometry;using Autodesk.AutoCAD.Runtime;using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace...
19 Sep 2016 by @j@y123
using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.Colors;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.EditorInput;using Autodesk.AutoCAD.Geometry;using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.Windows;namespace NAL_Layer11{ public...
20 Sep 2016 by @j@y123
using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.EditorInput;using Autodesk.AutoCAD.Geometry;using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.Windows.Data;using System;using System.Text; public class DataStuff{ ...
27 Mar 2017 by .Net Jim
How to access the Windows Registry using C# | InfoWorld[^]
18 May 2017 by Zunayed Shahriar
using System.IO; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Runtime; [CommandMethod("OpenDrawing", CommandFlags.Session)] public static void OpenDrawing() { string strFileName = "C:\\campus.dwg"; DocumentCollection...
21 Feb 2018 by Mohamed Ahmed
I'm trying to extract AutoCAD attribute block to excel Excel Output[^] My question is how to count duplicated items in array and add them to new column What I have tried: List rooms = new List(); using (var tr = db.TransactionManager.StartTransaction()) ...
21 Feb 2018 by Maciej Los
Instead of List i'd use a Dictionary[^]. Dictionary myCounter = new Dictionary(); using (var tr = db.TransactionManager.StartTransaction()) { foreach (SelectedObject so in psr.Value) { BlockReference bref =...
4 Mar 2018 by Member 13671958
Hi I have used acad electrial and want to get return value after input command in cad command window. Example is below, 1) Input code is Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; string command =...
4 Mar 2018 by Maciej Los
Check this: Getting name of autocad drawing. - Autodesk Community[^]
19 Jun 2018 by Member 13878758
Hello, I'm 26 year old construction engineer, right after school. I use multiple modelling programs like tekla, autocad etc. etc. I used to learn some basic C++ or C# in the past for half a year in school but I don't really have any significant knowledge on this subject. I thought to myself,...
19 Jun 2018 by Gerry Schmitz
What kind API (Application Interface) does Autocad use that you will be "programming for"? What kind of samples have you found related to what you want to do? Have you "studied" these samples to determine what knowledge set they require? You need a learning plan related to "your" "5 year...
10 Sep 2021 by Spencer Elliott 2021
I don't know much about CAD files or the Autocad prorietary file format of DWG. I would like to understand how I can work with this format. Ideally, I want to be able to take a dwg file, search for a particular named object and then render a...
28 Sep 2021 by Richard MacCutchan
You are in the wrong place. See https://www.codeproject.com/KB/FAQs/QuickAnswersFAQ.aspx[^].
3 Dec 2022 by Graeme_Grant
My guess would be with this: Download Autodesk Viewers | Free Online Viewers | Autodesk Official[^]
4 Dec 2022 by Dave Kreskowiak
You would have to use a library that understands how to manipulate AutoCAD files and does NOT depend on AutoCAD being installed. Google for ".net dwg library[^]"
28 Jan 2024 by Member 10522374
This library was created to parse the AutoCad Dxf format.
29 Aug 2011 by TheyCallMeMrJames
Here's some advice: start smaller. Those aren't harsh words. There's just way too much going on to set that as a target and you'll be repeatedly discouraged. AutoCAD has more people working on their web site than you can imagine, much less a suite of products that literally has 1000's of man...
4 Nov 2013 by Vitaliy Sytnik
On the Internet you can find a lot of different information about creating drawings in SVG format. Often an editor is used to open an DXF and export as SVG. Looking through the SVG code it is immediately obvious that there is a lot of excess. An SVG file created in one editor may not always be corre
2 Jan 2015 by Zoltán Zörgő
Algorithm? DXF is a text format. Read the file and do with it what you want. I don't know what you intend to do with a deawing in PHP, but you haven't tried to share this with us. So consult the reference: http://images.autodesk.com/adsk/files/acad_dxf0.pdf[^]
21 Jun 2016 by Kornfeld Eliyahu Peter
As you have 3 components we are talking about vectors in the 3D space (Why?)...To calculate the angle you have to know two things:1. Dot product of two vectors... $\vec{a} \cdot \vec{b}$Which is $(a_{x} + a_{y} + a_{z}) \times (b_{x} + b_{y} + b_{z})$2. The magnitude of the...
2 Jul 2010 by E.F. Nijboer
Maybe this server component can only be started once? You could try to use GetObject instead of CreateObject after first call. You could simply make a function for this checking if the CreateObject was already called and return the object using CreateObject or GetObject accordingly.A...
10 Apr 2011 by Stuart Nathan
I am trying to load AutoCad from my programe. The code is: Private Sub LoadAcad(ByVal fn As String) Dim acadApp As AcadApplication Dim acadDoc As AcadDocument Dim ProgId As String = "AutoCAD.Application" Try acadApp = GetObject(, ProgId) With...
3 Aug 2012 by Gangawane
Hello, I want to create a new autocad file using existing autocad file. Only some changes in a file and then SaveAs the file with new name. Some times it gives the System.Runtime.InteropServices.COMException (0x80210063): Error saving the document Exception. e.g. If i have to...
20 Jun 2016 by MaikelO1
I have a question about how the calculate angles between coordinates / lines. I have four labels filled with XY coordinates comma delimited. Which C# code should I use to get the desired value in Label_Angle_ResultPreferred routeFixed Point A . Label_FP_A . X,YFixed Point B...
9 Jan 2015 by Member 11364013
hi,i suspect that you are opening the file as read only.example: Document NewDoc = acDocMgr.Open(PathAndDrawing, false);//true=open as read onlytry using "false".karl
29 Feb 2016 by VR Karthikeyan
Automating the drawing process in AutoCAD using programming to improve the productivity of the design engineers.
11 Jan 2013 by StephanGumpert
Hi Guys,I have a DLL loaded into a 3rd Party application (AutoCAD). Once loaded i can trigger commands to load winforms to do things with in AutoCAD.One of my commands loads a dialog.How I Test if that Dialog is already running and not load the Winform again and just make it active...
2 Jan 2015 by Persisoft
HiI wonder how to read dxf files with php.did you have any clear algorithm ?