How to update the Input Settings (Coordinate Units) for Microstation Dgn file?

697
0
09-14-2011 01:55 AM
Sharadarya
New Contributor
Hi ,

I am working on ArcGIS 9.3.1 Data Interoperablity Tools. I need to import the Microstation Design file(*.dgn) by programically. I did it by Geoprocessing tool by opening the "Data Interoperatblity tools.tbx". It imports the dgn file into fgdb but when i open feature layer in ArcMap, it shows a warning message (Inconsistent extent). I checked the log file generated by ArcCatalog-> DataInteroperablity Tools-> QuickImport and my code both. I got a difference in these two. In Catalog log file it uses a MASTER coordinate units whereas with my code it uses the SUB coordinate units. If it do the same by using ArcCatalog with SUB coordinate units, it shows the warning message in ArcMap.

How can i change this settings by code. I tried so much but no luck still. Code is as below :

     pToolWorkspaceFactory = New ESRI.ArcGIS.Geoprocessing.ToolboxWorkspaceFactory
            pToolWorkspace = pToolWorkspaceFactory.OpenFromFile("C:\Program Files\ArcGIS\ArcToolbox\Toolboxes", 0)
            If (pToolWorkspace IsNot Nothing) Then
                pGPToolbox = pToolWorkspace.OpenToolbox("Data Interoperability Tools")
                If (pGPToolbox IsNot Nothing) Then
                    pGPTool = pGPToolbox.OpenTool("QuickImport")
                    If (pGPTool IsNot Nothing) Then
                        pParams = pGPTool.ParameterInfo

                        pParameter = pParams.Element(0) 'First Parameter (Microstation DGN File)
                        pParamEdit = pParameter
                        pDataType = pParameter.DataType
                        sValue = "IGDS," + strDgnFilePath
                        pParamEdit.Value = pDataType.CreateValue(sValue)

                        pParameter = pParams.Element(1) 'Second Parameter (Ouput FGDB Path)
                        pParamEdit = pParameter
                        pDataType = pParameter.DataType
                        sValue = strFGDBPath
                        pParamEdit.Value = pDataType.CreateValue(sValue)

                        pTrackCancel = New ESRI.ArcGIS.Display.CancelTracker
                        pGPComHelper = New GpDispatch
                        pEnvMgr = pGPComHelper.EnvironmentManager
                    
                        pMess = pGPTool.Validate(pParams, False, Nothing)

                        If CheckForError(pMess) = True Then
                            Dim isValidTool As Boolean = pGPTool.IsValid()
                            pGPTool.Execute(pParams, pTrackCancel, pEnvMgr, pMess)
                            IsImported = True
                        Else
                            IsImported = False
                        End If

                    End If
                End If
      End if

Please help me.
Can i do the same in another way?

Thanks in advance.
Sharad arya
0 Kudos
0 Replies