• Filter
  • Time
  • Show
Clear All
new posts

  • Settogglestring

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

  • #2
    Besides the basic manual?


    • #3
      1. Object Library reference materials: Went to Wilcox site, looked for reference manuals,
      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


      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

      Hope that explains my situation better.

      Thanks again


      • #4
        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.


        • #5
          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
          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


          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.


          • #6
            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.
            Last edited by; 10-10-2019, 02:05 AM.
            PC-DMIS CAD++ 2o23.1


            • #7
              When you have run the code, try refreshing the dimension by opening the window for it and just hit ok.


              • #8
                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


                • LostL
                  LostL commented
                  Editing a comment
                  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.

              • #9
                Originally posted by gitalife View Post
                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?


                • #10
                  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


                  • #11


                    • Henniger123
                      Henniger123 commented
                      Editing a comment
                      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
                      Last edited by Henniger123; 09-23-2021, 12:46 AM.

                  • #12


                    • Henniger123
                      Henniger123 commented
                      Editing a comment
                      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

                  • #13
                    Report this, please.
                    PC-DMIS CAD++ 2o23.1


                    • #14
                      there must be another way to achieve that.any one?


                      • #15
                        Originally posted by gitalife View Post
                        Hello all,
                        Is there some documentation on the settogglestring method.
                        I am curious about the parameter values and how to set them
                        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:

                        (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
                        End Sub
                        Jared Hess - PC-DMIS Documentation Team Lead @ HMI
                        [View 2008 Reporting Tutorials Here]


                        • Henniger123
                          Henniger123 commented
                          Editing a comment
                          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

                        • quentin66
                          quentin66 commented
                          Editing a comment
                          thanks for your reply.
                          further more,i need the DIMENSION_INFORMATION command to show the evaluate information without icon
                      widgetinstance 190 (Related Topics) skipped due to lack of content & hide_module_if_empty option.