realkinglion
路人甲
路人甲
  • 注册日期2016-04-30
  • 发帖数9
  • QQ
  • 铜币13枚
  • 威望4点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
阅读:1668回复:0

无法获取Scene的IApplication,求助。。。

楼主#
更多 发布于:2017-05-30 21:01
需要在SceneControl中添加 Select By Draped Envelope 拖框选择功能,查了下,需要使用Icommandbar等等
Command Select By Draped Envelope Viewer_SelectFeatures Viewer {4860B006-4515-4436-9079-D83350E1AAA7}

esriArcScene.SxDrapedEnvelopeSelectFeaturesTool

但是涉及到需要Document对象,得从IApplication获取,而尝试了N久,都无法获取,在OnCreate(object Hook),
使用 Hook as IApplication 也无济于事



 public void OnCreate(object Hook)
    {
      if (Hook == null) return;
      try
      {
        m_hookHelper = new HookHelper();
        m_hookHelper.Hook = Hook;
        m_app = Hook as IApplication;
        if (m_hookHelper.ActiveView == null)
          m_hookHelper = null;
      }
      catch
      {
        m_hookHelper = null;
      }


      if (m_hookHelper == null)
        bEnable = false;
      else
        bEnable = true;
    }

AE 版本10.1
喜欢0 评分0
游客

返回顶部