求助
<P>各位帮主:请帮帮忙吧。这个问题困扰我好久了,为什么我在vb编程时将外面的边界线分为两段,他咋就填补上了那?并且填到内边界线里了?请看程序:</P><P>On Error Resume Next<BR> Dim acadApp As AcadApplication<BR> Dim acaddoc As AcadDocument<BR> Set acadApp = GetObject(, "AutoCAD.Application")<BR>' acaApp.Command = script.exe<BR> If Err Then<BR> Err.Clear<BR> Set acadApp = CreateObject("AutoCAD.Application")<BR> Set acaddoc = acadApp.ActiveDocument<BR> acadApp.Visible = True<BR> If Err Then<BR> MsgBox Err.Description<BR> Exit Sub<BR> End If<BR> End If<BR> Dim hatchobj As AcadHatch<BR> Dim patternname As String<BR> Dim patterntype As Long<BR> Dim bassociativity As Boolean<BR> patterntype = 0<BR> patternname = "ansi31"<BR> bassociativity = True<BR> Set hatchobj = acadApp.ActiveDocument.ModelSpace.AddHatch(0, "ansi31", True)<BR> Dim innerloop(0 To 0) As AcadEntity<BR> Dim outerloop(0 To 0) As AcadEntity<BR> Dim Plineobj As AcadLWPolyline<BR> Set acaddoc = acadApp.ActiveDocument<BR> Dim points(0 To 7) As Double<BR> points(0) = 10: points(1) = 10<BR> points(2) = 30: points(3) = 50<BR> points(4) = 70: points(5) = 20<BR> Dim stp0(0 To 2) As Double<BR> Dim enp0(0 To 2) As Double<BR> stp0(0) = 70: stp0(1) = 20: enp0(2) = 0<BR> enp0(0) = 10: enp0(1) = 10: enp0(2) = 0<BR>' Set plnObj = acadApp.ActiveDocument.ModelSpace.AddLine(stp0, enp0)<BR>' points(6) = 10: points(7) = 10<BR> Set innerloop(0) = acaddoc.ModelSpace.AddLightWeightPolyline(stp0, enp0)<BR> Dim centerpoint10(0 To 2) As Double<BR> Dim endpoint10 As Double<BR> Dim radius10 As Double<BR> centerpoint10(0) = 20: centerpoint10(1) = 20: centerpoint10(2) = 0#<BR> radius10 = 4<BR> Set outerloop(0) = acadApp.ActiveDocument.ModelSpace.AddCircle(centerpoint10, radius10)<BR> hatchobj.AppendOuterLoop (outerloop)<BR>hatchobj.AppendInnerLoop (innerloop)<BR>hatchobj.Evaluate<BR>acadApp.ActiveDocument.Regen True<BR> ZoomExtents<BR> ZoomAll</P>
<P>在此先谢谢各位了</P>
页:
[1]