Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm working on a custom toolbar for an extension which will have operations that work upon a specific, user-selectable layer.

Is it possible to directly use the layer selector used by ESRI's toolbars in your own toolbar?

For example, the 3D Effects toolbar contains a "Layer:.." combo box for selecting the layer on which to operate. It includes a full tree of the scene, filtered to certain types of layers. Is this control a reusable object?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Since its a toolcontrol its treated like a singleton, in that you can only have one in ArcMap at a time. If it already exists on the 3D toolbar you wont be able to create another instance of it somewhere else. You can see this by trying it manually through the customize dialog.

share|improve this answer
add comment

I believe you are refering to the 3DAnalyst_LayerListControl? This is a ArcMap Command that you can use any command in your own toolbar.

ArcMap Commands

e.g. using ArcObjects for accessing 3DAnalyst_LayerListControl

  Dim pUID As New UID
  Dim pCmdItem As ICommandItem
  ' Use the GUID of the Save command
  pUID.Value = "{2D73B144-8F1C-11D4-A10F-00508BD60CB9}"
  ' or you can use the ProgID
  ' pUID.Value = "esri3DAnalystUI.DDDAnalystLayerListControl"
  pUID.SubType = 3
  Set pCmdItem = Application.Document.CommandBars.Find(pUID)
  pCmdItem.Execute

Or reference it directly to your toolbar IToolBarDef class

 Public Sub GetItemInfo(ByVal pos As Integer, ByVal itemDef As ESRI.ArcGIS.SystemUI.IItemDef) Implements ESRI.ArcGIS.SystemUI.IToolBarDef.GetItemInfo
        ' Define the commands that will be on the toolbar. The 1st command
        ' ID is the ProgID of the command. Group determines whether the command
        ' begins a new group on the toolbar

        Select Case pos
        Case 0
                itemDef.ID = "esri3DAnalystUI.DDDAnalystLayerListControl"
                itemDef.Group = False

        End Select

    End Sub
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.