POST
|
Solution: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll /tlb:Mytlb.tlb /codebase Needed a space between ".ddl" And "/tlb:" and needed a space between ".tlb" And "/code"
... View more
04-06-2011
09:03 AM
|
0
|
0
|
257
|
POST
|
Hello, I've created a Visual Studio 08 Active X - MXCommands dll for a VBA button within ArcMap 9.3.1. I'm able to load and use the .tlb on my computer; however when I try it on my test computer the .tlb file is not visible. The MXCommand is not listed in the Component Category Manager under ESRI MXCommands on the test computer. I used RegAsm (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll) to try and register it on the test computer, but this did not help. Both computers are running MS XP professional. Any suggestions of what I could do or try next would be greatly appreciated. I also tried this command to register it: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe C:\Temp\Mydll.dll/tlb: Mytlb.tlb/codebase And received a RegAsm Error - RA0000 The given path's format is not supported. Thank you!
... View more
04-06-2011
07:45 AM
|
0
|
1
|
2081
|
POST
|
Hello, I would like to add a white halo to labels using arcobjects. I think I need to reference the IFormattedTextSymbol interphase, but I'm not sure how to implement this into my current code (see below). Thank you for your help. Dim pDoc As IMxDocument Set pDoc = ThisDocument Set pMap = pDoc.FocusMap ' Get the selected layer Dim pLayer As IGeoFeatureLayer Set pLayer = pMap.Layer(0) Dim pFc As IFeatureClass Dim strOIDName As String Set pFc = pLayer.FeatureClass strOIDName = pFc.OIDFieldName ' Get the selected features from the layer Dim pFSel As IFeatureSelection Set pFSel = pLayer Dim pSelSet As ISelectionSet Set pSelSet = pFSel.SelectionSet Dim pFCur As IFeatureCursor pSelSet.Search Nothing, False, pFCur ' Loop through the selected features and create a label ' expression for the selected features Dim pFeat As IFeature Dim strSql As String Set pFeat = pFCur.NextFeature Do While Not pFeat Is Nothing If strSql = "" Then strSql = strOIDName & " = " & pFeat.OID Else strSql = strSql & " or " & strOIDName & " = " & pFeat.OID End If Set pFeat = pFCur.NextFeature Loop Debug.Print strSql ' Get AnnotateLayerPropertiesCollection from layer Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection Set pAnnoLayerPropsColl = pLayer.AnnotationProperties Dim pAnnoLayerProps As IAnnotateLayerProperties pAnnoLayerPropsColl.QueryItem 0, pAnnoLayerProps, Nothing, Nothing pAnnoLayerProps.Class = "LabelSel" pAnnoLayerProps.WhereClause = strSql Dim aAnnoVBScriptEngine As IAnnotationExpressionEngine Set aAnnoVBScriptEngine = New AnnotationVBScriptEngine Dim pTextsymbol As ITextSymbol Set pTextsymbol = New TextSymbol Dim pFont As IFontDisp Set pFont = pTextsymbol.font Dim pFormattedtxtsym As IFormattedTextSymbol pFormattedtxtsym.ShadowColor = True pFont.Bold = True pFont.size = 10 pFont.Weight = 2 pTextsymbol.font = pFont Dim pLELayerProps As ILabelEngineLayerProperties Set pLELayerProps = pAnnoLayerProps Set pLELayerProps.ExpressionParser = aAnnoVBScriptEngine pLELayerProps.Expression = "[Longlabel] & vbnewline & [Latlabel] & vbnewline & [Elevlabel] & _ vbnewline &[Driftlabel]" Set pLELayerProps.Symbol = pTextsymbol ' Display the lables pLayer.DisplayAnnotation = True ' Refresh the Data Frame pDoc.ActiveView.Refresh
... View more
01-19-2011
06:42 AM
|
0
|
1
|
1200
|
POST
|
Hello, I would like to Run/execute a model within ArcMap 9.3.1 vba. I can run it in vba by exporting out the VBS script and importing it into vba, however I'm wondering if there is an easier way to just call the model by where it is located instead of using the VBS script (e.g. see below). Run "C:\Data\New File Geodatabase.gdb\Toolbox\Model" Thanks for any assistance.
... View more
01-07-2011
07:36 AM
|
0
|
1
|
903
|
POST
|
Hello, I would like to also edit a selected feature/record via ArcMap vba but I'm not having much luck with this code sample, see below. I'm not getting an error, but the record selected is not updating. Private Sub Update_Click() Dim pMxDoc As IMxDocument Dim pLayer As ILayer Dim pInFtrLyr As IFeatureLayer Dim pFtrSel As IFeatureSelection Dim pFeatureClass As IFeatureClass Dim pFields As IFields 'Dim ii As Integer Dim pPoint As IPoint 'Dim pSegColl As ISegmentCollection Dim pEnumLayer As IEnumLayer Dim pMap As IMap Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Set pEnumLayer = pMap.Layers Set pLayer = pEnumLayer.Next Do Until pLayer Is Nothing If pLayer.Name = "Copy of Wells_test" Then Set pInFtrLyr = pLayer End If Set pLayer = pEnumLayer.Next Loop Set pFtrSel = pInFtrLyr If pFtrSel.SelectionSet.Count = 0 Then MsgBox "Please select one Well record", vbOKOnly Exit Sub ElseIf pFtrSel.SelectionSet.Count > 1 Then MsgBox "Please select one Well record", vbOKOnly Exit Sub Else If pFtrSel.SelectionSet.Count = 1 Then Set pPoint = pInFtrLyr.FeatureClass.GetFeature(pFtrSel.SelectionSet.IDs.Next).Shape End If End If Set pFeatureClass = pInFtrLyr.FeatureClass Dim pFSelection As IFeatureSelection Set pFSelection = pInFtrLyr Dim pFClass As IFeatureClass Set pFClass = pInFtrLyr.FeatureClass Dim pFCursor As IFeatureCursor Set pFCursor = pFClass.Update(Nothing, True) Dim pID As New esriSystem.UID pID.value = "esriEditor.Editor" Dim pEditor As IEditor Set pEditor = Application.FindExtensionByCLSID(pID) Dim pFeature As esriGeoDatabase.IFeature Dim pEnumFeature As esriGeoDatabase.IEnumFeature Set pEnumFeature = pEditor.EditSelection Set pFeature = pEnumFeature.Next Do Until pFeature Is Nothing pFeature.value(pFeature.Fields.FindField("Type")) = "update" Set pFeature = pEnumFeature.Next Loop End Sub Thank you for your help.
... View more
01-03-2011
11:03 AM
|
0
|
0
|
504
|
POST
|
Hello, I'm interested in creating a Fit to Display button within ArcMap, similar to the existing Fit to Display button on the Georeference toolbar. Any pointers or ArcObjects code samples would be greatly appreciated. Thanks Kevin ksurbella@gmail.com
... View more
11-17-2010
09:15 AM
|
0
|
0
|
326
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|