Ejemplo n.º 1
0
 def compileAndLoad(self, name, filename, *args):
     import clr
     sys.path.append(sys.exec_prefix)
     self.assertEqual(
         self.run_csc("/nologo /t:library " + ' '.join(args) + " /out:\"" +
                      os.path.join(sys.exec_prefix, name + ".dll") +
                      "\" \"" + filename + "\""), 0)
     return clr.LoadAssemblyFromFile(name)
Ejemplo n.º 2
0
def compileAndLoad(name, filename, *args):
    import clr
    sys.path.append(sys.exec_prefix)
    AreEqual(
        run_csc("/nologo /t:library " + ' '.join(args) + " /out:\"" +
                sys.exec_prefix + "\"\\" + name + ".dll \"" + filename + "\""),
        0)
    return clr.LoadAssemblyFromFile(name)
Ejemplo n.º 3
0
# Copyright (C) 2016 iS3 Software Foundation
# Author: Xiaojun Li
# Contact: [email protected]

import sys
import clr
sys.path.append('extensions')
monlib = clr.LoadAssemblyFromFile('IS3.Monitoring.dll')
clr.AddReference(monlib)
from IS3.Monitoring import (MonitoringHelper, MonPoint, MonGroup, MonReading)
Ejemplo n.º 4
0
import sys
import clr


IS3Core = clr.LoadAssemblyFromFile('IS3.Core.dll')
clr.AddReference(IS3Core)
from IS3.Core import (IS3Global, IS3Runtime, ErrorReport, ErrorReportTarget,
                      DGObject, DGObjectType, DGObjectState, DGObjects,
                      ProjectDefinition, Project,
                      Domain, DomainType)

runtime=IS3Runtime
runtime.Initialize()

def output(text):
    print text

ErrorReport.target = ErrorReportTarget.DelegateConsole
ErrorReport.consoleDelegate = output

def LoadGeoData():
    dbContext.Open()
    geo.LoadAllObjects(dbContext)
    dbContext.Close()

def LoadStrData():
    dbContext.Open()
    struct.LoadAllObjects(dbContext)
    dbContext.Close()

Ejemplo n.º 5
0
# Copyright (C) 2015 iS3 Software Foundation
# Author: Xiaojun Li
# Contact: [email protected]

import sys
import clr
import System

# Load System.Windows.Media in PresentationCore.dll
sys.path.append(
    'C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5'
)
prcore = clr.LoadAssemblyFromFile('PresentationCore.dll')
clr.AddReference(prcore)
# Import classes in System
from System import Func, Action
from System.Windows.Media import Colors
from System.Collections.ObjectModel import ObservableCollection
from System.Threading.Tasks import Task

# Load iS3 namespaces
iS3Core = clr.LoadAssemblyFromFile('iS3.Core.dll')
clr.AddReference(iS3Core)
# Import classes in iS3
from iS3.Core import (Globals, Runtime, ErrorReport, ErrorReportTarget,
                      DGObject, DGObjects, ProjectDefinition, Project,
                      EngineeringMap, EngineeringMapType, DrawShapeType, IView,
                      LayerDef, Domain, DomainType, ToolTreeItem)
from iS3.Core.Geometry import *
from iS3.Core.Graphics import *
Ejemplo n.º 6
0
# Copyright (C) 2015 IS3 Software Foundation
# Author: Xiaojun Li
# Contact: [email protected]

import clr

arcgis = clr.LoadAssemblyFromFile('Esri.ArcGISRuntime.dll')
clr.AddReference(arcgis)

from Esri.ArcGISRuntime.Data import Geodatabase


def gdbFileInfo(file):
    # get information about a geodatabase file
    gdb = Geodatabase.OpenAsync(file)
    gdb = gdb.Result
    print("--- layers, geometryType, rowCount ---")
    for table in gdb.FeatureTables:
        print(table.Name, table.GeometryType, table.RowCount)