操作系统:win10 x64
代码:
using SuperMap.Data;
using SuperMap.UI;
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;
namespace WindowsFormsApplication31
{
public partial class Form1 : Form
{
SceneControl scon;
Workspace ws;
public Form1()
{
InitializeComponent();
init();
}
void init()
{
scon = new SceneControl();
scon.Dock = DockStyle.Fill;
this.Controls.Add(scon);
string wsPath = @"D:\桂林理工大学地下管网管理系统\桂林理工大学20170813新改\桂林理工地上建模.smwu";
ws = new Workspace();
WorkspaceConnectionInfo wsCon = new WorkspaceConnectionInfo()
{
Server = wsPath,
Type = WorkspaceType.SMWU
};
ws.Open(wsCon);
scon.Scene.Workspace = ws;
scon.Scene.Open(ws.Scenes[0]);
//scon.Scene.EnsureVisible(scon.Scene.Layers[0]);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}