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