IFCsvr ActiveX Object Reference


Sample 2

[IFCsvr Home ]
Previous Chapter: Sample 1
Next Chapter: Sample 3


Creating an IFC Object and save

This example works on Excel VBA module. The objIFCsvr, objDesign, objEntity variables are defined as a predefined type, therefore you must set the reference configuration in the VBA editor.

Sub TEST_Create_Ifc_Object()

  Dim objIFCsvr As IFCsvr.R200
  Dim objDesign As IFCsvr.Design
  Dim objEntity As IFCsvr.Entity
  
  Dim r1 As Range
  Dim sheet1 As Worksheet
  Dim i As Long
  Dim sFileName As String
  Dim strEntityName As String
  
  Set sheet1 = ActiveSheet
  Set r1 = sheet1.Range("B14")
  sFileName = sheet1.Range("C7").Text & ".ifc"
  
  Set objIFCsvr = New IFCsvr.R200
  Set objDesign =  objIFCsvr.newDesign(sFileName)
  objDesign.fileDirectory ThisWorkbook.Path
  
  strEntityName =  "IfcDoor"
  Set objEntity = objDesign.Add(strEntityName)
  
  With  objEntity
   .GUID = objIFCsvr.EncodeBase85( objIFCsvr.GenGUID() )
    '.Attributes("OwnerHistory").value =
    '.Attributes("Label").value =
    '.Attributes("UserDefinedType").value =
    '.Attributes("DocumentReferences").value =
    '.Attributes("LocalPlacement").value =
    '.Attributes("Representations").value =
    '.Attributes("Classification").value =
  End With  
  
  objDesign.Save

End Sub

| IFCsvr Home | Previous Chapter | Next Chapter |


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