PC-DMIS 2014 + Leica TDRA6000 + VBA/Excel

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

  • PC-DMIS 2014 + Leica TDRA6000 + VBA/Excel

    Hello,
    i have searched in the Forum for the functions i need, but didn't found anything that fits to my needs.

    I tried out some code in VBA/Excel to get values of measured points in the partprogram and writes it into cells in my Excel-sheet. (The code runs through the whole partprogram and reads out every command) So far everything runs fine.

    But now i need another functionality.

    For example:
    - switch Probe compensation on/off
    - switch Point only mode on/off
    - switch ATR on/off
    - Take a Hit with the TDRA6000
    - switch between measure mode (simple/average)
    - paste the values of the last measured Point into Excel
    - create constructions (for example a circle from the last 5 measured points)
    - create dimensions (for example a distance between the last 2 measured points)

    Is it possible to realise these functions with VBA/Excel and PCDLRN?

    Thank you in advance!

    misch

  • #2
    It should be possible. Most seasoned script writers have recommended to create a PCD program with the command you're interested in and then export the PCD program out to basic, FILE | EXPORT | BASIC. It creates a file you can open in Notepad, copy and paste the code of importance to your VBA program, you may have to edit it a little to suit. Hope that helps and welcome to the forum!
    Last edited by Kp61dude!; 09-12-2017, 09:31 AM. Reason: Clarification
    PcDmis 2015.1 SP10 CAD++
    Global 7-10-7 DC800S

    Comment


    • #3
      Thank you for your quick response! I'll give it a try and report the result.

      misch

      Comment


      • #4
        I don't remember how much information was available in the Help for 2014, but in 2017 there is a large chapter about the PC-DMIS Object Library,
        Help... -> Contents -> Available Help Systems -> PC-DMIS BASIC Language -> PC-DMIS 2017 R2 Object Library

        It's probably not complete, but you can get more ideas from browsing the pcdlrn.tlb type library (via Excel, for example).
        AndersI
        SW support - Hexagon Metrology Nordic AB

        Comment


        • #5
          Thanks for your answers.
          @Kp61dude!
          What i've tested so far is the export to a basic file and copy the code to VBA. But the only thing this does is to write the copied features to the active partprogram.
          With this method i think it is not possible to switch things like "ATR" or "Point only mode" on or off. Because they will not be reported in the edit window. So they are not included in the exported basic code.

          I'm not sure if i'm right with this conclusion.

          @AndersI
          The only switch i have found in the help so far is for Probe Compensation.

          PartProgram.OldBasic.ProbeComp (PCD_OFF)

          or

          PartProgram.OldBasic.ProbeComp (PCD_ON)

          I also still haven't figured out how to let the machine take a hit (execute a measurement at a RRR1,5" target) shortcut: CTRL + H



          misch

          Comment


          • #6
            Originally posted by misch View Post
            ... the only thing this does is write to the copied features to the active partprogram.
            ya have to replace the old data with new desired data via manual input or variables.
            PcDmis 2015.1 SP10 CAD++
            Global 7-10-7 DC800S

            Comment


            • #7
              Maybe emulate keypresses through SendKeys? (CTRL-H etc)
              PC-DMIS CAD++ 2o17 R2

              Comment

              Working...
              X