POST
|
Hi I was just thinking you could create a dockable window that the user can hide/show when they want to, similar I suppose to a toolbar but it gives you a bit more flexibility with regards to what you can put on it. It might not be exaclty what you want but could be a fall-back position if you can't get the dynamic commands to work for you. Andy
... View more
08-19-2010
11:43 PM
|
0
|
0
|
95
|
POST
|
I think Neil is correct (see http://forums.arcgis.com/threads/11252-Creating-a-command-dynamially-at-run-time), you can't create commands dynamically at runtime. You can add them at runtime but I think you still need to have created them before. Why do you need to have your commands on a toolbar? Could you instead create a window and dynamically create menus and tools on there for the user? This should be a lot simpler (i.e. you avoid all the difficulties you're having with command/toolbars/menus/etc) and still give your users a dynamically created list of commands. Hope this helps.
... View more
08-19-2010
06:31 AM
|
0
|
0
|
566
|
POST
|
Hi Glad I've been able to help. All the methods you need to implement are in the link in my post above. So you need to implement the method IFeatureProgress::IsCancelled and return false instead of the line mpChkOutIsCancelled = New IFeatureProgress_get_IsCancelledEventHandler(Addre ssOf GetCheckoutIsCancelled)
... View more
08-19-2010
05:30 AM
|
0
|
0
|
195
|
POST
|
I assume you mean you've created a class implementing the ICommand interface. If so, you need to put your enable/disable logic in the ICommand::Enabled method. Return true to enable the command and false to disable it. You'll need something like the following: Dim pActiveView as IActiveView pActiveView = pMxDoc.ActiveView If Typeof pActiveView Is IMap Then ' Map object return true Else ' PageLayout object return false End If
... View more
08-19-2010
12:49 AM
|
0
|
0
|
152
|
POST
|
There's an example in C# of how to use the IFeatureProgress interface here: http://resources.arcgis.com/content/kbase?fa=articleShow&d=34908 Basically you need to create a class which implements this interface. Then the following methods are the ones you're interested in: IFeatureProgress::FeatureClassName - IFeatureProgress_set_FeatureClassNameEventHandler IFeatureProgress::MaxFeatures- IFeatureProgress_set_MaxFeaturesEventHandler IFeatureProgress::FeatureClassName - IFeatureProgress_set_StepValueEventHandler IFeatureProgress::StepValue- IFeatureProgress_StepEventHandler Hope this helps.
... View more
08-19-2010
12:05 AM
|
0
|
0
|
195
|
POST
|
Here's a VBA example which does what you want: http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#/How_to_convert_labels_to_standard_annotation/0001000000m8000000/ I'm not sure whether you can use this or not, or how you interface with your Python script, but it uses the IConvertLabelsToAnnotation interface. Hope this helps.
... View more
08-18-2010
04:38 AM
|
0
|
0
|
677
|
POST
|
Hi The link from Nir's reply above seems to have a decent c# example. What problem are you having getting this to do what you want?
public static void CreateFeature(IFeatureClass featureClass, IPolyline polyline)
{
// Build the feature.
IFeature feature = featureClass.CreateFeature();
feature.Shape = polyline;
// Apply the appropriate subtype to the feature.
ISubtypes subtypes = (ISubtypes)featureClass;
IRowSubtypes rowSubtypes = (IRowSubtypes)feature;
if (subtypes.HasSubtype)
{
// In this example, the value of 3 represents the PVC subtype.
rowSubtypes.SubtypeCode = 3;
}
// Initialize any default values the feature has.
rowSubtypes.InitDefaultValues();
// Update the value on a string field that indicates who installed the feature.
int contractorFieldIndex = featureClass.FindField("CONTRACTOR");
feature.set_Value(contractorFieldIndex, "K Johnston");
// Commit the new feature to the geodatabase.
feature.Store();
}
... View more
08-18-2010
12:18 AM
|
0
|
0
|
641
|
POST
|
Try ITemplates templates = application.Templates; return templates.get_Item(templates.Count - 1); The reason you are getting null values with the examples you've given is that you're trying to cast to IMapDocument but the objects implement the IDocument interface. i.e. IDocument mapDoc = m_application.Document as IDocument; should not be null (unless m_application is null or you've not loaded a document)
... View more
08-17-2010
12:14 AM
|
0
|
0
|
295
|
POST
|
Hi Apparently notes are not yet supported in arcgis for iOS which is why they don't appear. I believe it's something that's being worked on but I'm not sure when it might be available though.
... View more
08-14-2010
11:05 AM
|
0
|
0
|
206
|
POST
|
To delete from the registry would seem to be the only way to do it if you've got a large number of machines. Shame there doesn't seem to be any inbuilt support for doing this. It's all too easy to get things into categories, but if you're not careful you can easily end up with a lot of garbage in there.
... View more
08-12-2010
04:28 AM
|
0
|
0
|
5391
|
POST
|
I think unregistering the DLLs will still leave entries in the categories, so you'll still have some work to do to clean everything up. I've had a quick look before on how to do this programmatically but never managed to work it out so always ended up doing it manually.
... View more
08-11-2010
01:25 PM
|
0
|
0
|
5391
|
POST
|
Hi Scott Thought I'd replied to this the other day but it seems to have vanished... The Application object will change, for example IApplication::Document will change when you open a new mxd. Though admittedly most of the properties do stay the same. Also you can have multiple instance of Arc running at one time so you could potentially have references to both of these applications, for example if you want to check if another instance is running or not. As for singleton classes...that's probably a discussion for another day but I think you'll find plenty of people who think they're best avoided. Hope this helps
... View more
08-11-2010
01:55 AM
|
0
|
0
|
165
|
POST
|
Hi Carlos I've a nagging feeling I've missed something in your question...but I would have thought you could use IMenuDef to achieve what you want. You must know how many menus you have at runtime but not at design time. Then IMenuDef::ItemCount would call the database and count the number of items you want to show. Similarly IMenuDef::GetItemInfo will return all the items you want to show, again generated from the database. You might find this is quite slow as the methods in IMenuDef can get called quite regularly so you may find it's better to generate your menus once on startup rather than each time you click a menu. Another approach is to create an extension which adds items to your toolbar and menus on startup. I've done this before but can't remember off the top of my head exactly what methods I used. I'll post details if it comes back to me. Hope this helps.
... View more
08-11-2010
01:05 AM
|
0
|
0
|
179
|
POST
|
It seems that the ITopologicalOperator5 interface is implemented on the Polyline class and not the Polygon class, whereas ITopologicalOperator4 is implemented on the Polygon class. I'm not sure whether the documentation is correct as it seems a bit odd, and it does recommend using ITopologicalOperator5 instead of ITopologicalOperator4. Might be worth casting to ITopologicalOperator4 instead though and see if that makes any difference. See http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriGeometry/ITopologicalOperator4.htm and http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriGeometry/ITopologicalOperator5.htm
... View more
08-10-2010
06:23 AM
|
0
|
0
|
290
|
POST
|
Hi It might be useful if you could tell us how far you've got with this problem - and which bits you're stuck on. Are you writing a tool in ArcDesktop or a stand-alone application and what language are you using? Regards
... View more
08-10-2010
01:51 AM
|
0
|
0
|
101
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|