angelcardenasupsp

How to Add layers with Python

Discussion created by angelcardenasupsp on Aug 19, 2012
Latest reply on Aug 21, 2012 by angelcardenasupsp
how I do this in python

this is in VBA

Public Sub AddLayer() 'adiciona el layer al map
GetT
  'Open Feature Class
  Set pWorkFact = New AccessWorkspaceFactory
  If sPathBase = "" Then
    Exit Sub
  Else
  Set pFWorkspace = pWorkFact.OpenFromFile(sPathBase, 0)
  End If
  Set pFeatureClass = pFWorkspace.OpenFeatureClass(sql)
  'Create new layer
  Set pFeatureLayer = New FeatureLayer
  Set pFeatureLayer.FeatureClass = pFeatureClass

pFeatureLayer.Name = FRBROW.ComboBox1.Value & " - " & FRBROW.ComboBox2.Value
  'Add layer to map
  Set pDoc = ThisDocument
  Set pMap = pDoc.FocusMap
  Set pActiveView = pMap
  pMap.AddLayer pFeatureLayer
  pActiveView.Refresh
End Sub

Outcomes