Dmis to create a folder????

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

  • Dmis to create a folder????

    Wondering can PC-Dmis create a folder and then save PDFs to that folder under part number????
    e.g.:
    writing to G:\CMM\Data\ "new folder" \ "part number"

    P

  • #2
    Yes, but I think you'd need to use a script to do it.
    PC-DMIS CAD++ 2o19 R1 SP3

    Comment


    • #3
      This is my method, kludged from various contributers here.

      Assemble string containing desired path/folder. I use operator input assigne to variables. Run basic script to create.
      Code:
                  assign/job_path="n:\inspection plans\\"+customer+"\\"+partnumber+"\\"+jobnumber
      csub_creatdir=script/filename= z:\scripts\createdirectory.bas
                  function/main,show=yes,arg1=job_path,,
                  startscript/
                  endscript/
      
                  assign/report_path=job_path+"\\"+operation
      csub_creatdir=script/filename= z:\scripts\createdirectory.bas
                  function/main,show=yes,arg1=report_path,,
                  startscript/
                  endscript/
      Create string for name of pdf.
      Code:
                  ASSIGN/RPT_FILE=REPORT_PATH+"\\"+JOBNUMBER+"_"+DATETIMESTAMP+"_"+SERNUMBER+".pdf"
      Use print command to create and save pdf.
      Code:
      CMNT_PRINT =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                  PRINT REPORT?
                  IF/CMNT_PRINT.INPUT=="NO"
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,OVERWRITE=RPT_FILE,$
                    TO_PRINTER=OFF,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    PREVIOUS_RUNS=DELETE_INSTANCES
                  END_IF/
                  ELSE/
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,OVERWRITE=RPT_FILE,$
                    TO_PRINTER=ON,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    PREVIOUS_RUNS=DELETE_INSTANCES
                  END_ELSE/
      Basic script.
      CREATEDIRECTORY.BAS
      Code:
      Sub Main(PathName As String)
      	On Error Resume Next
      	MkDir PathName
      End Sub
      I like to get hammered on Friday night
      Sometimes I can’t wait
      So Monday’s alright

      Lyle Henderson

      Comment


      • #4
        I think you can do it only with the PC-DMIS toolbox :
        V1=FILE/DIALOG, (to choose the folder: you need to put a file in this folder, like a .txt, for example - In file dialog, you can do it, by a right clic)
        ASSIGN/V2=V1
        ASSIGN/V3=0
        DO/ count the number of \ in the name of folder
        ASSIGN/V4=INDEX(V2,"\\")
        ASSIGN/V2=RIGHT(V2,LEN(V2)-V4)
        ASSIGN/V3=V3+1
        UNTILV4==0
        ASSIGN/V5=GETTEXT(191,1,1) take the name of the part
        ASSIGN/V6=V5+".PDF"
        ASSIGN/V7=LEN(ELEMENT((V3)-2),"\\",V1))
        ASSIGN/V8=LEN(V1)-V7+2
        ASSIGN/V9=LEFT(V1,V8)
        ASSIGN/V10=V9+V6
        PRINT/REPORT,EXEC MODE=END,$
        TO_FILE=ON,OVERWRITE=V.PDF,$ print a report PDF with the part name
        (...)

        Comment

        Related Topics

        Collapse

        Working...
        X