hexagon logo

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
  • Yes, but I think you'd need to use a script to do it.
  • 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.
    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.
    ASSIGN/RPT_FILE=REPORT_PATH+"\\"+JOBNUMBER+"_"+DATETIMESTAMP+"_"+SERNUMBER+".pdf"


    Use print command to create and save pdf.
    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
    Sub Main(PathName As String)
    	On Error Resume Next
    	MkDir PathName
    End Sub
  • 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
    (...)