明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 619|回复: 0

VB新手请教问题,我想把填充颜色改成其他颜色,且不再是渐变色,该如何改动,谢谢

[复制链接]
发表于 2020-5-25 18:15:33 | 显示全部楼层 |阅读模式


Dim obj_hatch As Object
Dim PatternType As Integer
Dim GradientName As String
Dim GradientColor1 As Integer, GradientColor2 As Integer
Dim AssociativeHatch As Boolean
Dim outerloop(0 To 0) As Object, innerloop(0 To 0) As Object
Dim aloop As Variant
Dim obj_circle1 As Object, obj_circle2 As Object
Dim center(0 To 2) As Double
Dim color As Object


center(0) = 5#: center(1) = 5#: center(2) = 0#
Set obj_circle1 = obj_ModelSpace.AddCircle(center, 5)
Set obj_circle2 = obj_ModelSpace.AddCircle(center, 2.5)
PatternType = 0
GradientName = "SPHERICAL"
AssociativeHatch = True
Set outerloop(0) = obj_circle1
Set innerloop(0) = obj_circle2

Set obj_hatch = obj_ModelSpace.AddHatch(PatternType, GradientName, AssociativeHatch, 1)
obj_hatch.AppendOuterLoop outerloop
obj_hatch.AppendInnerLoop innerloop

Set color = obj_Acad.GetInterfaceObject("AutoCAD.AcCmColor.16")
color.SetRGB 255, 0, 0
obj_hatch.GradientColor1 = color
color.SetRGB 0, 255, 0
obj_hatch.GradientColor2 = color
obj_hatch.Evaluate
obj_Acad.ZoomExtents


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

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

本版积分规则

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

GMT+8, 2024-11-25 05:49 , Processed in 0.168253 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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