pasxos867044
2012-02-10, 02:44 PM
hello,i am new in programming and in my first successful attempt i developed a windows form based stand alone application in Vb.net 2010 that calculates all the geometry data needed for a Spur Gear ,my final goal is to draw automatically the calculated Spur Gear in Autocad 2012 with the simple click of the "open Autocad" button in form2.
http://forums.autodesk.com/t5/image/serverpage/image-id/20597iC9AF585609914E36/image-size/original?v=mpbl-1&px=-1
http://forums.autodesk.com/t5/image/serverpage/image-id/20599iF38F22CB7AB41164/image-size/original?v=mpbl-1&px=-1
http://forums.autodesk.com/t5/image/serverpage/image-id/20601i2D5B9CC89E8D010E/image-size/original?v=mpbl-1&px=-1
At first i started to experiment my self with a simple only task (created a new project
only for this) to draw 4 circles with the same center (radius1,2,3,4) in autocad with a simple click of the command button.
The code i used is the following (for 1circle) but it returned a error like this>> SendACommandToAutoCAD()-->>Could not load file or assembly 'Acmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendACommandToAutoCAD()
End Sub
<CommandMethod("SendACommandToAutoCAD")> _
Public Sub SendACommandToAutoCAD()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
'' Draws a circle and zooms to the extents or
'' limits of the drawing
acDoc.SendStringToExecute("._circle 2,2,0 4 ", True, False, False)
acDoc.SendStringToExecute("._zoom _all ", True, False, False)
End Sub
End Class
http://forums.autodesk.com/t5/image/serverpage/image-id/20597iC9AF585609914E36/image-size/original?v=mpbl-1&px=-1
http://forums.autodesk.com/t5/image/serverpage/image-id/20599iF38F22CB7AB41164/image-size/original?v=mpbl-1&px=-1
http://forums.autodesk.com/t5/image/serverpage/image-id/20601i2D5B9CC89E8D010E/image-size/original?v=mpbl-1&px=-1
At first i started to experiment my self with a simple only task (created a new project
only for this) to draw 4 circles with the same center (radius1,2,3,4) in autocad with a simple click of the command button.
The code i used is the following (for 1circle) but it returned a error like this>> SendACommandToAutoCAD()-->>Could not load file or assembly 'Acmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendACommandToAutoCAD()
End Sub
<CommandMethod("SendACommandToAutoCAD")> _
Public Sub SendACommandToAutoCAD()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
'' Draws a circle and zooms to the extents or
'' limits of the drawing
acDoc.SendStringToExecute("._circle 2,2,0 4 ", True, False, False)
acDoc.SendStringToExecute("._zoom _all ", True, False, False)
End Sub
End Class