Read out marked set in a variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read out marked set in a variable

    Hi All,

    Is it possible to read out which marked set is used and place it in a variable?

  • #2
    Not that I know of. I have a variable inside each program called markedsetname and for each marked set I set it equal to the marked set name. Then I mark the correct variable with the value that matches the marked set, for each marked set.
    Example:
    markedsetname="RUN"
    markedsetname="OP20"
    markedsetname="SORT"
    Then mark the RUN variable for the RUN marked set, and so on.

    Comment


    • #3
      We need the same for our company. We want to do this by coding a subroutine so we won't have to adjust all programs (±800) with all kinds of marked sets (mostly 3-4 per program).

      Comment


      • #4
        Sounds like a handy enhancement if pcdmis does not currently have a way for the user to access this information either via an expression or basic.

        Comment


        • #5
          In theory it looks possible to get the ms name with a Basic script, functions GetExecutionMarkedSetIndex and GetMarkedSetName(Index, markedSetName), but I haven't tried them, just searched the type library.

          AndersI
          SW support - Hexagon Metrology Nordic AB

          Comment


          • #6
            Hello everybody

            The topic very interesting we would like to use the same in our company. Topic is: Marked set naming read as variable. Unfortunately, I have no experience with basic programming. Does anyone feel called to accept this challenge?

            Many thanks

            Comment


            • #7
              I have worked on the code, but can't get the GetExecutionMarkedSetIndex function work. It always shows the -1 value for the current execution marked set. Perhaps anyone knows how to solve this?

              Code:
              Sub Main
              
              Dim PP As Object
              Dim markedSetNameOut As String
              Dim markedSetIndexCounter As Long
              ''Dim GetExecutionMarkedSetIndex As Long
              Dim currentMarkedSetIndex As Long
              
              Set Pcdmis = Nothing
              Set Pcdmis = GetObject("", "PCDLRN.Application")
              Set PP = Pcdmis.ActivePartProgram
              
              currentMarkedSetIndex = PP.GetExecutionMarkedSetIndex()
              
              If (PP.GetMarkedSetName(markedSetIndexCounter, markedSetNameOut) = -1) Then
              
              MsgBox "True - " & markedSetNarmeOut
              
              Else
              
              MsgBox "False - There is no marked Set For the passed index"
              
              End If
              
              End Sub

              Comment


              • #8
                It may only be valid if you have started the marked set execution via automation.

                Comment

                Related Topics

                Collapse

                Working...
                X