0

第一次在 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
4

0 回答 0