wfcst2004 发表于 2005-12-17 22:09:00

[求助]

<P>求助你好:我的程序在此:</P>
<P>Private Sub Command1_Click()<BR>&nbsp;On Error Resume Next<BR>&nbsp; Dim acadApp As AcadApplication<BR>&nbsp;Set acadApp = GetObject(, "AutoCAD.Application")<BR>&nbsp;&nbsp;&nbsp; acaApp.Command = script.exe<BR>&nbsp;&nbsp;&nbsp; If Err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Err.Clear<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set acadApp = CreateObject("AutoCAD.Application")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Err Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox Err.Description<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; End If<BR>Dim plineobj As Autocad.AcadLWPolyline<BR>&nbsp;Dim points(0 To 5) As Double<BR>&nbsp;points(0) = 1: points(1) = 1<BR>&nbsp;points(2) = 100: points(3) = 100<BR>&nbsp;points(4) = 200: points(5) = 200<BR>&nbsp;Set plineobj = acadApp.ActiveDocument.ModelSpace.AddlightweightLWPolyline(points)<BR>&nbsp;plineobj.Closed = ture<BR>&nbsp;&nbsp; ZoomExtents<BR>&nbsp;ZoomAll<BR>acadApp.Visible = True<BR>End Sub</P>
<P>谢谢你!总算有侠义之士了</P>

chenlei20 发表于 2005-12-17 23:03:00

不好意思,不懂

wfcst2004 发表于 2005-12-18 08:53:00

没关系了,共同学习,谢谢!
页: [1]
查看完整版本: [求助]