<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: C# and autocad in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4328012#M48763</link>
    <description>&lt;P&gt;Thanks to everbody to your help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I applied wrong method to create line via exe file,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&lt;A target="_self" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;_gile&lt;/A&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thank you for your basic project it is important example for me, I think it is solve my problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2013 12:14:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-12T12:14:07Z</dc:date>
    <item>
      <title>C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4326516#M48753</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to ask a questions about csharp and autocad interaction. Could I manage the autocad using by csharp codes, I mean, I should create a program with C#, and when I press a button, I should draw a line in autocad. is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a page about this subject&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://usa.autodesk.com/adsk/servlet/index?siteID=123112&amp;amp;id=1911627"&gt;http://usa.autodesk.com/adsk/servlet/index?siteID=123112&amp;amp;id=1911627&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the above webpage, is proper documentation?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 06:25:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4326516#M48753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-11T06:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327042#M48754</link>
      <description>you can go through the AutoCAD .net developers guide where you will get details as well as example with code. Below is the link:&lt;BR /&gt;&lt;BR /&gt;&lt;A target="_blank" href="http://exchange.autodesk.com/autocad/enu/online-help/browse#WS73099cc142f48755a52158612bd434e551-7fd5.htm"&gt;http://exchange.autodesk.com/autocad/enu/online-help/browse#WS73099cc142f48755a52158612bd434e551-7fd5.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Zakir</description>
      <pubDate>Thu, 11 Jul 2013 14:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327042#M48754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-11T14:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327053#M48755</link>
      <description>&lt;P&gt;Below is&amp;nbsp;the code to create a line. Here you will get line with this command. If you want to draw the line from a button , just call that sub from button event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" align="center" src="https://forums.autodesk.com/t5/image/serverpage/image-id/55968iD9433F23282B1B3D/image-size/original?v=mpbl-1&amp;amp;px=-1" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2013 14:29:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327053#M48755</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-11T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327849#M48756</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;&lt;A target="_self" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1129934"&gt;mzakiralam,&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your response,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But when I try code that you advice, It didnt run, it gave a failure as below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Could not load file or assembly 'accoremgd,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you send a simple and basic project about this subject,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full test code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.ComponentModel;&lt;BR /&gt;using System.Data;&lt;BR /&gt;using System.Drawing;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Windows.Forms;&lt;BR /&gt;using System.IO;&lt;BR /&gt;using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;using Autodesk.AutoCAD.Windows;&lt;BR /&gt;using Autodesk.AutoCAD.EditorInput;&lt;/P&gt;&lt;P&gt;namespace WindowsFormsApplication1&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;public partial class Form1 : Form&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;public Form1()&lt;BR /&gt;{&lt;BR /&gt;InitializeComponent();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private void Form1_Load(object sender, EventArgs e)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[CommandMethod("AddLine")]&lt;BR /&gt;public static void AddLine()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;Database acCurDb = acDoc.Database;&lt;BR /&gt;using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())&lt;BR /&gt;{&lt;BR /&gt;//open block table for read&lt;BR /&gt;BlockTable acBlkTbl;&lt;BR /&gt;acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;&lt;/P&gt;&lt;P&gt;// opren the block table record model space for write&lt;BR /&gt;BlockTableRecord acBlkTblRec;&lt;BR /&gt;acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// create line that starts at 5,5 ends at 12,3&lt;BR /&gt;Line acLine = new Line(new Point3d(5, 5, 0), new Point3d(12, 3, 0));&lt;/P&gt;&lt;P&gt;// add the new object to the block table record and the transaction&lt;/P&gt;&lt;P&gt;acBlkTblRec.AppendEntity(acLine);&lt;BR /&gt;acTrans.AddNewlyCreatedDBObject(acLine, true);&lt;/P&gt;&lt;P&gt;//save the new object to the database&lt;BR /&gt;acTrans.Commit();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private void button1_Click(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;AddLine();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 07:33:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327849#M48756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-12T07:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327866#M48757</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to add the references to the AutoCAD .NET API libraries to your project (see &lt;A target="_blank" href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/files/WS73099cc142f48755-35a0330e12075abe904-7442.htm#WS73099cc142f48755-35a0330e12075abe904-7441"&gt;here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;These DLLs are mosty: AcDbMgd.dll and AcMgd.dll plus, if you're targeting A2013 or 2014, AcCoreMgd.dll.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 07:53:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327866#M48757</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T07:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327899#M48758</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I added all required .DLL&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 09:08:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327899#M48758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-12T09:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327923#M48759</link>
      <description>&lt;P&gt;The code posted by mzakiralam defines an AutoCAD command. It have to be compiled as class library (dll) and loaded into AutoCAD with the NETLOAD command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The AutoCAD .NET API is designed to run in-process only, if you want to make an out-of-process stand-alone application (exe), you'll have to get or create an instance of AutoCAD and use the AutoCAD ActiveX Automation (COM) libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should have a look &lt;A target="_blank" href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/files/WS73099cc142f48755-5c83e7b1120018de8c0-2202.htm"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 10:01:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327923#M48759</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T10:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327953#M48760</link>
      <description>&lt;P&gt;I canl send you complete example project&amp;nbsp;in VB if you still required. In the mean time you should have look on basics of AutoCAD.NET API (use below link please for that). How to create a project and how to load that assembly into AutoCAD. Please remember that as _gile mentioned in his previous message of this thread that you have to add proper reference to build DLL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://exchange.autodesk.com/autocad/enu/online-help/browse#WS73099cc142f48755f2fc9df120970276f7-5354.htm"&gt;http://exchange.autodesk.com/autocad/enu/online-help/browse#WS73099cc142f48755f2fc9df120970276f7-5354.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 11:05:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4327953#M48760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-12T11:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4328002#M48762</link>
      <description>&lt;P&gt;I attached a little VS2010 solution which contains 3 projects to show you different ways to make a stand-alone application to interact with AutoCAD. All uses the AutoCAD COM API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- InteropSample uses references to Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common which are version and plateform dependant, so you may have to change them.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- DynamicSample uses the dynamic type to avoid having AutoCAD.Interop references. It requires the .NET Framework 4.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- LateBindingSample uses late binding and reflectionto avoid having AutoCAD.Interop references. It contains some extension methods to make the code more readable.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 11:55:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4328002#M48762</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2013-07-12T11:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: C# and autocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4328012#M48763</link>
      <description>&lt;P&gt;Thanks to everbody to your help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I applied wrong method to create line via exe file,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&lt;A target="_self" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;_gile&lt;/A&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thank you for your basic project it is important example for me, I think it is solve my problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 12:14:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/c-and-autocad/m-p/4328012#M48763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-12T12:14:07Z</dc:date>
    </item>
  </channel>
</rss>

