我们公司的AUTOCAD是华中理工做二次开发的,其基本的功能归根结底也就是使繁杂的操作变成简单的步骤,还有实现中国的标准件库。或许你可以从华中理工那里找一找。

解决方案 »

  1.   

    我做过相关的gis开发。
    书在市面上很多
    网站少见
      

  2.   

      我也正在进行这方面的工作,你可以在你的VB引用中先把AutoCAD200类型库引用进出,然后用对象浏览器,查看CAD开发帮助文件关于VB引用的说明。下面这段文字是关于如何在VB中添加CAD对象并绘制一条曲线的。其它以此类推。
          To update the coding examples for use with VB, you must first reference the AutoCAD type library. To do this in VB, select the References option from the Project menu to launch the Reference dialog box. From the References dialog box, choose AutoCAD Release 15 Type Library and press OK.
    Next, in the code example replace all references to ThisDrawing with a user-specified variable referencing the active document. To do this, define a variable for the AutoCAD application (acadApp) and for the current document
     (acadDoc). Then, set the application variable to the current AutoCAD application.If AutoCAD is running, the GetObject method retrieves the AutoCAD Application object. If AutoCAD is not running, an error occurs that (in this example) is trapped, then cleared. The CreateObject method then attempts to create an AutoCAD Application object. If it succeeds, AutoCAD is started; if it fails, a message box displays a description of the error. The following code example uses the Clear and Description properties of Err. If your coding environment does not support these properties, you will need to modify the example appropriately:Connecting to AutoCAD from Visual BasicSub Ch2_ConnectToAcad()
        Dim acadApp As AcadApplication
        On Error Resume Next
        
        Set acadApp = GetObject(, "AutoCAD.Application")
        If Err Then
            Err.Clear
            Set acadApp = CreateObject("AutoCAD.Application")
            If Err Then
                MsgBox Err.Description
                Exit Sub
            End If
        End If
        MsgBox "Now running " + acadApp.Name + _
               " version " + acadApp.VersionEnd SubNext, set the document variable to the Document object in the AutoCAD application. The Document object is returned by the ActiveDocument property of the Application object. Dim acadDoc as AcadDocumentSet acadDoc = acadApp.ActiveDocumentFrom this point on, use the acadDoc variable to reference the current AutoCAD drawing.
    NOTE When running multiple sessions of AutoCAD, the GetObject function will return the first instance of AutoCAD in the Windows Running Object Table. See the Microsoft Visual Basic documentation on the Running Object Table (ROT) and the GetObject function for more information on verifying the session returned by GetObject.VBA versus VB Comparison Code ExampleThe following code example demonstrates creating a line in both VBA and VB:Creating a line using VBASub Ch2_AddLineVBA()
        ' This example adds a line
        ' in model space
        Dim lineObj As AcadLine
        Dim startPoint(0 To 2) As Double
        Dim endPoint(0 To 2) As Double
        
        ' Define the start and end
        ' points for the line
        startPoint(0) = 1
        startPoint(1) = 1
        startPoint(2) = 0
        endPoint(0) = 5
        endPoint(1) = 5
        endPoint(2) = 0
        
        ' Create the line in model space
        Set lineObj = ThisDrawing. _
            ModelSpace.AddLine _        (startPoint, endPoint)
            
        ' Zoom in on the newly created line
        ZoomAllEnd SubCreating a line using VBSub Ch2_AddLineVB()
        On Error Resume Next
        
        ' Connect to the AutoCAD application
        Dim acadApp As AcadApplication
        Set acadApp = GetObject _
                      (, "AutoCAD.Application")
        If Err Then
            Err.Clear
            Set acadApp = CreateObject _
                      ("AutoCAD.Application")
            If Err Then
                MsgBox Err.Description
                Exit Sub
            End If
        End If
        
        ' Connect to the AutoCAD drawing
        Dim acadDoc As AcadDocument    Set acadDoc = acadApp.ActiveDocument
        
        ' Establish the endpoints of the line
        Dim lineObj As AcadLine
        Dim startPoint(0 To 2) As Double
        Dim endPoint(0 To 2) As Double
        startPoint(0) = 1
        startPoint(1) = 1
        startPoint(2) = 0
        endPoint(0) = 5
        endPoint(1) = 5
        endPoint(2) = 0
        ' Create a Line object in model space
        Set lineObj = acadDoc.ModelSpace.AddLine _
                             (startPoint, endPoint)
        ZoomAllEnd Sub