CAD VBA创建填充圆

更新时间:2023-06-05 06:01:25 阅读: 评论:0

CAD VBA创建填充圆
barcarolleSub Command1_Click()
Dim center(0 To 2) As Double
Dim radius As Double
Dim entity As Object
美国之声中文网站Dim found As Boolean
Dim hatchObj As AcadHatch
生活哲理散文Dim patternName As String
Dim PatternType As Long
绯闻少女下载
folderDim bAssociativity As Boolean
lor = 4 '设置当前图层为青色
patternName = "SOLID" '填充样式
PatternType = 0
bAssociativity = True
Dim circleobj(0 To 0) As AcadCircle '声明填充边界
Set hatchObj = ThisDrawing.ModelSpace.AddHatch _
(PatternType, patternName, bAssociativity) '创建填充
center(0) = 0
center(1) = 0安排英语
center(2) = 0
radius = 17
    Set circleobj(0) = ThisDrawing.ModelSpace.AddCircle(center, radius) '创建需要填充的边界
    hatchObj.AppendOuterLoop (circleobj) '填充
End Sub
Dim entity As Object
Dim found As Boolean
Dim hatchObj As AcadHatch
Dim patternName As Stringcrackdown
Dim PatternType As Long
Dim bAssociativity As Boolean

patternName = "SOLID" '填充样式
PatternType = 0
bAssociativity = True
wow是什么意思
Dim circleobj(0 To 0) As AcadCircle '声明填充边界
Set hatchObj = ThisDrawing.ModelSpace.AddHatch _
(PatternType, patternName, bAssociativity) '创建填充

    For Each entity In ThisDrawing.ModelSpace
        With entity
            If (.EntityName = "AcDbCircle") Then
     
            If (.Radius = 0.4) Then '若圆半径为0.4
            Set circleobj(0) = ThisDrawing.ModelSpace.AddCircle(.Center, 1.28) '打招呼用语创建需要填充的边界
            hatchObj.AppendOuterLoop (circleobj) '填充
            found = True
            End If
            End If
        End With
   
        Set entity = Nothing '清空当前实体
        Set circleobj(0) = Nothing '清空边界
    Next entity '下一实体
   

    If Not found Then '没有发现符合条件的实体
        MsgBox "没有发现需要填充的圆", vbInformation
    End If

本文发布于:2023-06-05 06:01:25,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/134456.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:填充   边界   需要   创建   生活   绯闻   青色
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图