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:
Anybody else notice that this function does not work?
I have the following test code:
'///////////////// My Constants /////////////////
Const strFile1 = "D:McamX2mcxtest1.mcx"
Const strFile2 = "D:McamX2mcxtest2.mcx"
' -- Start Script
Call Main()
' ////////////////////
' Sub Declaration
' ////////////////////
Sub Main() 'Test merge function in MR2
If MergeMC(strFile1) = False Then
ShowString ("Merge Failed on " & strFile1)
End If
If MergeMC(strFile2) = False Then
ShowString ("Merge Failed on " & strFile2)
End If
End Sub
I end up with only test file 2 open.
Is this a bug?
I need this to work in order to convert my Ver. 9 scripts into X.
Until I figure this out I'm stuck in ver. 9
Thanks,
Karl
I need to import a complete iges file as say color 10 then import another iges into the same file as say color 94 and so on... When the script is done I need to have 1 MC file comprising the 4 or 5 seperate iges originals. It would be nice if each portion was a different
color and or level.
Hi All,
Anybody know of a way to set the active/current color thru a VB Script? I need to import a series of IGES files and would like each them to come in a different color.
Karl
I have a post question getting the programmer name already. But I am trying to eliminate the post question. We need the question because we have 1 post file on a network drive for 3 different programmers.
Any suggestions on how to get the MAC from the post?
Karl
Here is one for the post guru's here. Is there any way for a post to determine the what the computers' name is?
I would like the post to set a varaible for the programmers name based upon what computer the post is run from.
thx
Karl
Anybody know if it is possible to twist a plane inside a vb script? I can use the setplanenormal(x,y,z), but this is a 2 dimension rotation only. We constantly have to create a new plane by rotating about "z" then rotate about "Y". It would be nice to have a function to create a plane given three points to incorperate any twisting.
Karl
We have camworks also here. It works very well for things that fit the same mold. Surfacing is weak only because it's not intutive what every option does. I personally do not like the interface. If you have any specific questions ask away!
Karl
There is not of debugging help for mc vb. I started using a const debug = true / false then
where I needed to know a variable value I use the following
if debug = true then
showstring("Variable ? = " & Variable )
end if
Works well for me
Karl Stickel
I've need a VB script to merge a file into an existing mcx file. The script works except it does not merge. It acts as if I used openMC
The offending code is below.
If FSO.FileExists(DEFMastercam_Folder & strJobNumber & "vr.mcx") Then ' File found
If Not MergeMC(DEFMastercam_Folder & strJobNumber & "vr.mcx") Then
ShowString("Could not merge file " & DEFMastercam_Folder & strJobNumber & "vr.mcx")
End If
Else
ShowString ("File " & DEFMastercam_Folder & strJobNumber & "vr.mcx Not Found.")
Exit Sub
End If
Is there anything wrong or is this a VB bug?
Any suggestions or comments welcome.
Karl
p.s. Sorry the indents did not paste propely.
it sure makes it harder to read
I do not know why but if I take off all the header info that MC creates for a new script the file works. Somehow there is possibly a non-printable character, or ascii character there.
Karl
I have a script that I can view in any editor including the mastercam vb editor. However when I try to run this script I get this error message.
Anybody know what the cause is? I have looked at the code til my eyes are red and do not see any errors but I can't run the script to see if it even works
Karl
I hope the image works it's the first time adding an image.
Thanks for all the replies. I will try the set construction C-hook route for now. I knew there had to be an answer and it was to be found here.
Thanks again all
Karl
Pete, The SetCPlaneNumber() does set the plane but the goemetry I always have to modify is in the top plane just at a different "z" height. I will try to automate the entire process. I just put a fillet on two entities in the top plane. The z is based on calculations from an automaticly generated text file.
Karl
Thad, The mastercam.ft shows what I presume to be c language commands ( I don't know c yet!!! )
Colin, Is this function for a c compiler also???
I was hoping that there was an easy way to do it with VB.
Anybody know how a vb script can do this?
Karl
Sorry, I did not make my self clear.
I need to set the construction depth to a value that I have read from a text file. I already have the actual value stored as a numeric variable.
Karl
I'm working on a script in whitch I need to merge several mastercam files while keeping the machine def and all operations intact.
I am using this code:
If Not MergeMC(strCompletePath) Then ' open file
ShowString ("Could not open file " & strCompletePath )
End If
It brings in the file but does not merge the file.
Machine def and ops ar gone as though I used OpenMC.
I'm taking a working script from 9 and tring to convert to MCX.
Oh still using ver X MR1.
Karl
If you mean the EA manager, it's available at the bottom of the screen under the attributues button.
Turn on the EA manager then click on the button to set things how you want.
Karl
Thanks for the replies.
I definitly have right access to the folder as ver. X and ver. 9 are configured to use the same directory for the .nc files.
I tried posting to a temp dir on the c: drive and still no luck.
Will try the post guys with the zip 2 go.
While waiting any other sugestions?
Karl
Hi Jim,
I posted the file to the desktop as well to it's correct directory and it really does not exist. We are using the standard .nc extension as well. The log file did not turn up on the desktop or the correct directory. I did a file search ( assuming a .log extension ) and no log file. All settings were migated corectly. This was a fresh install to a different directory, not an update.
Karl
Anybody know how to fix the problem of post not outputting any code. Post was working and proven in X.
After going to MR1 post does not work.
There is a question in the post and the dialog box for the question does not pop open. I tried to keep a log file can't find where it is being saved if it was even created.
Post dialog window says post completed sucessfully, then editor crashes because nc file does not exist.
anybody have this problem and know of the fix.
Karl
I need to bring an existing file into mastercam (X) with out changing the machine def or toolpaths (exactly like ver 9 file merge function) usins a VB Script. Is this posible is X???
Here is the code snippet that worked in ver. 9
If btnMPB = "MPB = 1" Then
If fso.FileExists(DEF_Pin_Boss_Path & intJobNumber & "mb.IGS") Then
bFileFound = True
ImportFile(DEF_Pin_Boss_Path & intJobNumber & "mb.IGS")
Call RunMastercamCommand("fit")
End If
thanks in advance
Karl
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.