最近在做一个杭州石油的项目开发一个小系统。

1.命令必须是 ICommand 的派生类

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using MapGIS.PluginEngine;
using System.Windows.Forms;
using MapGIS.Scene3D; namespace ThreeDimenModeling
{
class IsoheightModeling : ICommand
{
//应用框架对象
IApplication hock = null;
//场景视图控件
SceneControl sceneCtrl = null; #region ICommand成员 public Bitmap Bitmap
{
get { return null; }
} public string Caption
{
get { return "等高线建模"; }
} public string Category
{
get { return "ThreeDimenModeling"; }
} public bool Checked
{
get { return false; }
} public bool Enabled
{
get { return true; }
} public string Message
{
get { return ""; }
} public string Name
{
get { return "等高线建模"; }
} public string Tooltip
{
get { return ""; }
} public void OnClick()
{
sceneCtrl = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
IsoheightModelingForm IsoHeiMoForm = new IsoheightModelingForm(sceneCtrl );
if (IsoHeiMoForm.ShowDialog() != DialogResult.OK) return;
}
public void OnCreate(IApplication hook)
{
if (hook != null)
{
this.hock = hook;
this.hock.StateManager.StateChangedEvent += new StateChangedHandler(StateManager_StateChangedEvent);
}
}
void StateManager_StateChangedEvent(object sender, StateEventArgs e)
{
this.hock.PluginContainer.PluginEnable(this, false);
bool bEnable = false;
if (this.hock.ActiveContentsView != null && this.hock.ActiveContentsView is ISceneContentsView)
{
//当存在当前编辑状态的图层时,才可以进行查询
SceneControl ctr = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
if (ctr != null && ctr.GetSceneNum() > 0)
{
bEnable = true;
}
}
this.hock.PluginContainer.PluginEnable(this, bEnable);
return;
}
private void PluginContainer_ContentsViewClosingEvent(IContentsView contentsView, ContentsViewClosingEventArgs args)
{
if (contentsView is ISceneContentsView)
{
SceneControl ctr = (this.hock.ActiveContentsView as ISceneContentsView).SceneControl;
}
}
#endregion
}
}

2.弹出Form

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MapGIS.Scene3D; namespace ThreeDimenModeling
{
public partial class IsoheightModelingForm : Form
{
//场景控件
SceneControl sceneCtrl = null; public IsoheightModelingForm(SceneControl sCtrl )
{
InitializeComponent();
this.sceneCtrl = sCtrl;
}
}
}

基础的Mapgis三维二次开发-插件式的更多相关文章

  1. 【原创】MapGIS K9 三维二次开发入门

    开发语言:C# 平台版本:MapGIS K9 SP3 MapGIS K9三维平台也提供了接口和组件以实现二次开发.用户可以根据提供的接口和组件进行二次开发,也可以借助MapGISK9数据中心框架,可以 ...

  2. 金蝶K3 wise 插件二次开发与配置

    金蝶K3 wise 插件二次开发与配置 开发环境:K/3 Wise 13.0.K/3 Bos开发平台.Visual Basic 6.0 目录 一.二次开发插件编程二.代码演示三.配置插件四.测试插件五 ...

  3. 【开发者portal在线开发插件系列五】命令的响应,即命令结果的上报(mid的使用)

    基础篇 [开发者portal在线开发插件系列一]profile和基本上下行消息 [开发者portal在线开发插件系列二]多条上下行消息(messageId的使用) 基础场景见上面两个帖子,这里单独介绍 ...

  4. 四、K3 WISE 开发插件《工业单据老单插件开发新手指导》

    开发环境:K/3 Wise 13.0.K/3 Bos开发平台.Visual Basic 6.0 =============================================== 目录 一 ...

  5. PIE.NET-SDK插件式二次开发文档

    一 PIE.Net开发环境部署 1.     开发环境部署 确保Win7系统已安装SP1 安装Visual Studio2013(支持VS2010/2012/2013/2015) 安装PIESDK.e ...

  6. K/3Cloud二次开发基于WebDev附加进程调试

    大部分人在进行K/3cloud二次开发插件的调试时,选择的是附加IIS进程w3wp调试,本文给大家介绍一下基于WebDev附加进程调试,不用重启iis. 步骤如下: 1)拷贝K/3cloud产品安装目 ...

  7. Revit二次开发环境配置(Revit 2020 +Visual Studio 2019)

    Revit二次开发环境搭建(Revit 2019+Visual Studio 2017)准备内容 Revit 2019开发环境的搭建,需要安装的内容如下: Revit 2019(主要的开发环境) Vi ...

  8. 基于EasyNVR二次开发实现自己的摄像机IPC/NVR无插件化直播解决方案

    在之前的博客中<基于EasyNVR实现RTSP/Onvif监控摄像头Web无插件化直播监控>,我们已经比较多的描述EasyNVR所实现的功能,这些也在方案地址:http://www.eas ...

  9. 零基础ASP.NET Core MVC插件式开发

    零基础ASP.NET Core MVC插件式开发 一个项目随着业务模块的不断增加,系统会越来越庞大.如果参与开发的人员越多,管理起来也难度也很大.面对这样的情况,首先想到的是模块化插件式开发,根据业务 ...

随机推荐

  1. SpringMVC入门 bug集锦X2

    package cn.itcast.converter; import org.springframework.core.convert.converter.Converter; import jav ...

  2. C# 操作 Excel 文件(.xls 或 .xlsx)

    在.net中,常用的操作excel文件的方式,有三种: OLE DB的形式, 第三方框架NPOI, Office组件. 总结: 通过对比,在读取大数据量的excel文件,建议用OLE DB的形式,把e ...

  3. Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) C

    It's that time of the year, Felicity is around the corner and you can see people celebrating all aro ...

  4. Linux中/etc/passwd 和 /etc/shadows 详解

    linux操作系统上的用户如果需要登录主机,当其输入用户名和密码之后: 首先在/etc/passwd文件中查找是否有你的账号,如果没有无法登录,如果有的话将该用户的UID和GID读出来,此外将此用户的 ...

  5. 《深入理解java虚拟机》笔记(3)实战:OutOfMemoryError异常

    一.Java堆溢出 测试代码: /** * <p>Java堆异常测试</p> * <code>VM Args: -Xms20m -Xmx20m -XX:+HeapD ...

  6. opencv作业

    作业下载地址: 链接:http://pan.baidu.com/s/1qYQnbkw 密码:v7y9

  7. 图解HTTP总结

    一.TCP/IP 的分层管理 二.TCP/IP通信传输流 ARP地址解析协议参考:https://www.cnblogs.com/csguo/p/7527303.html 三.各种协议与HTTP协议的 ...

  8. It is not the destination so much as the journey, they say.

    It is not the destination so much as the journey, they say. 人家说目的地不重要,重要的是旅行的过程.<加勒比海盗>

  9. js的加密和解密

    最近在研究js的加密和解密的问题,上网上搜出来很多方法,不过不知道到底哪一个会比较管用.这里是今天找到的一些关于base64加密解密的js代码,已经经过试验,可以使用,不过网上很多加密解密的工具,这种 ...

  10. BaseAdapter获取View之三重境界

    在BaseAdapter获取View之前,BaseAdapter需要与数据源相关联. 可以使用构造方法: private List<ItemBean> baseListItems; pri ...