UID uid = new UIDClass(); uid.Value = "esriEditor.Editor"; IExtension Extension = ArcMap.Application.FindExtensionByCLSID(uid); IEditor m_editor = Extension as IEditor; IExtension Editor_Extension; UID attributeuID = new UIDClass(); attributeuID.Value = "esriEditor.AttrWindow"; Editor_Extension = m_editor.FindExtension(attributeuID) as IExtension;
It seems to have worked, yes ... with my custom Editor Extension.So, the conclusion is that you do need to 'find' this editor extension, by 'finding' it from the Editor Object then, not the Application Object ?Also, earlier I did actually try something similar to what you provided .. but it didn't work ........ but I had been calling Editor.FindExtensionByCLSID rather than just Editor.FindExtension ?So the method name is also different between Application Object and Editor Object ?Anyways, thanks so much !It appears to be working this way ... by getting reference to Editor Object and then using FindExtension.
So, am I suppose to try to find my custom editor extension in a similar manner ?
Thanks for the response.The Editor Extension I'm trying to 'find' is a custom extension created previously.I have double-checked the ProgId value. When tracing, I believe the u.value gets the ClassID value, and it appears correct, yes.#End Region
Have you tried passing in the GUID the value property of the uid object instead of the name of the extension? I always find the GUID easier to deal with. The guid is the classid of the class, you need to put it between {} brackets.
Have you checked the class id for your editor extension? Does the string you use for the u.Value have the right value. You can use either the extension name or the UID string for the u.Value. For example: UID uid = new UIDClass(); // uid.Value = "{F8842F20-BB23-11D0-802B-0000F8037368}"; uid.Value = "esriEditor.Editor"; IExtension Extension = m_application.FindExtensionByCLSID(uid);BTW, you can find the these two values in the Component Category Manager (see attached image).
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.