明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1418|回复: 1

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

[复制链接]
发表于 2008-4-15 16:27:00 | 显示全部楼层 |阅读模式

代码如下:

Dim varCenter(0 To 2) As Double

Dim varFirst_1(0 To 2) As Double
Dim varSecond_1(0 To 2) As Double
Dim varThird_1(0 To 2) As Double

Dim varFirst_2(0 To 2) As Double
Dim varSecond_2(0 To 2) As Double
Dim varThird_2(0 To 2) As Double

Dim dblRadius As Double
Dim dblAngle As Double
Dim varRegions As Variant
Dim objEnt() As AcadEntity

varCenter(0) = 1000
varCenter(1) = 1000
varCenter(2) = 0

dblRadius = 100
dblAngle = 3.1415926


With ThisDrawing.ModelSpace
    ReDim objEnt(2)
    Set objEnt(0) = .AddArc(varCenter, dblRadius * 0.5, dblAngle, 0)
    Set objEnt(1) = .AddLine(objEnt(0).StartPoint, objEnt(0).EndPoint)
    Set objEnt(2) = .AddPoint(varCenter)
    varRegions = .AddRegion(objEnt)
End With
ZoomAll

已经生成了Region,但是怎么为这个面域填充颜色呢?

 楼主| 发表于 2008-4-23 10:33:00 | 显示全部楼层

哦,这个问题我自己已经解决了。方法如下:

对自定义的图形进行颜色填充应该使用Hatch,Hatch有个设置外框的方法,Hatch还有Color属性。

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 08:55 , Processed in 0.154240 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表