PC-DMIS 2021.2 Object Library
GetMarkedSetName Method
See Also  Example  Send Topic Feedback | See Object Hierarchy Chart
index

This determines the index value to use.

For example, if your routine has three marked sets, 0 indentifies the first set, 1 identifies the second set, and 2 identifies the third set.

markedSetName
This is a string variable that you can use to store the returned marked set name.
PCDLRN ActiveX DLL > PartProgram Object : GetMarkedSetName Method

Glossary Item Box

Description

This returns a True (-1) or False (0) to identify whether there's a defined marked set for the passed index value.

Syntax

Visual Basic
Public Function GetMarkedSetName( _
   ByVal index As Long, _
   ByRef markedSetName As String _
) As Long

Parameters

index

This determines the index value to use.

For example, if your routine has three marked sets, 0 indentifies the first set, 1 identifies the second set, and 2 identifies the third set.

markedSetName
This is a string variable that you can use to store the returned marked set name.

Return Type

This returns a long value that signifies True (-1) or False. (0). 

Be aware that in this case, when a Boolean value is converted to a numeric type, True is -1 and False is 0.

Example

Suppose your routine has three marked sets named "test1", "test2", and "test3". The example below passes 1 as the index. This returns a -1 value (True) and then stores the name of the second marked set in markedSetNameOut. The message box says, "True - test2".

If you pass an index value for a set that doesn't exist, this returns 0 (False).

Example (Visual Basic)Copy Code
Sub Main

    Dim PP As Object
    Dim markedSetNameOut As String
    Dim markedSetIndexCounter As Long

    Set Pcdmis = Nothing
    Set Pcdmis = GetObject("", "PCDLRN.Application")
    Set PP = Pcdmis.ActivePartProgram
    
    markedSetIndexCounter = 1
     

If (PP.GetMarkedSetName(markedSetIndexCounter, markedSetNameOut) = -1) Then

  MsgBox "True - " & markedSetNameOut
  
Else

  MsgBox "False - There is no marked Set For the passed index"

End If

End Sub

See Also

Copyright © 2021. Hexagon Manufacturing Intelligence – Metrology Software, Inc. All Rights Reserved.