• 大小: 650KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-13
  • 语言: C#
  • 标签: skyline  c#  

资源简介

官网有的例子,这个里面都有,功能都可以用,适合初学者观摩。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TerraExplorerX;
using System.IO;
using System.Reflection;

using System.Collections;
namespace f3
{
    public partial class Form1 : Form
    {   //定义变量
        SGWorld66 sgworld = null;
        double time = DateTime.Now.Millisecond;
        IPosition66 pos;
        IPosition66 coordHancock = null;
        ITerrainModel66 model = null;  
        IPosition66 coord1 = null;
        IPosition66 coord2 = null;
        ITerrainLabel66 labelF16 = null;
        double distance = 0;
        IPosition66 angles = null;
        IPopupMessage66 popup = null;
        IPosition66 modelPos = null;
        ITerraExplorerMessage66 msg = null;
        IColor66 b = null;
        ILineString a = null;
        public Form1()
        {   InitializeComponent();
        //变量sgworld实例化
            this.sgworld = new SGWorld66();
          
        }

        public void 打开文件ToolStripMenuItem_Click(object sender EventArgs e)
        {
            
            //打开浏览文件
            OpenFileDialog fileDialog = new OpenFileDialog();
            string file = fileDialog.FileName;
            string tAppRoot = Path.GetDirectoryName(Application.ExecutablePath);
            //获取文件路径
            string str = Path.Combine(@““ + file);
            bool bIsAsync = false;
            string tMsg = String.Empty;
            string tUser = String.Empty;
            string tPassword = String.Empty;
            try
            {
                sgworld.onloadFinished += new _ISGWorld66Events_onloadFinishedEventHandler(OnProjectLoadFinished);
                //打开文件
                sgworld.Project.Open(str bIsAsync tUser tPassword);
                MessageBox.Show(“Opening project “ + str + “ in async mode“);
            }
            catch (Exception ex)
            {
                tMsg = String.Format(“OpenProjectButton_Click Exception: {0}“ ex.Message);
                MessageBox.Show(tMsg);
            }
        }
        void OnProjectLoadFinished(bool bSuccess)
        {
            string tMsg = String.Empty;
            try
            {
                MessageBox.Show(“Received project loaded event: “ + ((bSuccess) ? “Success“ : “Failure“));
            }
            catch (Exception ex)
            {
                tMsg = String.Format(“OnProjectLoadFinished Exception: {0}“ ex.Message);
                MessageBox.Show(tMsg);
            }
        }
        private void 距离与角度ToolStripMenuItem_Click(object sender EventArgs e)
        {   //创建两个坐标点
            coord1 = sgworld.Creator.CreatePosition(-71.07542 42.34930 232.0);          
            coord2 = sgworld.Creator.CreatePosition(-71.05507 42.35561 105.0); 
            //数组
            double[] vec = { -71.07542 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         187  2018-12-19 11:40  f3\App.config
     目录           0  2018-12-19 13:07  f3\bin\
     目录           0  2018-12-19 13:07  f3\bin\Debug\
     文件       17408  2018-12-19 11:40  f3\bin\Debug\AxInterop.TerraExplorerX.dll
     文件       72704  2018-12-28 15:29  f3\bin\Debug\f3.exe
     文件         187  2018-12-19 11:40  f3\bin\Debug\f3.exe.config
     文件       87552  2018-12-28 15:29  f3\bin\Debug\f3.pdb
     文件       23168  2018-12-28 15:30  f3\bin\Debug\f3.vshost.exe
     文件         187  2018-12-19 11:40  f3\bin\Debug\f3.vshost.exe.config
     文件         490  2017-04-11 11:11  f3\bin\Debug\f3.vshost.exe.manifest
     文件      982528  2018-12-19 11:43  f3\bin\Debug\Interop.TerraExplorerX.dll
     文件        5601  2018-12-19 11:40  f3\f3.csproj
     文件       86125  2018-12-28 15:29  f3\Form1.cs
     文件       53824  2018-12-19 13:47  f3\Form1.Designer.cs
     文件        8026  2018-12-19 13:47  f3\Form1.resx
     目录           0  2018-12-19 13:07  f3\obj\
     目录           0  2018-12-28 15:29  f3\obj\Debug\
     文件       17408  2018-12-19 11:40  f3\obj\Debug\AxInterop.TerraExplorerX.dll
     文件       25352  2018-12-27 14:56  f3\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        8686  2018-12-27 14:48  f3\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件       11781  2018-12-28 15:30  f3\obj\Debug\f3.csproj.FileListAbsolute.txt
     文件         977  2018-12-19 13:47  f3\obj\Debug\f3.csproj.GenerateResource.Cache
     文件         946  2018-12-19 11:43  f3\obj\Debug\f3.csproj.ResolveComReference.cache
     文件        3466  2018-12-19 11:40  f3\obj\Debug\f3.csprojResolveAssemblyReference.cache
     文件       72704  2018-12-28 15:29  f3\obj\Debug\f3.exe
     文件        1303  2018-12-19 13:47  f3\obj\Debug\f3.Form1.resources
     文件       87552  2018-12-28 15:29  f3\obj\Debug\f3.pdb
     文件         180  2018-12-19 11:43  f3\obj\Debug\f3.Properties.Resources.resources
     文件        3584  2018-12-19 11:43  f3\obj\Debug\Interop.TerraExplorer.dll
     文件      982528  2018-12-19 11:43  f3\obj\Debug\Interop.TerraExplorerX.dll
     文件           0  2018-12-19 11:40  f3\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
............此处省略13个文件信息

评论

共有 条评论