hexagon logo

Autoname and save file as .pdf

Longtime reader, first-time poster. Thanks to all for the help this forum has provided to me thus far.

I am new to PCDMIS, but an experienced programmer with GeoMeasure (MTI). GeoMeasure is a DMIS language, but vastly different from PCDMIS. I have programmed (10 years) and even taught programming at a local community college (2 yrs). I was away from CMM's for a couple years until I moved to MA from MI last year and took this job, where I first encountered the Demon.

So now that you all have a little background info on me, here is the problem that searching the forum archives has failed to find a solution to.

I had a fixture fabricated that holds up to 16 parts in a 4X4 configuration. I took an existing program that measures a couple hundred points for flatness and created a nested loop to get my vertical and horizontal offsets. I can execute the program without a problem and everything runs fine except for one minor issue: the report needs to print out with a custom report name for each part before the loop completes.

I found a few threads that address using variables to assign the printpath to and then insert the variable into the print command. What I end up with when running is a prompt to save the file (I am not using the print setup from the "file>printing>edit print window setup" dialog box; all of those options are left unchecked). I think the problem may be network related because when I change the file location to the local C: drive, it works flawlessly.

I have attached the program for reference and I appreciate any and all comments that may be helpful.

Also, I am working a 12:30pm to midnight shift and 7:00am-noon on Saturdays, so outside of those hours I may be a bit unresponsive.
Parents
  • Is the UNC path valid?

    Yes, I copied the path from the program and pasted it into Windows Explorer address bar--it went right to the folder.

    Have you tried this with a mapped drive letter instead of the UNC?

    I mapped the folder as a drive and used the drive letter instead of the file path in PCDMIS and it didn't like that at all. What I got was a file saved in the program directory folder and named 0. Just "0" no file extension. I assume this means the path wasn't valid to PCDMIS.

    Can you assign this entire string to a variable first then use the variable to test the path.

    Good idea. I just tried this and it does the same thing as the original code; The .pdf is generated and PCDMIS open a save dialog box with the correct filename and in the correct directory, it just wants me to hit the save button. My head hurts...I'm going home for the night and I'll look at it with fresh eyes in the morning. Thanks for the help so far.
Reply
  • Is the UNC path valid?

    Yes, I copied the path from the program and pasted it into Windows Explorer address bar--it went right to the folder.

    Have you tried this with a mapped drive letter instead of the UNC?

    I mapped the folder as a drive and used the drive letter instead of the file path in PCDMIS and it didn't like that at all. What I got was a file saved in the program directory folder and named 0. Just "0" no file extension. I assume this means the path wasn't valid to PCDMIS.

    Can you assign this entire string to a variable first then use the variable to test the path.

    Good idea. I just tried this and it does the same thing as the original code; The .pdf is generated and PCDMIS open a save dialog box with the correct filename and in the correct directory, it just wants me to hit the save button. My head hurts...I'm going home for the night and I'll look at it with fresh eyes in the morning. Thanks for the help so far.
Children
No Data