Looking for input

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

  • Looking for input

    Hello fellow PC DMIS users,

    I don't post here often, but I do visit and read the threads quite frequently. I am looking for help. I have been programming CMM's for about 23 years and have been using PC-DMIS for about 15 of those 23 years. I currently run PC-DMIS 2018 R2 and have been looking to develop my non-PC DMIS related programming skills using Visual Studio. I notice that there are a number of threads going years back that tell how some of you more advanced guru's have been able to interface with PC-DMIS via visual studio.

    Now, I am still new to the arena of software development and the majority of object oriented programming I still have yet to understand. My questions are as follows.
    1. Why would anyone find the need to interface with PC-DMIS libraries via Visual Studio since I find most of what I do on a daily basis available in the software already.
    2. What would be the best choice to interface with PC-DMIS? (i.e. VB.net, Visual C# etc.)
    3. Do you mostly use console apps to talk to PC-DMIS?
    4. Having mentioned point in #1, What are some concrete examples of how and why one would use VB.net, or C# etc, in accordance with PC-DMIS.
    5. Does Hexagon offer any instruction on the where's when's and how's to even begin with this sort of thing?
    In conclusion, I guess I've never really had anyone explain why the ability to use these options are useful. I don't understand the advantages. It sounds very interesting though. Again, please try to explain to me as if I am a two year old. I won't understand If you speak in program-eze.

    Thank you all.

  • #2
    Originally posted by johnnyrocket View Post
    Hello fellow PC DMIS users,

    I don't post here often, but I do visit and read the threads quite frequently. I am looking for help. I have been programming CMM's for about 23 years and have been using PC-DMIS for about 15 of those 23 years. I currently run PC-DMIS 2018 R2 and have been looking to develop my non-PC DMIS related programming skills using Visual Studio. I notice that there are a number of threads going years back that tell how some of you more advanced guru's have been able to interface with PC-DMIS via visual studio.

    Now, I am still new to the arena of software development and the majority of object oriented programming I still have yet to understand. My questions are as follows.
    1. Why would anyone find the need to interface with PC-DMIS libraries via Visual Studio since I find most of what I do on a daily basis available in the software already.

      Because you can automate tasks (a bit like macros in excel). For instance I (for a customer) created a macro which calculated the area within a close scan. Or one that performed about 5 constructions and associated dimensions for every feature of a certain type in a program (could be done manually but there were say 50 cylinders, all which required creating offset planes, then pierce points, then dimensions etc etc. It would be a lot of manual work. And this was a common and repetitive thing which they was a requirement in many of the program they did, so it could be used again and again and again.

      I've also created an Operator interface (RunDmis https://www.dropbox.com/s/924hd5rvr016c4c/rund.jpg?dl=0 - easy to find and locate and run programs, and keeps them safe from being tinkered with, stored on a server and downloaded to local PC(s) for execution) and a reporting Database (RepDmis https://www.dropbox.com/s/3vvofah6e7dgt4k/rd2.jpg?dl=0 ) for quickly viewing reports and part history (run charts)
    2. What would be the best choice to interface with PC-DMIS? (i.e. VB.net, Visual C# etc.)

      I use vb.net as I come from VB originally. VB is maybe a bit easier language wise and syntax wise, but if I were starting fresh I might just go c#. However there are a LOT more vb examples floating around which may help.
    3. Do you mostly use console apps to talk to PC-DMIS?

      NO! GUI / Windows forms all the way!
    4. Having mentioned point in #1, What are some concrete examples of how and why one would use VB.net, or C# etc, in accordance with PC-DMIS.

      See above
    5. Does Hexagon offer any instruction on the where's when's and how's to even begin with this sort of thing?
    In conclusion, I guess I've never really had anyone explain why the ability to use these options are useful. I don't understand the advantages. It sounds very interesting though. Again, please try to explain to me as if I am a two year old. I won't understand If you speak in program-eze.

    Thank you all.


    Answers above....
    Last edited by NinjaBadger; 07-05-2019, 10:21 AM.
    Automettech - Automated Metrology Technology

    Comment


    • #3
      My words from a previous thread on the subject.


      You can get vb.net express for free, but .net is a step change from vb scripts, although it might get you started with Object Orientated Programming.

      Also there is VBA (Visual Basic for Applications) contained within MS Office - (Alt+F11) opens up the Development Environment.

      (I still use this to browse the object model for PC-Dmis.)


      Getting your head around Objects is kind of key, it's a gradual process but it's where you need to head.


      I think PC-Dmis automation is actually quite a good learning resource as you can apply stuff to what you already know.


      i.e.

      Dim pcapp as Object

      '(Dim is the key word used to declare a variable in VB, it's like ASSIGN in PC-Dmis
      'In this case we're declaring pcapp as an Object Variable, unlike a normal variable which will typically store a bit of information, an object variable represents an object, from which we can access its properties, methods and functions
      'More on this in a minute

      Set pcapp = CreateObject("pcdlrn.application")

      'This creates an object, in this case it creates an object representing the pcdmis application. You could also create an Excel "excel.application" or a Word "winword.application" objetct in order to control either of those bits of software
      'You typically only use the CreateObject function to get hold of the top-level object like the application itself.

      'Once we've got our claws into the main application we can do lots of stuff.

      Dim pcpart as Object

      'decalre another Object Variable

      Set pcpart = pcapp.activepartprogram

      'set its value to the active part program - we now have our claws into the active part program

      'from here we can do more stuff

      msgbox(pcpart.name)

      'msgbox is like an operator comment. we're going to display the Name property of the active part program

      'we could also access some of the part programs methods like close, quit, or save (pcpart.close, pcpart.quit, pcpart.save)

      'More often than not we're going to want to do something with the commands within the program - guess how we do that?
      'That's right, we create another object to represent the programs commands

      Dim cmds as Object
      Set cmds = pcpart.commands

      'again we can access the commands properties (commands is a collection of individual commands)

      msgbox(cmds.count)

      'Count is the number of commands in the collection

      'or we can step through the commands and do stuff

      Dim cmd as Object

      'This is going to represent each individual command in the program, one at a time

      for each cmd in cmds

      'for each is a looping technique, so for each command object, in the commands collection
      msgbox(cmd.id)
      'display the ID property

      next
      'move on the the next command


      'There are lots of useful functions that allow us to target certain type of commands


      for each cmd in cmds


      if cmd.isdimension then

      'Will only return TRUE if the command is a dimension command, the code within this IF statement will process only dimension type commands, it's no use me asking for the Measured property of an alignment - it doesn't exist

      msgbox(cmd.dimensioncommand.meas)

      'So we know this is a dimension command, we can then access the dimensioncommand properties and methods
      'This will display the measured value for each dimension in the commands

      end if

      next


      Right, that's all I've time for but it might give you an idea/get you started.
      Automettech - Automated Metrology Technology

      Comment


      • #4
        RepDmis looks like it is the dogs bollocks!

        (they told me this means something good)
        PC-DMIS CAD++ 2o19 R1 SP5

        Comment


      • #5
        This was something that was being put together by an old manager of mine at Hex. Development stopped abruptly when he was let go but a lot of work was done on it.

        UNFORTUNATELY, there's not a whole lot of documentation there but it's public so do what you please.

        Last i knew, it was tested on 2017 i think. I'm not sure how well it works with later versions.

        https://marketplace.visualstudio.com...xtension-18982
        Ex-Hex

        Comment


        • anthony.alfaro
          anthony.alfaro commented
          Editing a comment
          Why not?


          (extra characters because i gotta have 10 to post a comment)

        • Kp61dude!
          Kp61dude! commented
          Editing a comment
          I'm a hipster I guess... I'm on version 2017 and might have to roll back to good ol' 2015 as this isn't the first time it's come up. The whole world is on 2015.

          7/8/2019 5:52:16 AM - Microsoft VSIX Installer
          7/8/2019 5:52:16 AM - -------------------------------------------
          7/8/2019 5:52:16 AM - vsixinstaller.exe version:
          7/8/2019 5:52:16 AM - 15.9.3041
          7/8/2019 5:52:16 AM - -------------------------------------------
          7/8/2019 5:52:16 AM - Command line parameters:
          7/8/2019 5:52:16 AM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services \Microsoft.VisualStudio.Setup.Service\VSIXInstalle r.exe,C:\Users\sapier\Downloads\Hexagon VB Extension.vsix
          7/8/2019 5:52:16 AM - -------------------------------------------
          7/8/2019 5:52:16 AM - Microsoft VSIX Installer
          7/8/2019 5:52:16 AM - -------------------------------------------
          7/8/2019 5:52:29 AM - Initializing Install...
          7/8/2019 5:52:29 AM - Extension Details...
          7/8/2019 5:52:29 AM - Identifier : Hexagon_VB_Extension.Hexagon Metrology, Inc.0011875d-c1a3-449c-b9d0-5139aa5d89b7
          7/8/2019 5:52:29 AM - Name : Hexagon VB Extension
          7/8/2019 5:52:29 AM - Author : Hexagon Manufacturing Intelligence
          7/8/2019 5:52:29 AM - Version : 2.1
          7/8/2019 5:52:29 AM - Description : A project to get AE's going in the world of VB.net
          7/8/2019 5:52:29 AM - Locale : en-US
          7/8/2019 5:52:29 AM - MoreInfoURL :
          7/8/2019 5:52:29 AM - InstalledByMSI : False
          7/8/2019 5:52:29 AM - SupportedFrameworkVersionRange : [4.5,)
          7/8/2019 5:52:29 AM -
          7/8/2019 5:52:29 AM - SignatureState : Unsigned
          7/8/2019 5:52:29 AM - Supported Products :
          7/8/2019 5:52:29 AM - Microsoft.VisualStudio.Community
          7/8/2019 5:52:29 AM - Version : [14.0]
          7/8/2019 5:52:29 AM -
          7/8/2019 5:52:29 AM - References :
          7/8/2019 5:52:29 AM - Signature Details...
          7/8/2019 5:52:29 AM - Extension is not signed.
          7/8/2019 5:52:29 AM -
          7/8/2019 5:52:29 AM - Searching for applicable products...
          7/8/2019 5:52:29 AM - Found installed product - Microsoft Visual Studio 2010 Shell - Integrated Mode
          7/8/2019 5:52:29 AM - Found installed product - Microsoft Visual Studio Professional 2013
          7/8/2019 5:52:29 AM - Found installed product - Microsoft Visual Studio 2013 Shell (Integrated)
          7/8/2019 5:52:29 AM - Found installed product - Global Location
          7/8/2019 5:52:29 AM - Found installed product - ssms
          7/8/2019 5:52:29 AM - Found installed product - Visual Studio Team Explorer 2017
          7/8/2019 5:52:29 AM - Found installed product - Visual Studio Professional 2017
          7/8/2019 5:52:29 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products. <<<<<<<<<<!!!!!!!!!!!!!!!!!!!
          at VSIXInstaller.ExtensionService.GetInstallableData( String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
          at VSIXInstaller.ExtensionPackService.IsExtensionPack (IStateData stateData, Boolean isRepairSupported)
          at VSIXInstaller.ExtensionPackService.ExpandExtension PackToInstall(IStateData stateData, Boolean isRepairSupported)
          at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
          at VSIXInstaller.App.Initialize()
          at System.Threading.Tasks.Task`1.InnerInvoke()
          at System.Threading.Tasks.Task.Execute()
          --- End of stack trace from previous location where exception was thrown ---
          at Microsoft.VisualStudio.Telemetry.WindowsErrorRepor ting.WatsonReport.GetClrWatsonExceptionInfo(Except ion exceptionObject)
          Last edited by Kp61dude!; 07-08-2019, 11:22 AM.

        • anthony.alfaro
          anthony.alfaro commented
          Editing a comment
          I guess i could have been more clear...

          the extension works on VS 2015 but has been tested in PC-DMIS 2017.

          My bad!

      • #6
        Originally posted by johnnyrocket View Post
        Hello fellow PC DMIS users,

        I don't post here often, but I do visit and read the threads quite frequently. I am looking for help. I have been programming CMM's for about 23 years and have been using PC-DMIS for about 15 of those 23 years. I currently run PC-DMIS 2018 R2 and have been looking to develop my non-PC DMIS related programming skills using Visual Studio. I notice that there are a number of threads going years back that tell how some of you more advanced guru's have been able to interface with PC-DMIS via visual studio.

        Now, I am still new to the arena of software development and the majority of object oriented programming I still have yet to understand. My questions are as follows.
        1. Why would anyone find the need to interface with PC-DMIS libraries via Visual Studio since I find most of what I do on a daily basis available in the software already.
        2. What would be the best choice to interface with PC-DMIS? (i.e. VB.net, Visual C# etc.)
        3. Do you mostly use console apps to talk to PC-DMIS?
        4. Having mentioned point in #1, What are some concrete examples of how and why one would use VB.net, or C# etc, in accordance with PC-DMIS.
        5. Does Hexagon offer any instruction on the where's when's and how's to even begin with this sort of thing?
        In conclusion, I guess I've never really had anyone explain why the ability to use these options are useful. I don't understand the advantages. It sounds very interesting though. Again, please try to explain to me as if I am a two year old. I won't understand If you speak in program-eze.

        Thank you all.
        No need to touch on Object Oriented Programming just yet...

        Visual Studio is not the only thing that can interface with PcDmis. You can use VBA from Excel it's already installed if you have Excel.

        1. Repetitive tasks is number 1 on the list for me. Basically, if your mouse and keyboard can do it why not automate the process and repeat an infinite amount of times. Something I use on a daily is a widget that takes strings from excel as9102 form 3 and spits it into Pcdmis as a report comment... saves me a bunch of time and minimizes error.

        2. Most of us started with Excel VBA, there are a bunch of examples written in it. VB.NET translates over very easily so it was a no brainier for me. Mojority of PcDmis examples are written in VB. C# is a nice language on my bucket list because everything you google comes up in C#, I'm assuming it's a popular flavor. I have stayed away from Python as it is too easy and I don't want to spoil myself but hey go for it if you want.

        3. What are console apps?

        4. Another one is the task of extracting a list of all probe names and tips used by what program file. Doing this one at a time for hundreds of programs is not pleasant. Tasks, tasks, tasks... you're limited by very little... that little is between your ears.

        5. Yes they do/did. I took their VB.NET with PcDmis a couple years back on HexagonU (?). Very useful. At only $60 - $70 US doll hairs!

        6.Interesting indeed! In my earlier adventures I would write code just for the fun of it, tasks that really didn't require crazy code in Excel VBA/ Visual Studio VB.NET, I just wanted to keep my feet in the water. I had 12 operator on 2 shifts wondering why I was automating every task possible they would tell me "Yo, you're taking all the fun away from us!" as in all they had to do was load a part and press a button. I felt bad and would add riddles to their part routines...
        Last edited by Kp61dude!; 07-08-2019, 11:25 AM.
        PcDmis 2015.1 SP10 CAD++
        Global 7-10-7 DC800S

        Comment

        Related Topics

        Collapse

        Working...
        X