Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Scuba Jon

Verified Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Scuba Jon

  1. Roger ok, the more specific scoopage: I am trying to save the file as: "C:tempPart Datajrptest-51_1-1.txt" with the "jrptest-51_1-1" as the program unique part of the path. What I am getting is: "C:tempPart Data.txt" (Drops the snamenci$ part of the path). I know it is finding the nci file name because I can output the path in the pheader$ section of the post Thanks for your help
  2. Hi all I'm back on the buffer files again I am using a couple buffer files in my post and they work great as long as I hard code the path for the file location. As soon as I use a variable in the path it no longer works. Here is the section of the post where I call the buffer files. I am trying to use "snamenci$" in the path so I can save the buffer files as a unique file name but I just can not make it work. The strange thing is when I print out the string variable "str_pgrm_name" in the pheader$ block it shows the right path. str_pgrm_name = "C:tempPart Data" + snamenci$ + ".txt" #this line does not work #str_pgrm_name = "C:tempPart Data" + "jrptest-51_1-1" + ".txt" #this line works sbufname9$ = str_pgrm_name fbuf 9 1 80 1 1 Any suggestions?
  3. Roger It's always the little things that mess you up. Silly me, I was using the V9.1 MP Post Processor Guide which says you have to have the "drivepathfilename in Quotes" (V2 Ch3 "How Buffer Files Work). I tried it without the quotes but did not put in that neat little equals (=) sign. Once I did that my built path worked without the quotes. Thank you for your help
  4. Thanks Colin, I got your email Roger I am putting fixture and drawing information into the first few lines of the program. Some of the information I can take directly from Mastercam but not all of it. What I can not get from Mastercam is what is going into the buffer file. So then would a valid strategy be to check to see if my buffer file exists using the "fexist" command. If it does then proceed normally. If not then create the buffer (fbuf) with the second variable set to "1" (Keep flag)? Do you know if I can use a variable to define the file path for both the fexist and sbufname1$ commands? How do I get the quotes (") into the path variable? Thank you for your time
  5. I am using an ASCII text file to store buffer information generated or accessed during posting and as long as the file exists prior to program launch everything is hunky-dory. If the file does not exist then my approach fails miserably. Is there a way within the MP to check to see if a separate file exists and if not, create that file?
  6. The first one I tried was "ShowFolderSize()". I get the error "Path Not found". The file path I used does exist. When that didn't work I added "ShowFolderSize2()". That one bombed out, not surprisingly, on the "inforeader = My.Computer..." line. Is there any other direction you can suggest? Thank you again
  7. I am working on a program where I need to determine the physical file size of a graphics file. I have tried a few approaches and thusfar been unable to make them work. below are two of the methods I have tried unsuccessfully. Does anyone have any experience with this? Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() ' Call ShowFolderSize() Call ShowFolderSize2() End Sub Sub ShowFolderSize2() Dim infoReader Dim filesize Dim infoReader As System.IO.FileInfo infoReader = My.Computer.FileSystem.GetFileInfo("c:templayup.cgm") filesize = infoReader.Length Showstring ("File Size is: " & filesize) End Sub Sub ShowFolderSize() Dim FSO, F, FC, filename, filesize, strpartno strpartno = "c:templayup.cgm" Set FSO = CreateObject("Scripting.FileSystemObject") Set F = FSO.GetFolder(strpartno) filename = F.Name filesize = F.Size Showstring ("File Name is: " & filename) Showstring ("File Size is: " & filesize) End Sub
  8. I have a couple questions this time around. 1)The VB Script I am currently working on requires me to delete all splines on a given level. I have not found a way to do this. Any Suggestions? 2)My next question is when using “Call RunMastercamCommand("xxx")” The only way I can get this to work is by putting a ShowString right after it. I have tried putting a for-next loop in after the command with the counter up at 200000000 and the RunMastercamCommand still didn’t work. Example code: SelectAll () ShowString ("Enter to continue") Call RunMastercamCommand("simplify") ShowString ("Enter to continue") Call RunMastercamCommand("CombineViews") Showstring ("Enter to continue") Every ShowString requires the operator to hit the enter key and I would very much like to avoid that. Any Suggestions?
  9. Thanks Colin That works but I was hoping to run this without the user having to provide any additional input. The simplify bar shows up in the screen when the VB calls it and required the operator to click on the green check to proceed. I know that is pretty simple but the crew I am writing this for will do nothing but complain if I leave stuff like that in it. Does anybody know of a way to run simplify without having the additional user input?
  10. Is there a way to call the Edit/Simplify function from a VBS in X2? I want to search through all the elements on a given level for arcs with a common center point which when combined make a full circle (360 degrees). My problem is that some of the my arcs are coming in as splines so I want to change them to something I can look for. I know - too much information. I should have quit writing after my initial question.
  11. I am writing a VB script that uses a programmer defined point and then creates geometry based on that point location. The catch is I want to prompt the programmer to indicate a point on the screen (right click mouse) during the VB script then use that point location to add the geometry. Can this be done? If so, any one have any suggestions on how?
  12. Does anybody know if it is possible to use a VBS to remove a cylindrical piece of an existing solid in McX? If so, how is that done? Thank you for your help. RP
  13. Does anybody know if I can remove cylindrical pieces of a solid body using a VB script? If so, how would that be done? Thanks for the help RP

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...