ArcObjects Library Reference  (3DAnalyst)    

IImport3DFile Interface

Provides access to a file used to create 3D General Multipatches. Note: the IImport3DFile interface has been superseded by IImport3DFile2. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires 3D Analyst Extension.

When To Use

This interface is new at ArcGIS 9.3. It supersedes IImport3DFile.

Members

Description
Read-only property CanBrowse Indicates if this implementation can browse for files.
Method CreateFromFile Load from File.
Read-only property FileDescription The File Description for Browsing.
Read-only property FileExtension The File Extension for Browsing.
Read-only property Geometry The Geometry interface.
Read-only property IsValidFile Indicates if this is a valid 3D Import File.

CoClasses that implement IImport3DFile

CoClasses and Classes Description
Import3DFile Import 3D File component.

Remarks

Use this interface to import supported 3D models for 3D symbology.  As of version 9.3, the following 3D model formats are supported: 3D Studio (*.3ds), OpenFlight 15.8 (*.flt), VRML 2.0 (*.wrl), SketchUp 6 (*.skp), and Collada 1.4 (*.dae). You can also use this interface to implement your own custom 3D models so that they can be imported on the user interface the same way as the other built-in 3D models.  Please see the examples.

[Visual Basic 6.0]

'Step 1: Implement your own 3D model format (a fictitious AutoCAD *.dxf format here) via a class module in a VB ActiveX DLL (MyImport3DFile.dll in this example):

(need to reference esri3DAnalyst and esriGeometry assemblies)

Implements IImport3DFile

Private Property Get IImport3DFile_CanBrowse() As Boolean
  'make sure it can be browsed in the 'Files of type' dropdown in the Open dialog
  IImport3DFile_CanBrowse = True
End Property

Private Sub IImport3DFile_CreateFromFile(ByVal FilePath As String)
  'this runs first when importing...
  If IImport3DFile_IsValidFile(FilePath) Then MsgBox FilePath
End Sub

Private Property Get IImport3DFile_FileDescription() As String
  'appears in the 'Files of type' dropdown
  IImport3DFile_FileDescription = "AutoCAD DXF File"
End Property

Private Property Get IImport3DFile_FileExtension() As String
  'appears in the 'Files of type' dropdown
  IImport3DFile_FileExtension = ".dxf"
End Property

Private Property Get IImport3DFile_Geometry() As esriGeometry.IGeometry
  'this runs second after IImport3DFile_CreateFromFile
  'implement getting geometry here...for example:
  'Set IImport3DFile_Geometry = New MultiPatch

  '<your own code here to get the geometry of the imported 3D model>
End Property

Private Property Get IImport3DFile_IsValidFile(ByVal FilePath As String) As Boolean
  Dim sExt As String: sExt = LCase(Right(FilePath, 3))
  IImport3DFile_IsValidFile = IIf(sExt = "dxf", True, False)
End Property

 

'Step 2: After a successful compilation of the above custom DLL, register it to the 3D Import File category thru a standard VB EXE (use tools like OLE View to find your object's ID):

'Your custom object ID:

Const cMyImport3DFile = "{D3B5F543-32BF-4623-943D-103EFC586A75}"    'This GUID varies on new object.

'The unique ID for the SxImport3DFile category:
Const cCATID_SxImport3DFile = "{980BC11D-BE90-4837-8123-18BCEC4D2096}"    'This GUID is fixed.
 
Sub Main()
 
  Dim sDllPath As String: sDllPath = "D:\temp\MyImport3DFile.dll"    'the location of your custom dll
  Dim objid As New UID: objid = cMyImport3DFile
  Dim catid As New UID: catid = cCATID_SxImport3DFile
 
  Dim pCCM As IComponentCategoryManager: Set pCCM = New ComponentCategoryManager
  pCCM.SetupObject sDllPath, objid, catid, True

End Sub

 

(An alternative for step 2 is to use the Component Category Manager, categories.exe, available in the install \bin folder to add/remove your custom object to a category.  In this example, you'd add MyImport3DFile.dll to Import 3D File category.)

 

Now, your own custom "AutoCAD DXF" 3D model can be browsed in the Open dialog when you try to import a 3D Model for a Marker 3D Symbol.