求助vb简单问题
我想在vb中直接控制autocad画图,请问我该如何把vb与cad连接上呢??? <P>Use the Help files....</P><P>In 2004</P>
<P class=body>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: </P><PRE class=prog_in_0>Sub Ch2_ConnectToAcad()</PRE><PRE class=prog_in_0> Dim acadApp As AcadApplication</PRE><PRE class=prog_in_0> On Error Resume Next</PRE><PRE class=prog_in_0> </PRE><PRE class=prog_in_0> Set acadApp = GetObject(, "AutoCAD.Application.16")</PRE><PRE class=prog_in_0> If Err Then</PRE><PRE class=prog_in_0> Err.Clear</PRE><PRE class=prog_in_0> Set acadApp = CreateObject("AutoCAD.Application.16")</PRE><PRE class=prog_in_0> If Err Then</PRE><PRE class=prog_in_0> MsgBox Err.Description</PRE><PRE class=prog_in_0> Exit Sub</PRE><PRE class=prog_in_0> End If</PRE><PRE class=prog_in_0> End If</PRE><PRE class=prog_in_0> MsgBox "Now running " + acadApp.Name + _</PRE><PRE class=prog_in_0> " version " + acadApp.Version</PRE><PRE class=prog_in_end_0>End Sub</PRE>
<P class=body>Next, 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. </P><PRE class=prog_in_0>Dim acadDoc as AcadDocument</PRE><PRE class=prog_in_end_0>Set acadDoc = acadApp.ActiveDocument</PRE>
<P class=body>From this point on, use the acadDoc variable to reference the current AutoCAD drawing. </P>
<P>
<TABLE class=FooterTable cellSpacing=0 cellPadding=4 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD> </TD>
<TD align=right> </TD></TR></TBODY></TABLE></P> thankyou <P>我需要VB打开AutoCAD的详细程序</P> <P>已经很详细了</P>
页:
[1]