hexagon logo

Help basic script

will it be possible to put a picture on a button?
will it be possible with a basic scrip to run another basic script ?
If possible how can I do it?

  • I've been watching this script. But as I'm starting programming in vb.net in visual studio I need help. Someone can help by saying that it's wrong in my code.


    As you don't tell what errors you get, we can't tell how to fix it, we can only guess :-)

    Another suggestion is to makes sure your numbers are of type DOUBLE. There's a risk that "10" (and "12" and "-" etc.) is compiled into an integer constant, and never converted to double as PC-DMIS wants it. The ToPoints script uses double variables in this position instead of numeric constants. Try to do the same, just to see if there's any difference.

  • I have tried another code this one only gives an error but it creates the point in the pc dmis. Public Class Form1  Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Dim CommandCount Dim RETVAL Dim CMD Dim PCDCommands Dim PCDCommand Dim FCNTR Dim ID Dim DmisCommandProgram Dim RMEASFEATIDX Dim RMEASFEATIDY Dim RMEASFEATIDZ Dim CONTACT_VECTOR_POINT_FEATURE Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click DmisCommand = DmisCommands.Add(CONTACT_VECTOR_POINT_FEATURE, True) DmisCommand.Marked = True ' Set Theoretical X = -15.461 RETVAL = DmisCommand.PutText("-15.461", "THEO_X", 0) ' Set Theoretical Y = 13.28 RETVAL = DmisCommand.PutText("13.28", "THEO_Y", 0) ' Set Theoretical Z = 5.309 RETVAL = DmisCommand.PutText("5.309", "THEO_Z", 0) ' Set Theoretical I = 0 RETVAL = DmisCommand.PutText("0", "THEO_I", 0) ' Set Theoretical J = 0 RETVAL = DmisCommand.PutText("0", "THEO_J", 0) ' Set Theoretical K = 1 RETVAL = DmisCommand.PutText("1", "THEO_K", 0) ' Set Report Vector I = 0 RETVAL = DmisCommand.PutText("0", "REPORTVEC_I", 0) ' Set Report Vector J = 1 RETVAL = DmisCommand.PutText("1", " REPORTVEC_J", 0) ' Set Report Vector K = 0 RETVAL = DmisCommand.PutText("0", " REPORTVEC_K", 0) ' Set Update Vector I = 0 RETVAL = DmisCommand.PutText("0", "UPDATEVEC_I", 0) ' Set Update Vector J = 1 RETVAL = DmisCommand.PutText("1","UPDATEVEC_J", 0) ' Set Update Vector K = 0 RETVAL = DmisCommand.PutText("0", "UPDATEVEC_K", 0) ' Set Measured X = -15.461 RETVAL = DmisCommand.PutText("-15.461", "MEAS_X", 0) ' Set Measured Y = 13.28 RETVAL = DmisCommand.PutText("13.28", "MEAS_Y", 0) ' Set Measured Z = 5.309 RETVAL = DmisCommand.PutText("5.309","MEAS_Z", 0) ' Set Measured I = 0 RETVAL = DmisCommand.PutText("0", "MEAS_I", 0) ' Set Measured J = 0 RETVAL = DmisCommand.PutText("0"," MEAS_J", 0) ' Set Measured K = 1 RETVAL = DmisCommand.PutText("1", "MEAS_K", 0) ' Set Target X = -15.461 RETVAL = DmisCommand.PutText("-15.461", "TARG_X", 0) ' Set Target Y = 13.28 RETVAL = DmisCommand.PutText("13.28", "TARG_Y", 0) ' Set Target Z = 5.309 RETVAL = DmisCommand.PutText("5.309"," TARG_Z", 0) ' Set Target I = 0 RETVAL = DmisCommand.PutText("0", "TARG_I", 0) ' Set Target J = 0 RETVAL = DmisCommand.PutText("0", "TARG_J", 0) ' Set Target K = 1 RETVAL = DmisCommand.PutText("1", "TARG_K", 0) ' Set Update Vector I = 0 RETVAL = DmisCommand.PutText("0"," UPDATEVEC_I", 0) ' Set Update Vector J = 1 RETVAL = DmisCommand.PutText("1"," UPDATEVEC_J", 0) ' Set Update Vector K = 0 RETVAL = DmisCommand.PutText("0"," UPDATEVEC_K", 0) ' Set Report Vector I = 0 RETVAL = DmisCommand.PutText("0", "REPORTVEC_I", 0) ' Set Report Vector J = 1 RETVAL = DmisCommand.PutText("1", "REPORTVEC_J", 0) ' Set Report Vector K = 0 RETVAL = DmisCommand.PutText("0", "REPORTVEC_K", 0) ' Set Id = P1 RETVAL = DmisCommand.PutText("P1", ID, 0) End Sub
  • Line 23 should probably be
     Set DmisCommand = DmisCommands.Add(CONTACT_VECTOR_POINT_FEATURE, True)
    


    (note the "Set" keyword - it's necessary at least in PC-DMIS Basic, I don't know much about VB)

    and all the PutText should drop the quote marks around THEO_X, THEO_Y etc.

    Program code is preferrable quoted with the CODE tags, like this, but without the space character after CODE:

    Set DmisCommand = DmisCommands.Add(CONTACT_VECTOR_POINT_FEATURE, True)
    

  • Thank you for your help.

    I'll give up doing the programming in vb.net I'll do in vb6 and much easier.