hexagon logo

Settogglestring

Hello all,
Is there some documentation on the settogglestring method.
I am curious about the parameter values and how to set them
accordingly.
Thanks in advance for any help or info.
Parents
  • Hello all,
    Is there some documentation on the settogglestring method.
    I am curious about the parameter values and how to set them
    accordingly.
    Thanks in advance for any help or info.


    Hi all. I'm sure you've stumbled across this by now, but for others coming to the thread, here's the SetToogleString method's help topic from the 2021.2 help:
    https://docs.hexagonmi.com/pcdmis/2021.2/en/helpcenter/mergedProjects/automationobjects/PCDLRN~Command~SetToggleString.html
    (After the long table of data types, there's an example at the bottom that may help you figure something out.)

    But I'm not entirely clear what you're trying to do exactly. Are you trying to create a dimension dynamically showing only the T-value? If so, this code from an exported Location dimension with just the T-value axis does that. I put it into a single subroutine:

    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim DmisCommands As Object
    Dim DmisCommand As Object
    
    Sub Main
    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(DIMENSION_START_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = LOC1
    retval = DmisCommand.PutText ("LOC1", ID, 0)
    ' Set Reference Id = CIR1
    retval = DmisCommand.PutText ("CIR1", REF_ID, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Arrow Density = 100
    retval = DmisCommand.PutText ("100", ARROW_DENSITY, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Unit Type = MM
    retval = DmisCommand.SetToggleString (2, UNIT_TYPE, 0)
    ' Set Standard Deviation = 0.000000
    retval = DmisCommand.PutText ("0.000000", STANDARD_DEVIATION, 0)
    ' Set Half Angle = NO
    retval = DmisCommand.SetToggleString (1, DIM_HALF_ANGLE, 0)
    
    Set DmisCommand = DmisCommands.Add(DIMENSION_T_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Axis = T
    retval = DmisCommand.PutText ("T", AXIS, 0)
    ' Set Output to Report = YES
    retval = DmisCommand.SetToggleString (2, OUTPUT_TO_REPORT, 0)
    
    Set DmisCommand = DmisCommands.Add(DIMENSION_END_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    DmisPart.RefreshPart
    End Sub
    

  • he wants to inside a "DIMENSION_INFORMATION"-Command with Basic-Script.
    the problem is that the "Icon"-Tooglebox can't be toogled off with Basic-Script
    because no one knows the right keyword for this action.
    And "export as Basic" let this line blank, that seems to be a bug.

    i hope i didnt miss something Slight smile
Reply Children
No Data