V4.1 Comment.Input for Ser#

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

  • V4.1 Comment.Input for Ser#

    I'm using v4.1. Trying to get a comment.input up to change the ser number heading and not working. I'm used to v3.7 and now I have report templates etc. Someone help? Thanks.
    I used to be high on life but I built up a tolerance.

    Brown & Sharpe Global Advantage
    PCDMIS CAD++ v2011mr2
    PH10MQ/SP600M


    sigpic

  • #2
    I wrote myself a little SCRIPT to do this. I wanted to change both the serial number and the rev number. I get those from operator input and load them into 2 ASSIGNED variables in PC-DMIS then pass them on through the SCRIPT call.

    Code:
    Sub main(cn As String,uid As String) 
    
    Dim App As Object 
    Set App = CreateObject("PCDLRN.Application") 
    
    Dim Part As Object 
    Set Part = App.ActivePartProgram 
    
    part.serialnumber=cn    'make the new control number, the serial number
    part.revisionnumber=uid
    part.refreshpart
    
    part.save
    
    Dim repwin As Object
    Set repwin = part.reportwindow
    
    repwin.refreshreport
    
    End Sub
    Note the refresh: if you do NOT refresh, the old serial number will show up in the report!

    Hope this helps, Jan.
    ***************************
    PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
    Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

    Comment


    • #3
      There's gotta be a way to edit the report template header to achieve this. I'm kinda new to v4.1+ templates and stuff. I remember reading something about this.
      I used to be high on life but I built up a tolerance.

      Brown & Sharpe Global Advantage
      PCDMIS CAD++ v2011mr2
      PH10MQ/SP600M


      sigpic

      Comment


      • #4
        Not in V4.1. It is supposed to be changed in V4.2. I have not gone that far yet, eventhough I am running V4.2 right now.

        In V4.1, the header is created the moment you start to execute your program. So whatever the value of the serial number at that time, that's the one that will show up. And it will NOT change unless you refresh. I have dug deep into this with the guru's at hexagon, but this was the best we could come up with. It works nice and reliable. I now use this in every single one of my programs.


        Jan.
        ***************************
        PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
        Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

        Comment


        • #5
          I have a VB newB question for everyone. Where do you place the code posted above to get this to work? I'm guessing it has to do with the MS Excel vb editor? Any help for would be greatly appreciated as I would like to get my feet wet in VBA.
          sigpic 1.61803399Δ
          ASSIMILATE INTERGRATE SYNTHESIZE

          Comment


          • #6
            Here is how you can call that script:

            Open up a Notepad window, or word pad. Copy the VB text above into the text editor and do a save as: give it a name that looks like *.bas, like CHANGESERNUMBER.BAS . Use PC-DMIS help files to fine tune the VB code. It ain't too difficult.

            Make sure you have assigned values to CN and UID! If they are not assigned, you will be in trouble. In my case, I have the following in my PC-DMIS program code, BEFORE the SCRIPT call:

            Code:
                        ASSIGN/CN = 1
                        ASSIGN/UID = 2
            Inside the PC-DMIS editor window, inside your part program, place the cursor wherever you want to enter the script. Go to Insert/Basic Script and work in the editor window until your PC-DMIS edit window call looks like this:

            Code:
            CS4        =SCRIPT/FILENAME= C:\PCDMISW\CHANGESERNUMBER.BAS
                        FUNCTION/Main,SHOW=YES,ARG1=CN,ARG2=UID,,
                        STARTSCRIPT/
            And run it. You will see that in the report window, serial number and revision number will both have changed to whatever you assigned to CN and UID.


            Jan.
            ***************************
            PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
            Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

            Comment


            • #7
              Hey thanks Jan!
              I used to be high on life but I built up a tolerance.

              Brown & Sharpe Global Advantage
              PCDMIS CAD++ v2011mr2
              PH10MQ/SP600M


              sigpic

              Comment


              • #8
                Hey thanks man! ...almost fogot to mention, I love beer (all time favorite Blanche de Bruges, try it if you can find it)
                sigpic 1.61803399Δ
                ASSIMILATE INTERGRATE SYNTHESIZE

                Comment


                • #9
                  Just done 3 weeks drinking it. I like the Hoegaarden Blanche. Ah, the small pleasures of life....


                  Originally posted by slesholdofthreep View Post
                  Hey thanks man! ...almost fogot to mention, I love beer (all time favorite Blanche de Bruges, try it if you can find it)
                  ***************************
                  PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
                  Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

                  Comment


                  • #10
                    Is there a way to keep the feature IDs from reappearing when this script is used? When the script runs and makes 600+ IDs that were turned off reappear, it causes the program to lock up until I turn them back off.
                    Who am I, where am I, what's going on?

                    Comment


                    • #11
                      Create a viewset with the features and IDs as you want them and recall said viewset at end of program.
                      sigpic 1.61803399Δ
                      ASSIMILATE INTERGRATE SYNTHESIZE

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X