hexagon logo

Mark/UnMark Features Using Automation (withOUT Marked Sets)

In PCDMIS Automation, the Command Object has a "Mark" method. However, there is no "ClearMark" or "UnMark" method for a single command.

There is a "ClearMarked" method for the Commands Object. It will ClearMark all commands.  That's not really useful. I want to selectively ClearMark or UnMark single commands based on specific attributes.

I could reverse the logic and just start with a state where all commands are ClearMarked or UnMarked and then Mark them as needed.  It's just a bit frustrating.

Any suggestions?

Thanks,

-Mike (in snowy Buffalo)

Parents
  • Hi Mike, there is always the method like this that PCDMIS uses. Are you doing this in a basic script? Or using Visual Basic?

    Just change between true and false for markings. Is this sufficient? If needed, I can try to work something within PC-DMIS flow control.

    Sample of a basic scripted comment.

    Sub Main
    
    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim PartVersion As String
    
    Set DmisApp = CreateObject("PCDLRN.Application")
    Set DmisPart = DmisApp.ActivePartProgram
    Set DmisCommands = DmisPart.Commands
    Set PartVersion = DmisPart.ProgramVersionName
    
      Set DmisCommand = DmisCommands.Add(SET_COMMENT, True)
        DmisCommand.Marked = False
      ' Set Id  = 
        retval = DmisCommand.PutText ("", ID, 0)
      ' Set Comment Type  = $$
        retval = DmisCommand.SetToggleString (4, COMMENT_TYPE, 0)
      ' Set Comment Item 1 = Separator
        retval = DmisCommand.PutText (PartVersion, COMMENT_FIELD, 1)
      ' Set Report  = NO
        retval = DmisCommand.SetToggleString (1, OUTPUT_TYPE, 0)
    
    End Sub

Reply
  • Hi Mike, there is always the method like this that PCDMIS uses. Are you doing this in a basic script? Or using Visual Basic?

    Just change between true and false for markings. Is this sufficient? If needed, I can try to work something within PC-DMIS flow control.

    Sample of a basic scripted comment.

    Sub Main
    
    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim PartVersion As String
    
    Set DmisApp = CreateObject("PCDLRN.Application")
    Set DmisPart = DmisApp.ActivePartProgram
    Set DmisCommands = DmisPart.Commands
    Set PartVersion = DmisPart.ProgramVersionName
    
      Set DmisCommand = DmisCommands.Add(SET_COMMENT, True)
        DmisCommand.Marked = False
      ' Set Id  = 
        retval = DmisCommand.PutText ("", ID, 0)
      ' Set Comment Type  = $$
        retval = DmisCommand.SetToggleString (4, COMMENT_TYPE, 0)
      ' Set Comment Item 1 = Separator
        retval = DmisCommand.PutText (PartVersion, COMMENT_FIELD, 1)
      ' Set Report  = NO
        retval = DmisCommand.SetToggleString (1, OUTPUT_TYPE, 0)
    
    End Sub

Children