sharksun 发表于 2004-5-8 18:35:00

关于面域还是没弄明白(请看代码)

Sub RegionSplineAndLine()<BR>               <BR>       ' 创建样条曲线<BR>               Dim splineObj(0 To 0) As AcadSpline<BR>               Dim noOfPoints As Integer<BR>               Dim startTan(0 To 2) As Double<BR>               Dim endTan(0 To 2) As Double<BR>               Dim fitPoints(0 To 8) As Double<BR>               <BR>               noOfPoints = 3<BR>               startTan(0) = 1: startTan(1) = 1: startTan(2) = 0<BR>               endTan(0) = 2: endTan(1) = 2: endTan(2) = 0<BR>               fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0<BR>               fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0<BR>               fitPoints(6) = 10: fitPoints(7) = 3: fitPoints(8) = 0<BR>        <BR>               Set splineObj(0) = ThisDrawing.ModelSpace.AddSpline _<BR>               (fitPoints, startTan, endTan)<BR>               <BR>               <BR>               <BR>               '创建3条直线<BR>               Dim lineObj(0 To 2) As AcadLine<BR>               <BR>               Dim L1start(0 To 2) As Double<BR>               Dim L1end(0 To 2) As Double<BR>               Dim L2start(0 To 2) As Double<BR>               Dim L2end(0 To 2) As Double<BR>               Dim L3start(0 To 2) As Double<BR>               Dim L3end(0 To 2) As Double<BR>       <BR>                               <BR>               L1start(0) = 2: L1start(1) = 1: L1start(2) = 0<BR>               L1end(0) = 8: L1end(1) = 1: L1end(2) = 0<BR>               <BR>               L2start(0) = 3: L2start(1) = -1: L2start(2) = 0<BR>               L2end(0) = 3: L2end(1) = 12: L2end(2) = 0


               L3start(0) = 6: L3start(1) = 0: L3start(2) = 0<BR>               L3end(0) = 6: L3end(1) = 9: L3end(2) = 0<BR>               <BR>               <BR>               Set lineObj(0) = ThisDrawing.ModelSpace.AddLine(L1start, L1end)<BR>               Set lineObj(1) = ThisDrawing.ModelSpace.AddLine(L2start, L2end)<BR>               Set lineObj(2) = ThisDrawing.ModelSpace.AddLine(L3start, L3end)<BR>        <BR>               <BR><FONT color=#ff0066>       ThisDrawing.SendCommand "_boundary 4,2 "</FONT><BR>               我想直接生成面域,结果把boundary对话框调出来了,还得手动选择内部点.不知道上句代码应该怎么改才可以.


       还有,boundary对话框,里有对象类型(面域和多段线),如何通过代码把默认值设为面域呢?


多谢指教<BR><BR>End Sub

雪山飞狐_lzh 发表于 2004-5-8 21:48:00

是-<FONT color=#ff0066>boundary不是_boundary       </FONT>

sharksun 发表于 2004-5-9 13:56:00

不行啊, 还是要你指定内部点啊.


你运行一下代码看看?

雪山飞狐_lzh 发表于 2004-5-9 14:10:00

ThisDrawing.SendCommand "-boundary" &amp; vbCr &amp; "4,2" &amp; vbCr &amp; vbCr &amp; "y" &amp; vbCr<BR>你 试试



做SendCommand的时候一定要自己用命令试一次,靠猜是没用的


另外,回车用 vbCr 代替,不用空格,虽然有时可以
页: [1]
查看完整版本: 关于面域还是没弄明白(请看代码)