hexagon logo

Excel VBA .add BASIC_SCRIPT modifiers

Hello

I am trying to use excel vba to add a script to the end of all the programs in a directory. I am stuck on the DmisCommands.Add(BASIC_SCRIPT, True).

Is there a modifier to specify the function/ and a modifier to add ARGs? And if possible where can I look up this information?

Set DmisCommand = DmisCommands.Add(BASIC_SCRIPT, True)
DmisCommand.Marked = True
DmisCommand.ID = "CS998"
retval = DmisCommand.PutText("C:\PC-DMIS\MKDIR.BAS", FILE_NAME, 1)
  • Found that retval = DmisCommand.PutText("SAVELOC", SRC_EXPR, 0) will take care of the args. Just need to figure out the function/
  • Found the correct one for function retval = DmisCommand.PutText("", SUB_NAME, 0)
  • good day,
    iam not shure how relevant this is now, but here you go

    Sub Test
      Dim DmisApp As Object
      Dim DmisPart As Object
      Dim DmisCommands As Object
      Dim DmisCommand As Object
    
      Set DmisApp = CreateObject("PCDLRN.Application")
      Set DmisPart = DmisApp.ActivePartProgram
      Set DmisCommands = DmisPart.Commands
      CommandCount = DmisCommands.Count
      Set DmisCommand = DmisCommands.Item(CommandCount)
      DmisCommands.InsertionPointAfter DmisCommand
    
    
      Set DmisCommand = DmisCommands.Add(BASIC_SCRIPT, True)
      DmisCommand.Marked = False
      retval = DmisCommand.PutText ("CS1", ID, 0)   'Name of command In pcDMIS
      retval = DmisCommand.PutText ("C:\USERS\QS\DESKTOP\TEST.BAS", FILE_NAME, 0)   'path To .bas file
      retval = DmisCommand.PutText ("Main", SUB_NAME, 0)   'name of sub
      retval = DmisCommand.SetToggleString (2, SHOW_DETAILS, 0)
    
    
      DmisPart.RefreshPart
    End Sub
    
  • Hmm. Interesting. However, it doesn't seem to work when I import the cls file from the VBA editor. Am I doing something wrong? I want to add a custom collection class that will be a wrapper of the built-in collection class. I understand that if you do not attach attribute modifiers, the Item property will not be the default property, and you will lose the ability For Each/Next in the collection. I started to deal with this when I started to read more one of the interesting sources of information related to this.
  • Here's a snippet as well:

    ScriptPath = "C:\PROGRAM FILES\JOTUBE2\PCDMIS\FEATUREEXPORT.BAS"
    Subname = "ExportAsJoWin"
    destfile = PCDPartProgram.Path & "TUBE.TXT"
    
    Set PCDCommand = PCDCommands.Add (BASIC_SCRIPT, True)
    PCDCommand.Marked = True
    retval = PCDCommand.PutText (ScriptPath, FILE_NAME, 0)
    retval = PCDCommand.PutText (Subname, SUB_NAME, 0)
    retval = PCDCommand.PutText ("ARG1", DEST_EXPR, 1)
    retval = PCDCommand.PutText ("""" & destfile & """", SRC_EXPR, 1)
    retval = PCDCommand.SetToggleString (2, SHOW_DETAILS, 0)
    
    PCDCommand.ReDraw