vbacad面域求质心

发布网友 发布时间:2022-04-22 07:33

我来回答

2个回答

热心网友 时间:2022-06-17 19:22

Public Sub ss_region()
Dim ss As AcadSelectionSet, region As Variant, p(0 To 2)
Set ss = ThisDrawing.SelectionSets.Add("sss")
ss.SelectOnScreen
Dim ents(0 to 1) As AcadEntity
Dim i As Integer
For i = 0 To 1
Set ents(i) = ss.Item(i)
Next i
ss.Delete
region = ThisDrawing.ModelSpace.AddRegion(ents)
region("0").Boolean acIntersection, region("1")
If region("0").Area > 0 Then
MsgBox "非空交集"
‘MsgBox region("0").Centroid(0)
p(0) = region("0").Centroid(0)
p(1) = region("0").Centroid(1)
P(2) = 0
Call ThisDrawing.ModelSpace.AddCircle(p, 0.5)
region("0").Delete
Else
MsgBox "交集为空"
End If
End Sub追问没有返回值?面域已经做好了

热心网友 时间:2022-06-17 19:22

现场vgf出现个梵蒂冈反倒是

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com