txt file

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

  • txt file

    Using 3.7 mr3.I can go to file,export,generic and save a txt file to a report folder that works fine.But what Iam looking to do is at the end of the program to automaticaly send the report to that file at the end & overwrite that file each time the program is run.

  • #2
    File, printing, edit window print setup....tells the computer to send the report to........after a program is finished running.....don't know if that's what you're looking for, but HTH
    I feel a lot better now that I've lost my mind.


    Global Activ
    PCDMIS CAD ++3.5 MR2

    Comment


    • #3
      That will not create a txt. file,only a rtf or pdf.

      Comment


      • #4
        Originally posted by JIM HARRIS View Post
        That will not create a txt. file,only a rtf or pdf.
        Those are the only normal, standard output options for Pcdmis.
        sigpic
        Originally posted by AndersI
        I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

        Comment


        • #5
          You can write code for each dimension to report what you want to output, but it is a pain to me......
          sigpic.....Its called golf because all the other 4 letter words were taken

          Comment


          • #6
            You can "export" a generic file and that will save as a .txt file.
            /file/export/generic .... you will then be prompted to input a file name.
            I am not sure how to automate that though.
            I am sure someone else can figger that out.
            Lately, it occurs to me
            What a long, strange trip it's been.

            2017 R1 (Offline programming)

            Comment


            • #7
              Yes I got that,just can not figure how to automate it though.

              Comment


              • #8
                Look into PartProgram.Export("FileName.txt")

                I have not used that but I see it in the help.
                <internet bumper sticker goes here>

                Comment


                • #9
                  In 3.7 Mr2 i would use the insert/file I/O command
                  select file open and use F9 to open the diologe box.

                  Comment


                  • #10
                    OK I just tried PartProgram.Export("FileName.txt") and it works but you are prompted to check either features or dimensions or both and also asks if you want to overwrite an existing file. This is not ideal as it involves operator intervention. I/O would be your bet. Too bad as I/O is more code, the export option would be ideal.
                    <internet bumper sticker goes here>

                    Comment


                    • #11
                      Have not needed this with PCDMIS (yet); but, in the 'other' DMIS this was accomplished by opening a device (file) and writing what you wanted to the file. It could be appended or overwritten. I am pretty sure PCDMIS does this too. Maybe this is the I/O people are talking about?
                      Bill Jarrells
                      A lie can travel half way around the world while the truth is putting on its shoes. - Mark Twain

                      Comment


                      • #12
                        It seems that the Export saves the features relative to only one Coordinate system, the actual values only, and the hits. The Dimensions seem to be what they are in the program...

                        Loops are not considered.

                        Too bad you can't just turn on export as CSV at the beginning of the program and then anything that is reported would go out as a text to the CSV file.... but that would reduce their sales of the Stat export module or datapage. I dont know of any other software that charges you to get your data out.
                        Last edited by cmmguy; 09-25-2007, 08:19 AM.
                        Links to my utilities for PCDMIS

                        Comment


                        • #13
                          Originally posted by Wingman View Post
                          Have not needed this with PCDMIS (yet); but, in the 'other' DMIS this was accomplished by opening a device (file) and writing what you wanted to the file. It could be appended or overwritten. I am pretty sure PCDMIS does this too. Maybe this is the I/O people are talking about?
                          Yes you can use I/O to write or append to a text file. You must define the data that gets written. With export however, you can export all of your dimensions to a text file. In the case of export it looks like write is the only option rather than append. I automated it with a script but it still required input from the user. It would be nice if the parameters entered by the user could be passed through the script instead. This is all I did:

                          Code:
                          Sub Main()
                          
                          Dim PcdmisApp As Object
                          Dim PartProg As Object
                          Dim TryExport As Boolean
                          
                          Set PcdmisApp = CreateObject("PCDLRN.Application")
                          Set PartProg = PcdmisApp.ActivePartProgram
                          
                          TryExport = PartProg.Export("C:\ExportedData.txt")
                          
                          End Sub
                          Like I said it worked but I don't like that you still need operator intervention. Sometimes the very reason you script is to keep from having to have operator input.

                          Edit:

                          What Jim could do is check for the file using PCDMIS (FILE.EXISTS) then if it is there delete it that would eliminate the dialog that prompts an overwrite but he'll still get the dialog for selecting the parameters to pass. It looks like there is no getting around that.
                          Last edited by craiger_ny; 09-25-2007, 08:25 AM.
                          <internet bumper sticker goes here>

                          Comment


                          • #14
                            Originally posted by craiger_ny View Post
                            Yes you can use I/O to write or append to a text file. You must define the data that gets written.
                            Interesting. Not complaining as I don't have a current need for this but before I was able to select where the dims went, printer, screen, report, device (file I created) - or any combination of the above. You could basically send the data to any device and everything was treated as a device. I used this to save LONG files of hit point data to archive files for later review. This way I could also save condensed files for distribution.
                            Bill Jarrells
                            A lie can travel half way around the world while the truth is putting on its shoes. - Mark Twain

                            Comment


                            • #15
                              Thanks for the suggestions tech support sent me this yesterday.It is about the same as craig said still takes operator input,but it will do for now.

                              Sub main()

                              'Declarations
                              Dim PcdApp, PcdPart, DmisCmds, DmisCmd As Object


                              ' Check For application And program
                              Set PcdApp = CreateObject("Pcdlrn.Application")
                              If PcdApp Is Nothing Then
                              MsgBox("Application is not loaded, exiting.")
                              GoTo endme
                              End If

                              Set pcdPart = PcdApp.ActivePartProgram
                              If PcdPart Is Nothing Then
                              MsgBox("Unable to find an active part program. Please have a part program loaded when this script is used.")
                              GoTo endme
                              End If


                              retval=pcdPart.export("C:\Jim.txt")


                              endme:

                              End Sub

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X