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.
  • hm
    do you want the "T" value for output .. like msgbox "T-Value"
    or do you want to inside the T-Value in an existing Dimensions Command ?

    I'm wondering what you're trying to achieve Slight smile
  • I tried to turn off the icon and failed, you're right

    the toggle box for "Icon" is obviously not exported as Basic. That seems to be a bug.
    Furthermore, it is not documented with which keyword "Icon" is toggled
  • there must be another way to achieve that.any one?
  • 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
  • thanks for your reply.
    further more,i need the DIMENSION_INFORMATION command to show the evaluate information without icon
  • For the icon on use this

    ' Set Show Ids Item 1 = ICON
    retval = DmisCommand.SetToggleString (1, SHOW_IDS, 1)


    For the icon off use this

    ' Set Show Ids Item 1 =
    retval = DmisCommand.SetToggleString (6, SHOW_IDS, 1)


    Why it's '6' I have no idea.


    Handy little trick for this type thing btw.

    1) Get notepad++ (if you haven't yet)
    2) From plugins menu select Plugins Admin and search for and install 'Compare'
    3) From PCDMIS export the .bas with the option in question set one way, and then the other
    4) Open both files in notepad++ and from the plugins menu select compare, then compare