hexagon logo

Is there anything like running macros in PC-DMIS???

I was just wondering if there was any way I could automate certain tasks while I'm in a program. 

Easy example, I'm converting a group of programs to go from legacy to geotol and it would be great to delete all the analysis views in the program by clicking a button. (That way, as I go through and replace all the legacy dimensions with geotol dimensions, I don't have to delete and re-add, I could just add. 

I know you have vbscripting but that seems to be more designed to run when the program runs, not what I'm talking about....

  • You can attach a vb script to a toolbar icon and it will function like your own customized command.  In your case, the script would iterate through the routine looking for (and removing) analysis view commands.

    Dim PCDapp As Object
    Dim PPs As Object
    Dim PP As Object
    Dim Cmds As Object
    Dim Cmd As Object
    Dim NewName As String
    Dim  ExistingSchema As Long
    
    Sub Main (DimName As String, SegNum As Integer,DatNum As Integer, DatFeatNum As Integer)
      Set PCDapp=createObject("PCDLRN.Application")
      Set PP=PCDapp.ActivePartProgram
      Set Cmds=PP.Commands
    
      For Each Cmd In Cmds
        If Cmd.Type = 176 Then ' 176 = Analysis View
          Cmd.remove
        End If
      Next Cmd
    
      PP.RefreshPart
    
      Set Cmd = Nothing
      Set Cmds = Nothing
      Set PP = Nothing
      Set PCDApp = Nothing
    End Sub
    

    1) Copy that code into the PC-DMIS basic script editor window and save it to your PC.

    2) Add a custom menu item : PC-DMIS Help Center - 2023.1 (hexagonmi.com) that points to the file (.bas extension)

    3) Create a custom toolbar icon for the new menu item: PC-DMIS Help Center - 2023.1 (hexagonmi.com)