Wrist Speed added to basic script error.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wrist Speed added to basic script error.

    I have sets of code that I use in every program. I wanted to make my life easier so I compiled it in a script and attached it to a custom toolbar. All of the code works fine except for Wrist Speed. Even if I export just the Wrist Speed code to a script, it fails to execute the script and gives me this error...
    "Runtime Error on line: 15 - Object variable or With block variable not set"
    It's not like I wrote the script myself, this is what PC-DMIS wrote during export and it still doesnt work. It seems to have a problem with the (WRIST_SPEED, True) line. If I change it to MOVE_SPEED instead, it works and throws a movespeed line in the edit window. Has anyone replicated this bug or figured out a workaround?
    Thanks again everyone.
    PC-DMIS 2017 R2
    Set DmisCommand = DmisCommands.Add(WRIST_SPEED,True)
    DmisCommand.Marked = True
    'Set Wrist Speed = 100
    Retval = DmisCommand.PutText ("100", F_MOVESPEED, 0)

  • #2
    Which line is it erroring on?

    i.e. if you comment out the line where you set the speed does it add the wrist speed line but with no speed set?
    Applications Engineer
    Hexagon UK

    Comment


    • #3
      Tried to make it work.

      Seems to fault out at the line
      Code:
      DmisCommand.Marked = True
      It doesn’t want to create the command in the program. I don’t have an answer as to why it won’t create it, other than “Hey, it’s PCDMIS, and it does and doesn’t do things as it wants.”

      B&S CHAMELEON/PCDMIS CAD++ V2011

      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

      sigpic

      Comment


      • #4
        Not tried it through automation but if you insert a wristspeed command in the program you're not able to toggle it marked/unmarked. i.e. just try add the command and set the speed (lose the DmisCommand.Marked = True line)


        (In other words marked isn't a property of that object type - you can't set a property for an object if that object doesn't have that property)

        Last edited by NinjaBadger; 02-11-2020, 05:19 AM.
        Applications Engineer
        Hexagon UK

        Comment


        • #5
          I can give that a shot today and see what happens. Movespeed has that same line and it works fine. Movespeed also can't be marked.
          For me, it seems like it errors on this line..
          Set DmisCommand = DmisCommands.Add(WRIST_SPEED,True)
          I can keep the rest of the lines the same and change Wrist_speed to Move_Speed and the script will insert it fine.
          PC-DMIS! I wonder if this block could just be ommitted. I read that Wrist speed only has an effect on certain heads, but I haven't tested that.

          Comment


          • #6
            Try replacing the "WRIST_SPEED" with its ENUM type value instead of the text. Rightclick in the edit window and change the data type display to <whatever that shows the data type> (I can't remember what it is called) and hover the mouse cursor over the wrist speed command in the program. A tooltip popup should now display the ENUM value for that particular command. Replace "WRIST_SPEED" with this value (no "") and see if that works better.
            PC-DMIS CAD++ 2o23.1

            Comment


            • dph51
              dph51 commented
              Editing a comment
              Thanks
              Great solution.

            • SingularitY
              SingularitY commented
              Editing a comment
              Perfect. Thanks!

          • #7
            VPTSe for the win

            From this

            Set DmisCommand = DmisCommands.Add(WRIST_SPEED,True)
            DmisCommand.Marked = True
            'Set Wrist Speed = 100
            Retval = DmisCommand.PutText ("100", F_MOVESPEED, 0)


            To this

            Set DmisCommand = DmisCommands.Add(49,True)
            DmisCommand.Marked = True
            'Set Wrist Speed = 100
            Retval = DmisCommand.PutText ("100", F_MOVESPEED, 0)

            B&S CHAMELEON/PCDMIS CAD++ V2011

            There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

            sigpic

            Comment


            • #8
              Whoever added the WRIST_SPEED to pcdmis probably failed to add it to the scripting definitions.
              49 should work as mentioned above.

              Comment


              • vpt.se
                vpt.se commented
                Editing a comment
                That was exactly what I was suspecting. SABarber or SingularitY , could anyone of you guys file this as a bug?

              • SingularitY
                SingularitY commented
                Editing a comment
                Yes, I can do that.

            • #9
              Originally posted by vpt.se View Post
              Try replacing the "WRIST_SPEED" with its ENUM type value instead of the text. Rightclick in the edit window and change the data type display to <whatever that shows the data type> (I can't remember what it is called) and hover the mouse cursor over the wrist speed command in the program. A tooltip popup should now display the ENUM value for that particular command. Replace "WRIST_SPEED" with this value (no "") and see if that works better.
              Problem solved. Thanks everyone!

              Comment


              • #10
                The only other thing I am having trouble with is the tracefield code.

                Code:
                 Set DmisCommand = DmisCommands.Add(TRACEFIELD, True)
                DmisCommand.Marked = True
                ' Set Name = DBSWITCH
                retval = DmisCommand.PutText ("DBSWITCH", TRACE_NAME, 0)
                ' Set Value = Tesa Star English Template_CMM
                retval = DmisCommand.PutText ("Tesa Star English Template_CMM", TRACE_VALUE, 0)
                ' Set Value Limit = 35
                retval = DmisCommand.PutText ("35", TRACE_VALUE_LIMIT, 0)
                Result = DmisCommand.SetExpression("QCCALC_NAME", TRACE_VALUE, 0)
                The tracefield shows up as "Display" no matter what I do. I even exported both the display and no_display tracefield to .bas and the result was identical. Does anyone know how to force it to say No_Display?
                Thanks again for the help.
                Last edited by SingularitY; 02-11-2020, 07:35 PM.

                Comment


                • #11
                  Figured it out. Added this line to the end of each tracefield..

                  Code:
                  Result = DmisCommand.SetExpression("NO_DISPLAY", DISPLAY_TRACE,0)

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X