Ну не забыл, а скорее не знал вообще что вставлять....
я создал кнопку....где в он-клик поместил Form1.Show
Option Explicit
' Implement the ICommand interface
Implements ICommand
Dim m_papp As IApplication 'ArcMap application
Private Property Get ICommand_Bitmap() As esriCore.OLE_HANDLE
ICommand_Bitmap = Form1.Picture1.Picture.Handle
End Property
Private Property Get ICommand_Caption() As String
' Set the string that appears when the command is used as a
' menu item.
ICommand_Caption = "AddData"
End Property
Private Property Get ICommand_Category() As String
' Set the category of this command. This determines where the
' command appears in the Commands panel of the Customize dialog.
ICommand_Category = "GidroBaseTools"
End Property
Private Property Get ICommand_Checked() As Boolean
End Property
Private Property Get ICommand_Enabled() As Boolean
' Add some logic here to specify in what state the application
' should be in for the command to be enabled. In this example,
' the command is enabled only when there is at least one data
' layer loaded in ArcMap.
' Dim pMxDoc As IMxDocument
Dim pLayerCount As Integer
'm_pApp is set in OnCreate
Set pMxDoc = m_papp.Document
pLayerCount = pMxDoc.FocusMap.LayerCount
If pLayerCount > 0 Then
ICommand_Enabled = True
Else
ICommand_Enabled = True
End If
End Property
Private Property Get ICommand_HelpContextID() As Long
'ICommand_HelpContextID = 1234
End Property
Private Property Get ICommand_HelpFile() As String
' If the help file is not registered you may need
' to supply the full path to the file
'ICommand_HelpFile = "MyHelp.hlp"
End Property
Private Property Get ICommand_Message() As String
'Set the message string that appears in the statusbar of the
'application when the mouse passes over the command.
ICommand_Message = "AddData"
End Property
Private Property Get ICommand_Name() As String
' Set the internal name of this command. By convention, this
' name string contains the category and caption of the command.
ICommand_Name = "AddData"
End Property
Private Sub ICommand_OnClick()
Form1.Show
End Sub
Private Sub ICommand_OnCreate(ByVal hook As Object)
' The hook argument is a pointer to Application object.
' Establish a hook to the application
Set m_papp = hook
End Sub
Private Property Get ICommand_Tooltip() As String
'Set the string that appears in the screen tip.
ICommand_Tooltip = "AddData"
End Property
***************************
и уже в самой form1 поместил кнопку где в onckick поместил
Dim m_papp As IApplication
Private Sub Command1_Click()
Dim pWorkspaceFactory As IWorkspaceFactory
Dim pFeatureWorkspace As IFeatureWorkspace
Dim pFeatureLayer As IFeatureLayer
Dim pMxDoc As IMxDocument
Dim pMap As IMap
'create a new ShapefileWorkspaceFactory object and open a shapefile folder
Set pWorkspaceFactory = New AccessWorkspaceFactory
Set pFeatureWorkspace = pWorkspaceFactory.OpenFromFile("C:\arcgis\gidrobase\gidrobase.mdb", 0)
'Create a new FeatureLayer and assign a shapefile to it
Set pFeatureLayer = New FeatureLayer
Set pFeatureLayer.FeatureClass = pFeatureWorkspace.OpenFeatureClass("rivers_lin_polyline_polyline")
pFeatureLayer.Name = pFeatureLayer.FeatureClass.AliasName
'Add the FeatureLayer to the focus map
Set pMxDoc = m_papp.Document
Set pMap = pMxDoc.FocusMap
pMap.AddLayer pFeatureLayer
pMxDoc.ActivatedView.Refresh
End Sub
а как можно инстанс pMxDoc объекта в UserForm передать???