Attempts to produce a list of all available classes and methods available in the current Ruby instance.
Currently does not retrieve methods of Object class and it's ancestors (e.g. BasicObject) - Perhaps this should be added
| Alter Table S104 (Add CAB Logical, KST Logical, PLT Logical) | |
| select * from S104 where Adoption_Date <> "" into qNoBlank | |
| select * from qNoBlank where Adoption_Date < CurDate() into qCAB | |
| select * from qNoBlank where Adoption_Date >= CurDate() into qKST1 | |
| select * from S104 where Adoption_Date = "" into qBlank | |
| select * from qBlank where Date_Confirmation < CurDate() or dwellings(DWF_Total_m3_per_sec) < 50 into qKST2 | |
| select * from qBlank where Date_Confirmation > CurDate() and dwellings(DWF_Total_m3_per_sec) >= 50 into qPLT |
| def proxy__enwrap(obj) | |
| isClass = obj.is_a?(Class) | |
| oldClass = isClass ? obj : obj.class | |
| sNewClass = "Proxy#{oldClass.to_s}" | |
| code = <<-EOF | |
| class #{sNewClass} | |
| include InstanceProxy | |
| def self.__cinit__(obj) | |
| @@__cobj__ = obj | |
| end |
Test
| At C:\Users\sancarn\AppData\Local\Temp\script.ps1:20 char:20 | |
| + $parent = [System.Windows.Forms.TreeNode]$global:database.Ite ... | |
| + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| Unable to find type [System.Windows.Forms.TreeNode]. | |
| At C:\Users\sancarn\AppData\Local\Temp\script.ps1:27 char:36 | |
| + ... [void]$node.nodes.add([System.Windows.Forms.TreeNode]::new(" ... | |
| + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| Unable to find type [System.Windows.Forms.TreeNode]. | |
| At C:\Users\sancarn\AppData\Local\Temp\script.ps1:33 char:45 | |
| + ... PSCustomObject]IWDBGetChildren([System.Windows.Forms.TreeNode]$node) ... |
| SetTimer, ActivityWatcher, 150 | |
| return | |
| ActivityWatcher: | |
| if !CurrentTitle | |
| { | |
| WinGetTitle, CurrentTitle, A | |
| QPC(1) | |
| } | |
| Time taken: 23.347s (response = 535 model objects, ran immediately after opening Database) | |
| t1 = Time.now | |
| $dbListPaths="" | |
| def walk(moc) | |
| moc.each do |mo| | |
| $dbListPaths += mo.path + "\n" | |
| walk(mo.children) | |
| end | |
| end |
Ever since I found the ruby scripting language been using it to extend existing functionality in ICM. However one thing which has struck me time and time again is the, almost, half-baked method of executing ruby scripts.
There are 4 options to execute a ruby scripts:
Ever since I started working with ICM, I have been tasked with automating aspects of it. I started my journey with knowing nothing about ICM, Ruby scripting, or even SQLs for that matter. Initially I automated ICM like I automate most applications, using low-level Windows APIs.
https://www.youtube.com/watch?v=zHVeZP6DQ2Q
I still remember having a conversation with an Innovyze support employee, while I was reporting a 'bug' where a dialog button wasn't being 'clicked' when I used PostMessage, but was only if I used SendMessage... In the end though, it wasn't really a bug, but myself misunderstanding which windows messages are used for which purposes.
Gradually over the years I have built up my knowledge of how ICM works and how to automate each aspect of it. Whether that be autonymously creating, setting up and running sims, finding and performing actions on database model objects, exporting a number of model networks, or using Ruby scripting to perform detailed analysis o
In InfoWorks ICM intermediate users may use SQL queries to automate their workflows. One part of the SQL system in InfoWorks which is fairly misunderstood is the macro system.
To be fair, macros aren't really explained very well in the help file either... The explanation given is as follows:
Macros are variables for representing values within a query. The Macro dialog is displayed when you click on either the button or the button on the User Macros tab on the SQL dialog. Enter a title and value for the macro, then click on OK.
Though this is correct, it is also a bit misleading. In this article I want to go into a little more detail as to what the Macro system actually does, and bounce around some ideas as to how it can be used.