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.
  • 1. Object Library reference materials: Went to Wilcox site, looked for reference manuals,
    http://www.wilcoxassoc.com/downloads...umentation.php
    Starting with version 4.0 (I think it was), they include a Basic programming reference with every supported version, which has an extensive Object Library reference

    I tried this link but it didn't work.
    I couldn't find anything in the Basic Language Help file when you hit F1.
    Found the SetToggleString method in the Object Library, but no explanation
    for the parameter values.

    Here is a snippet of code for the script
    I've been using to output diminfo for out
    of tolerance vector points.
    I only want the "T" value displayed.
    No headings, icons etc.

    delimpos = instr(1,CMDline,"OOT")

    If delimpos = 1 then

    Set Cmd = Cmds.Add(DIMENSION_INFORMATION, TRUE)

    Cmd.PutText Dimname, REF_ID, 0

    Cmd.SetToggleString 6, SHOW_IDS, 1

    Cmd.SetToggleString 6, SHOW_IDS, 2

    Cmd.SetToggleString 1, SHOW_HEADINGS, 0

    Cmd.SetToggleString 1, GRAPH_OPTION, 0

    Cmd.SetToggleString 4, DIM_INFO_ORDER, 1

    Cmd.SetToggleString 14, DIM_INFO_LOC, 1
    Cmd.Marked = True
    End If

    But, this code is generating an ICON, HORIZONTAL AND
    VERTICAL ON THE DIMINFO.

    Hope that explains my situation better.

    Thanks again
  • I dont have access to PC-Dmis atm, but there is definitely an entry in the right help file. If you look in the pc-dmis installation directory there is a help file with a name ending with “basic” somewhere. The documentation isn’t stellar, it’s not going to tell you which state correspond with which setting. I’d make a program with a dimension configured as you want it and export as .bas and figure it out from the code.
  • Thanks for your reply LostL. (Does that mean you were a "LOST" fan (T.V. show)??
    I sure was.

    Anyway, when I created the script a while back, that's what I did.
    I was so happy it worked fairly well, I didn't try to fine tune it to get exactly what I
    wanted.
    Just to make sure, I created a vector point with diminfo and exported to .bas file again yesterday.
    This is what I got. Same as what I use except for the retval.

    Set DmisCommand = DmisCommands.Add(DIMENSION_INFORMATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Reference Id = LOC592
    retval = DmisCommand.PutText ("LOC592", REF_ID, 0)
    ' Set Show Ids Item 1 =
    retval = DmisCommand.SetToggleString (6, SHOW_IDS, 1)
    ' Set Show Ids Item 2 =
    retval = DmisCommand.SetToggleString (6, SHOW_IDS, 2)
    ' Set Show Headings =
    retval = DmisCommand.SetToggleString (1, SHOW_HEADINGS, 0)
    ' Set Graph Option =
    retval = DmisCommand.SetToggleString (1, GRAPH_OPTION, 0)
    ' Set Dimension Info Order Item 1 = DEV
    retval = DmisCommand.SetToggleString (4, DIM_INFO_ORDER, 1)
    ' Set Dimension Info Location Item 1 = T
    retval = DmisCommand.SetToggleString (14, DIM_INFO_LOC, 1)

    End Sub

    Sub Main

    Part1
    Part2
    Part3
    Part4
    Part5

    DmisPart.RefreshPart
    End Sub


    One interesting thing, is that when I run the script and as it is
    finding the out of tolerance vector points, the code that is generated
    is "red". When the program is finished, the diminfo commands turn
    green and are slightly different than when they are red.
    Don't know what that means.

    Another thought, normally a value of 1 is true and 0 is false.
    I'm gonna try changing some values in for example the SHOW_HEADINGS
    and see what happens.
    Don't have a clue as to what the 14 means in the DIM_INFO_LOC command.

    Thanks for your suggestion.
  • SetToggleString(ToggleIndex As Long, DataType As ENUM_FIELD_TYPES, TypeIndex As Long)
    
    ToggleIndex - Indicate the toggle field being changed.
    DataType - [B]ENUM_FIELD_TYPES[/B] enumeration.
    TypeIndex - [B]Long[/B] value indicating the instance of the supplied field type to use when an object has more than one instance of a field type.
    
    
  • When you have run the code, try refreshing the dimension by opening the window for it and just hit ok.
  • Do you mean hitting F9 on the DIMINFO command and putting a check
    in the Deviation and T value checkbox? That updates the output to what I want,
    but I was hoping to automate that.

    Thanks again
  • Without checking the boxes. In some cases the output of a dimension isn´t updated automaticly after changing its configuration by Automation. If just doing a refresh by pushing F9 and confirming updates the dimension to the format you want you could try just calling .execute on the command and see if that does the trick.
  • Do you mean hitting F9 on the DIMINFO command and putting a check
    in the Deviation and T value checkbox? That updates the output to what I want,
    but I was hoping to automate that.

    Thanks again


    hey guy,solved?

  • which command should i use to specify the option?there is no change in the bas files,when i turn on or turn off this option