问题描述
第一次在 vba 中编码,我遇到了一个脚本问题,该脚本旨在过滤特定级别上的点绘图并放置一个特定的在每个实例中的单元格。到目前为止,我所拥有的是一个输入框,它请求级别名称和两个分别扫描点和级别的数组。然后我将这些数组相交,希望能产生正确的点集。
我的问题是:如何提取点坐标以便我可以为数组中的每个项目实现 clsCellPlacer
或类似的东西?
Sub Main()
Dim nivel As String
nivel = InputBox("Enter Level Name:")
Dim e1 As ElementEnumerator
Dim e2 As ElementEnumerator
Dim c1 As ElementScanCriteria
Dim c2 As ElementScanCriteria
Dim a1() As Element
Dim a2() As Element
Dim a3() As Element
Dim i as Long
Dim iStart as Long
Dim iEnd as Long
End Sub
Function ArrayBuilder(nivel,e1,e2,c1,c2,a1,a2,a3)
Dim iLevel As Level
Set iLevel = ActiveModelReference.Levels(nivel)
Set c1 = New ElementScanCriteria
c1.ExcludeAllLevels
c1.IncludeLevel iLevel
Set e1 = ActiveModelReference.Scan(c1)
a1 = e1.BuildArrayFromContents 'a1 contains all objects on the specified level'
Set c2 = New ElementScanCriteria
c2.ExcludeAllTypes
c2.IncludeType msdElementTypePoint3d
Set e2 = ActiveModelReference.Scan(c2)
a2 = e2.BuildArrayFromContents 'a2 contains all point objects'
Set a3 = Application.IntersectArray(a1,a2)
End Function
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)