|
POST
|
Here is a snippet from an implementation I have that places a TextElement onto a LayoutView. From what I recall, it was kind of tricky to determine the actual coords for the PutCoords method of the IEnvelope and I just fiddled with it until I got it to the desired location, so hopefully someone can add to this posting. Good luck!
Dim pActiveView As IActiveView
Dim pEnv As IEnvelope
pActiveView = pMxDoc.PageLayout
pEnv = New Envelope
Dim pTextElement As ITextElement
pTextElement = New TextElement
pTextElement.Text = "blah, blah""
'Set font
Dim pTextSym As IFormattedTextSymbol
pTextSym = New TextSymbol
Dim pFont As stdole.IFontDisp
pFont = New stdole.StdFont
pFont.Name = "Times New Roman"
pFont.Size = 23
pFont.Bold = True
pTextSym.Font = pFont
pTextElement.Symbol = pTextSym
pEnv.PutCoords(4.5, 7, 4.5, 7) 'this was a bit tricky to specifically determine where to place
Dim pElem As IElement
pElem = pTextElement
pElem.Geometry = pEnv
Dim pGc As IGraphicsContainer
pGc = pMxDoc.PageLayout
pGc.AddElement(pElem, 0)
... View more
10-13-2011
03:41 AM
|
0
|
0
|
913
|
|
POST
|
Also, I just found this in the documentation: "...If an SDE workspace was created from a PropertySet, PathName will be empty" See here: http://edndoc.esri.com/arcobjects/9.0/componenthelp/esriGeodatabase/IWorkspace_PathName.htm
... View more
10-12-2011
09:13 AM
|
0
|
0
|
1081
|
|
POST
|
I have a frustrating unpredictable situation where for some reason (which I have yet discovered the reason) when I call IWorkspace.PathName I get an empty string. I am solely dealing with personal GDB feature classes - no remote database workspaces involved. I initially thought it was down to the fact that I had a large number of layers loaded in my TOC all located in my PGDB, so removed all of the unnecessary layers before calling the code. This appears to sort the problem for 99% of the time, but hasn't solved it completely. I'm running 9.3 on XP (32 and 64-bit) and get the empty string returned on both platforms. I've noticed users finding this occurring with SDE databases but not with PGDBs - has anyone experienced this? Thanks James James, How are you going thru the list of layers in the TOC? This is just a hunch, but are you accounting for the zero-based index count? For example,
For i = 0 To pMap.LayerCount - 1
'get the pathName of the pMap.Layer(i)
Next
this would start at the first layer and end at the last one. If you didn't specify -1 on the layerCount, it could potentially sequence to a nothing for the layer and return an null/empty string or throwing an ArgumnetExeption -- and depending upon how you are handling the error it might be the cause of the empty null being returned. Post up some of the code you suspect is giving the problems.
... View more
10-12-2011
09:02 AM
|
0
|
0
|
1081
|
|
POST
|
Plans to migrate old information to the new forum? I am not sure of that, but I do know that the old forums is the first place I run searches! Tons of info there.
... View more
10-12-2011
07:25 AM
|
0
|
0
|
829
|
|
POST
|
I am trying to convert vba scripts to .net and some of the broken links are for the IFeatureClass and IFeatureLayer, etc. I figured out that I need the ESRI.ArcGIS.Geodatabase namespace, however, my only options for Imports are: ESRI.ArcGIS.ArcMapUI ESRI.ArcGIS.Desktop ESRI.ArcGIS.esriSystem ESRI.ArcGIS.Framework How do I import the Geodatabase namespace? Thanks, Have you tried set a reference to ESRI.ArcGIS.Geodatabase in your project or is it included in the references list? Right-click your project in the Solution Explorer and select Properties. Then click the References tab on the left and see if the reference is there. If not, add it. Hopefully this helps!
... View more
10-12-2011
07:22 AM
|
0
|
0
|
637
|
|
POST
|
Genaro, Hopefully someone can spot the obvious issue and provide a quick solution. Something else that I didn't mention previously is to consider placing your Toolbar items/controls onto a UserControl instead then hook the IApplication to this. It also makes the IToolBarDef class much cleaner. Basically, the ICommand class pretty much stays the same, except the OnCreate method creates a new instance of the UserControl, as well as passing the IApplication to it as mentioned above. I remember moving to this approach because I was having issues with my Toolbar drawing funny and Neil made the suggestion to add a Panel to the UC and then add the controls to the Panel -- which this Panel could then be refreshed, removing my drawing funny issues. I've stuck with this approach ever since. Although I am not totally certain how much different other techniques (ESRI samples) differ.
... View more
10-12-2011
05:24 AM
|
0
|
0
|
1394
|
|
POST
|
So fast - many thx for the link James. I have fixed my code for setting the NameProperty of the Textelement, so I can check, if it set or not and I can edit this one. Excellent! Actually, this has me revisiting one of my apps and implementing this very same thing.
... View more
10-11-2011
08:18 AM
|
0
|
0
|
1093
|
|
POST
|
In the ESRI example they pass "OwnersTable" - what is that? I believe it is the ITable to join to the IFeatureLayer. You need to replace OwnersTable with the Table in your implementation you wish to join to the target layer. What is the source table and FeatureLayer you want to join?
... View more
10-11-2011
07:24 AM
|
0
|
0
|
1282
|
|
POST
|
Dear Forum, I want to Export a MapLayout by Click. I get a value from the click in the map (for example "housekeeper"). Now I have a sub for setting a new Textfield as MapTitle with this value like that Code found here: http://forums.esri.com/Thread.asp?c=93&f=993&t=130438. Now the code is to place a New Textfield, so when I click to export a new Map I only want to edit the TextField and not to place every time a new one. The title textfield is the only one in the pagelayout. How can I select the textelements in the pagelayout - I need a hint. thx for the help! I am unsure if you can actually add a named TextElement to the Layout (so that you can reference it specifically later on to alter the text) -- hopefully someone will show how to do this. What you can do is delete all of the existing elements and replace them --- lots of work and code, I know, but is a workaround to consider. Edit: here is a solution. Looks like you can set the name property of the textElements that you add to your Layout! http://forums.esri.com/Thread.asp?c=93&f=993&t=161720&mc=8#msgid473582
... View more
10-11-2011
06:20 AM
|
0
|
0
|
1093
|
|
POST
|
I'm in the process of converting all my ArcGIS 9.3 desktop toolbars/tools to ArcGIS 10. I have gone thru the "How to ensure that COM component category and COM interop are used in custom components" online documents. Which I implemented into code below. I also create an "SetUP" project, build solution, and installed the app using the MSI file. I started ArcMap 10, but the toolbars with the tools don't show up available toolbars. See attached file for code review. Any ideas? Genaro Garcia The City of Oklahoma City [email protected] (405) 297-3172 Try manually registering by clicking Customize-->CustomizeMode-->AddFromFile then navigate to the directory where your Setup installed the component and locate the .tlb file. Do your tools/toolbar load? If so, then it could be something simple you are missing in your registration code process.
... View more
10-11-2011
04:59 AM
|
0
|
0
|
1394
|
|
POST
|
That's it, thanks a lot! As often before, the solution is quite simple as long as you can find the right interfaces and examples. Which reminds me that the current help system, connected to the VisualStudio, usually answers everything I am NOT looking for... Excellent! tip: I get more successful searches at the old/archived forums still. http://forums.esri.com/forums.asp?c=93
... View more
10-11-2011
04:42 AM
|
0
|
0
|
3543
|
|
POST
|
I guess a queryfilter in the featurelayer would do the trick, but cannot find out how... The examples I find are related to the ArcIMS API, and I cant find similar methods here... Could you give me a hint where to start? It would look something like this:
Dim pFLayer As IFeatureLayer = pMap.Layer(0)
Dim pDefQ As IFeatureLayerDefinition
pDefQ = pFLayer
pDefQ.DefinitionExpression = "OBJECTID = " & 11420 'I just set this for testing an Integer value
'altered to query a string field
pDefQ.DefinitionExpression = "SomeStringField = '" & someStringValue & "'"
... View more
10-11-2011
03:25 AM
|
0
|
0
|
3543
|
|
POST
|
I don't know of that specific document, but there is a whole section of the Help Library dedicated geoprocessing and creating custom tools. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_custom_tools/001500000001000000/ hope this helps.
... View more
10-10-2011
09:54 AM
|
0
|
0
|
470
|
|
POST
|
I'm also experiencing some strange issues lately and one of the things that I found was that when Visual Studio creates the .msi file it is putting the step to uninstall the previous version at the end of the install sequence. So, in other words, it is installing the application then removing the previous version which results in files being missing. Using Orca I have to change the install sequence every time I rebuild the installer. I find it to be a maddening experience. As an aside, and if you are still watching this thread Neil.... What to do when someone runs an Uninstall prior to unregistering the COM component? As I mentioned in my OP, the EIT technicians are running these installation processes for the GIS department and they don't necessarily know about these COM things. I have an instance where someone ran in uninstall (via Add/Remove Programs), but now I cannot unregister the COM components with the Categories.exe Component Category Manager application. It lets me go thru the steps, but it never actually removes the reference from the list! Thanks for the input.
... View more
10-10-2011
09:22 AM
|
0
|
0
|
1054
|
|
POST
|
The layer itself is set to visible, but I am trying to hide individual features within, based on some attribute values, and even hide them the from ArcMap's selection tool. So you are invoking a DefinitionQuery on a featureLayer? The default behavior seems to be that the selected feature should not show if included in the definition query filter. Perhaps it is something specific with your code that is producing the behavior you are seeing. Post up the code you have so far.
... View more
10-10-2011
07:22 AM
|
0
|
0
|
3543
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|