IFCsvr ActiveX Object Reference


Sample 1

[IFCsvr Home ]
Previous Chapter: template 1 (readFromFile)
Next Chapter: Sample 2


Finding all IFC Objects in a model data

This example works on Excel VBA module.
Option Explicit
  Public objIFCsvr As Object
  Public objDesign As Object

Public Sub test_Find_All_Object()
  Dim objEntity As Object
  Dim objAtt As Object
    
  Dim r1 As Excel.Range
    
  Dim strFindName As String
  Dim strAttName As String
  
  ' ============================================================
  Set objIFCsvr = CreateObject("IFCsvr.R200")
  Set objDesign = objIFCsvr.OpenDesign(ActiveSheet.Range("D3").Text)
  objDesign.FileDirectory ThisWorkbook.Path
  
  Set r1 = ActiveSheet.Range("A8")
  
  For Each objEntity In objDesign.FindObjects("*")
    r1.Value = objEntity.Type
    r1.Offset(0, 1).Value = "#" & objEntity.P21ID
    r1.Offset(0, 2).Value = objEntity.OID
      
    Set r1 = r1.Offset(1, 0)
  Next objEntity
  
  Set objDesign = Nothing
  Set objIFCsvr = Nothing
  
End Sub

| IFCsvr Home | Previous Chapter | Next Chapter |


Copyright (c) 1999 SECOM Co., Ltd. Intelligent Systems Lab. All Rights Reserved.