zhangruipig1 发表于 2008-4-15 16:27:00

由一条线段和圆弧组成的半圆,应该如何填充颜色

<p>代码如下:</p><p>Dim varCenter(0 To 2) As Double</p><p>Dim varFirst_1(0 To 2) As Double<br/>Dim varSecond_1(0 To 2) As Double<br/>Dim varThird_1(0 To 2) As Double</p><p>Dim varFirst_2(0 To 2) As Double<br/>Dim varSecond_2(0 To 2) As Double<br/>Dim varThird_2(0 To 2) As Double</p><p>Dim dblRadius As Double<br/>Dim dblAngle As Double<br/>Dim varRegions As Variant<br/>Dim objEnt() As AcadEntity</p><p>varCenter(0) = 1000<br/>varCenter(1) = 1000<br/>varCenter(2) = 0</p><p>dblRadius = 100<br/>dblAngle = 3.1415926</p><p><br/>With ThisDrawing.ModelSpace<br/>&nbsp;&nbsp;&nbsp; ReDim objEnt(2)<br/>&nbsp;&nbsp;&nbsp; Set objEnt(0) = .AddArc(varCenter, dblRadius * 0.5, dblAngle, 0)<br/>&nbsp;&nbsp;&nbsp; Set objEnt(1) = .AddLine(objEnt(0).StartPoint, objEnt(0).EndPoint)<br/>&nbsp;&nbsp;&nbsp; Set objEnt(2) = .AddPoint(varCenter)<br/>&nbsp;&nbsp;&nbsp; varRegions = .AddRegion(objEnt)<br/>End With<br/>ZoomAll</p><p>已经生成了Region,但是怎么为这个面域填充颜色呢?</p>

zhangruipig1 发表于 2008-4-23 10:33:00

<p>哦,这个问题我自己已经解决了。方法如下:</p><p>对自定义的图形进行颜色填充应该使用Hatch,Hatch有个设置外框的方法,Hatch还有Color属性。</p>
页: [1]
查看完整版本: 由一条线段和圆弧组成的半圆,应该如何填充颜色