Tip object

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

  • Tip object

    Hi,

    I am trying to get A angle of tip for script.

    From help:
    "Tip.A
    Returns the A angle of the tip. Read-only Double."

    I have no clue how to retrieve data. How I can A angle of current tip?

  • #2
    Here you go:

    Code:
    LOADPROBE/LSPX1_3X50
    TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    TIP/T1A-90B0, SHANKIJK=0, -1, 0, ANGLE=0
    ASSIGN/A_ANGLE=PROBEDATA("A")
    ASSIGN/B_ANGLE=PROBEDATA("B")
    PcDmis 2015.1 SP10 CAD++
    Global 7-10-7 DC800S

    Comment


    • Darius11
      Darius11 commented
      Editing a comment
      This is for pc dmis itself. At the moment I do have:
      [ If Cmd.Type = SET_ACTIVE_TIP Then
      ProbeAngle1 = right(left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1),(len(left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1))-instr(1,left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1),"A")))
      ...]

      It doing job but if I could replace this "right(left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1),(len(left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1))-instr(1,left(Cmd.GetText (ID, 0),instr(1,Cmd.GetText (ID, 0),"B")-1),"A")))" by one command it would be easier to reed.

  • #3
    Other thing what I can't find out is how to use MOVE_CLEARPOINT .Script should check if before every "LOADPROBE/B" command is command "MOVE/CLEARPOINT". Basically should be " If Cmd.Type = SET_ACTIVE_TIP " and previous command wasn't "MOVE/CLEARPOINT" then MSGBOX... . I did try things like "if cmd.Type = MOVE_CLEARPOINT Then "...... but no positive result was achieved. Any ideas?

    Comment


    • davehocum
      davehocum commented
      Editing a comment
      Replace MOVE_CLEARPOINT with 163.

    • Darius11
      Darius11 commented
      Editing a comment
      Thanks, it did work.

    • davehocum
      davehocum commented
      Editing a comment
      No problem

  • #4
    Not at work but iirc loadprobe is not type Set_active_tip? You may need to back up another step.

    Comment


    • #5
      Seems to be:
      MOVE/CLEARPOINT = MOVE_CLEARPOINT (163)
      LOADPROBE/ * = GET_PROBE_DATA ( 61)
      TIP/* = SET_ACTIVE_TIP (60)

      Activetip has an .Angle property, but that could be for B. Otherwise you can use the Probe object to find tip info, but I wouldn´t recommend that. Better to do what you do already. I'd put it in a function so it doesnt mess up the code so much.

      Comment


      • Darius11
        Darius11 commented
        Editing a comment
        Thanks. I didn't manage to get A angle in any other way than my so I will stick to my way.
        Could you be more specific what do you mean by "put it in a function". If that isn't that what i have done, then it is outside of my experience.

    • #6
      I have a similar function for what is likely a similar purpose...

      In VBA:

      Code:
      Function NegativeTip(name As String) As Boolean
      Dim Temp() As String
      Dim Angle As Integer
      Temp = Split(name, "A")
      Temp = Split(Temp(1), "B")
      Angle = CInt(Temp(0))
      If Angle <= 0 Then
      NegativeTip = True
      Else
      NegativeTip = False
      End If
      
      End Function

      Comment


      • Darius11
        Darius11 commented
        Editing a comment
        Thanks, nice piece.
        I do understand logic of this function and it looks better than my piece of code. From other hand I do not use any single function in my scripts and I didn't have any working function and that is probably because when I started programming I didn't have any success on creating functions. At this time I'm nearly running out of ideas and when I will run out of ideas then I will start optimisation of scripts then I will try functions again.

      • LostL
        LostL commented
        Editing a comment
        Paste this into your module and try calling MsgBox AngleA(Cmd.GetText (ID, 0)) . You REALLY should use functions in anything that isn´t trivial. It´s not difficult either, if you´ve failed it´s just some minor syntax error.

        Function AngleA(Name As String) As Integer
        Dim Temp() As String
        Temp = Split(Name, "A")
        Temp = Split(Temp(1), "B")
        AngleA = CInt(Temp(0))
        End Function

    • #7
      Well... tried, tried but.... I can't understand what exactly I can't understand. I done copy and paste to my script "Sub Main" but I didn't overcome error.
      Could you please to do little script which scan CMM program and display angles A of tip? Maybe it could help me understand where is problem.

      I'm receiving message with syntax error but I can't see any error. I'm using pc dmis 15.1, could it be problem for run of functions?

      Comment

      Related Topics

      Collapse

      Working...
      X