-
Posts
4,477 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by Rekd™
-
-
Can you change the extension or remove it completely and resend it? hotmail doesn't like .VBS files.
-
email sent. Thanks
-
Ouch. I was afraid of that.
If you could send that v9 script I'd be much abliged.
What logic does MP use when assigning op_id's?? Oh, wait, never mind...
-
Don't call me Francis...
'Rekd teh waiting for the paddle and/or padlock...
-
Wow, trev, I didn't know that. Thanks!
BTW, this thread sure took a turn for the worst...
-
I'm trying to get Operation IDs from a post which includes operations not set to post as well as operations with different NCI destinations.
Reason being is that on parts with multiple setups I put the operations in the order that they run best when all setups are completed and I'm running a 'combined' program but can still post the single setups individually.
For example; My Ops Manager will contain ops in this order...
[*]1-[WCS: Op 1]- Mill Top
[*]2-[WCS: Op 1]- Rough Contour
[*]3-[WCS: Op 1]- Rough Contour
[*]4-[WCS: Op 2]- Rough Pocket
[*]5-[WCS: Op 4]- Rough Contour
[*]6-[WCS: Op 1]- Finish Contour
[*]7-[WCS: Op 2]- Finish Pocket
...
...
Each "WCS: OP x" has it's own nci destination which gets 'combined', posted then restored when i do a 'combined' NC file.
It works fine when posting the 'combined' program, but when I post single programs, each one starts with Op 1 and is sequential.
So where "4-[WCS: Op 2]- Rough Pocket" is really Op ID 4, it gets posted as Op ID 1 in the single programs.
(I use these Op ID numbers so the operators know which operation in Mastercam does that. The NC files and Setup Sheets have the Op ID numbers to help with the 100+ operation files )
According to the post pdf...
quote:op_idNotes:op_id will be a unique value for each operation,but do not assume that op_id from one operation to the next operation will be in numeric order.Is there any other way to get an 'ordered' operation list which includes all operations in the MC9 file?
-
H4X0R!!!!!!!!!!!!!!!
j/k
-
M19
-
code:
// get the current construction plane view number
Integer GetCPlaneNumber(void)// set the current construction plane view to a new numberVoid SetCPlaneNumber(Integer (Input: new view number))// set the current construction plane view to be perpendicular to a certain vectorInteger SetCPlaneNormal(Real, (Input: X-Coordinate of vector perpendicular to new view)Real, (Input: Y-Coordinate of vector perpendicular to new view)Real, (Input: Z-Coordinate of vector perpendicular to new view))// get the current tool plane view numberInteger GetTPlaneNumber(void)// set the current tool plane view to a new numberVoid SetTPlaneNumber(Integer (Input: new view number))// set the current tool plane view to be perpendicular to a certain vectorInteger SetTPlaneNormal(Real, (Input: X-Coordinate of vector perpendicular to new view)Real, (Input: Y-Coordinate of vector perpendicular to new view)Real, (Input: Z-Coordinate of vector perpendicular to new view))// get the current construction plane & tool plane to the graphics view flagBool GetCPlaneEqualGView (void)// set the current construction plane & tool plane to the graphics view flagVoid SetCPlaneEqualGView (Bool (Input: true to set construction & tool plane equal to graphics view flag))HTH
-
Hannita Varimill
-
Bill, I would stongly suggest some sort of backup routine. I've had some really bad crashes and lost dozens of hours of work on a few occasions..
This VB Script creates a .zip file using the MC file name, then adds the current MC9 file with a date/time stamp added to the end. It's sort of an incremental backup, keeping all dated mc9 files in the same zipped file.
code:'// Description: Makes a time/date stamped backup of the current MC file to the folder specified.
'// Use 7Zip 4.32 Command Line (7Za.exe) to compress the backup file. Once the file'// has been backed up, the dated MC9 file is deleted.'// You can get the command line interface at: www.7-zip.org'//'// Comments: Ensure the correct path and arguments for the compression'// you wish to use are entered below. You need to use the truncated name for'// long path names that contain spaces when calling 7za.exe.'// View the 7zip help file for command line options.' -----------------' | Constants |' ------------------------------------------------------------------------Public Const DEF_CENTERED = " "Public Const DEF_ERRLOG = "C:CustomersZip Backup Error.log" ' Path and file for error log'Public Const strZipPath = "C:Progra~1WinZipwzzip.exe -m -ex" ' Optional path and options for compression with Winzip.Public Const strZipPath = "C:PROGRA~17-Zip7za.exe a -tzip" 'Path and options for compressionPublic Const DEF_BACKUP_DIR = "C:Roling CustomersZipped Backups" ' Backup folderDim strBackupPath ' compiled path and file name with time stampDim strOriginalPath ' original path of current file nameDim strFilePath 'Dim FSODim strYearDim strMonthDim strDayDim strHourDim strMinDim CDim strNameC = Chr(34) ' holder for " (double quote)Call Main()Sub Main()Call RepaintScreen (True)On Error Resume Next' -- Check to make sure backup folder is validSet FSO = CreateObject("Scripting.FileSystemObject")If FSO.FolderExists(DEF_BACKUP_DIR) Then' -- Make sure we have a drawing to saveIf Not IsDrawing ThenShowString "No current drawing" & DEF_CENTERED' -- BailExit SubEnd If' -- Store current drawing's namestrOriginalPath = GetCurrentFileName' -- Format a time and date stamp and strip illegal charsstrYear = Replace(FormatDateTime(Date, vbShortDate), "/", "-")strHour = Replace(FormatDateTime(Time, vbShortTime), ":", "")' -- Build path for the MC9 file name with date/time stamp addedstrBackupPath = AddBackSlash(DEF_BACKUP_DIR) & FSO.GetBaseName(strOriginalPath) & "_" & strYear & "_" & strHour & "." & FSO.GetExtensionName(strOriginalPath)' -- Build path for .ZIP file, (MC9 file name without date/time stamp, reduces clutter)strFilePath = AddBackSlash(DEF_BACKUP_DIR) & FSO.GetBaseName(strOriginalPath) & ".zip"Call ClearMenuAndPrompts' -- Display current file in prompt areaCall WriteString("Backing up file, please wait..." & strBackupPath)' -- Save current file with new name and continueIf SaveMCAs(strBackupPath, True) Then' -- Build the command string for zipping (I'm having to truncate the exe's path, and' -- quote the zip name and file name, go figure..)strName = strZipPath & " " & C & strFilePath & C & " " & C & strBackupPath & C' -- Fire the zipping eventCall WriteString("Creating .zip file. Please wait..." & strFilePath)Call ShellAndWait(strName, True)' -- Error?ElseShowString "Could not backup file to " & DEF_BACKUP_DIR & DEF_CENTEREDEnd If' -- Switch back to original fileCall SaveMCAs(strOriginalPath, True)' -- Clean upCall ClearMenuAndPromptsCall RepaintScreen (True)Dim fsoDelFileSet fsoDelFile = CreateObject("Scripting.FileSystemObject")fsoDelFile.DeleteFile(strBackupPath)Else' -- Folder error. DOH!ShowString "Folder " & DEF_BACKUP_DIR & " does not exist!" & DEF_CENTEREDExit SubEnd If' -- Generate error message and clean upIf Err Then Call TrapError("Sub::Main", Err, True)Set FSO = NothingEnd Sub' -----------------' | Catch Errors |' ------------------------------------------------------------------------Sub TrapError(sSource, objErr, bLogIt)Dim sMSGDim sLogErrorDim FSOsMSG = "Following error occurred in this script:" & DEF_CENTERED & vbCrLf & vbCrLfsMSG = sMSG & objErr.Description & DEF_CENTERED & vbCrLfsMSG = sMSG & "Number: " & objErr.Number & DEF_CENTERED & vbCrLfsMSG = sMSG & "Source: " & DEF_CENTERED & sSourceShowString sMSGIf bLogIt ThensLogError = "Error " & objErr.Number & " in " & sSource & ":" & vbCrLf & objErr.DescriptionCall WriteLog(sLogError)End IfobjErr.ClearSet objErr = NothingEnd Sub' ----------------' | Script Engine |' ------------------------------------------------------------------------Function GetScriptEngineInfo()On Error Resume NextDim ss = "" ' Build string with necessary info.s = ScriptEngine & " Version "s = s & ScriptEngineMajorVersion & "."s = s & ScriptEngineMinorVersion & "."s = s & ScriptEngineBuildVersionGetScriptEngineInfo = s ' Return the results.If Err Then Call TrapError("GetScriptEngineInfo", Err, True)End Function' ----------------' | Add Backslash |' ------------------------------------------------------------------------Function AddBackSlash(sPath)If Right(sPath, 1) <> "" Then sPath = sPath & ""AddBackSlash = sPathEnd Function' -----------------' | Drawing exists? |' ------------------------------------------------------------------------Function IsDrawing()Dim RetRet = StartDBSearch(mc_alive, -1)IsDrawing = RetEnd Function
-
It's nice to see MP being picky about it's syntax as well. (It's still pretty relaxed though )
I should have seen it. All is working nicely now. Thanks!
-
Roger, using
code:pfixpath
indexpos = strstr(soldstring, soriginalpath)if indexpos <> 0,[# First part of string is now in ‘soriginalpath’stempstr1 = brksps(indexpos, soriginalpath)# Second part of string is now in ‘stempstr2’stempstr2 = brksps(strlen(soldstring)+1, stempstr1)# Stich ‘em all togethersnewpath = soriginalpath + srepstringsnewpath = snewpath + stempstr2]Gives me this error...
"Variable not defined: if"
(it's on the "if indexpos <> 0" line)
-
Is there a way to replace a string in a string?
I want to replace:
C:XXXXXX CUSTOMERSNCF FILESXX XXXXXXXXXXXXXXHOUSINGS680-003
with
C:XXXXXX CUSTOMERSSETUP SHEETSXX XXXXXXXXXXXXXXHOUSINGS680-003
TYIA
-
Thanks Bryan. Took me a few tries to get the syntax right, but it's working now.
code:spathnc = brksps(strstr(sncf, spathnc), spathnc)
Is there anything close to instrrev() ??
Any other tidbits? Or are they listed in the CD?
[ 04-22-2006, 01:12 PM: Message edited by: Rekd ]
-
"Oh yes why does every one use sequence numbers on every line? that gobbels up memory like no tomorrow."
Same reason I have so much data in the NC file; for the operators.
My programs tend to get very complicated very quickly, so I try to make it as easy as possible for those running the program to navigate around it and see what's going on.
code:(xxxxxxxx-4 REV F-1.NCF)
(APR 21, 2006 12:27)(MC9 FILE: xxxxxxxx-4 REV F)(MACHINE: 4 AXIS)(MATERIAL: ALUMINUM INCH - 6061)(STOCK SIZE: X 3.6 Y 3. Z .75)(TOOL 10: DIA 0.3750 R0.0150 3/8 Hannita Varimill 3Fl Rougher)(TOOL 2: DIA 0.2500 1/4 CB EM 2FL TICN)(TOOL 3: DIA 0.1250 1/8 Hannita Varimill 3Fl)(TOOL 4: DIA 0.1250 1/4 CHAMFER MILL)(OVERALL MAX Z1.)(OVERALL MIN Z-.53)N1 G00 G17 G40 G80 G90 G20N2 M01N3 ( OPERATION: 1 FACING )N4 (-- OP 1 )N5 (-- ROUGH FACE )N6 T10 M06 (T10: 3/8 HANNITA VARIMILL 3FL ROUGHER)N7 (-- OP ID: 1)N8 M03 S6500N9 G00 G90 G54 X-.2563 Y-.084 A0.N10 G43 H10 Z1./ N11 M08N12 Z.2N13 G01 Z.01 F100.N14 X3.6063 F156....N35 G00 Z1.N36 (OPERATION: 2 CONTOUR)N37(--OP 1)N38(--ROUGH CONTOUR)(T10: 3/8 HANNITA VARIMILL 3FL ROUGHER)( TOOLPATH - CONTOUR)( STOCK LEFT ON X & Y = .01)( STOCK LEFT ON Z = 0.)N39 (-- OP ID: 2)N40 X3.8175 Y1.325N41 Z.1I also made apps to remove sequence numbers and comments, just in case memory becomes a problem.
-
Here's a good example of using WHILE
code:while msg<5,
[result = updstr (smsg)smsg = wbuf(1, wc1)msg=msg+1]
-
Are there any functions in MP to parse strings? i.e. Instr(), Mid(), Replace() etc.
Is there a way to count ALL operations during posting the current MC9 file, even if some ops are set NOT to post?
Also, I see things like
fexist(sfilename2)
and
remove(sfilename2)
and
ex
I can guess what they're for (well, cept for EX), but are there more? Are they listed in my (extremely old) Post book that I haven't unpacked since the move?
Thanks!
-
Here's another good example.
code:pwcs # G54+ coordinate setting at toolchange
if wcstype < two, "G92"if wcstype = two | wcstype > three,[if workofs < 0, workofs = 0if workofs < 6,[g_wcs = workofs + 54*g_wcs]else,[p_wcs = workofs - five"G54.1", *p_wcs]!workofs]if wcstype = three, "-"
-
Here's a sample of a nested IF/ELSE statement.
code:if opcountpg = ops_per_pg & page_breaks,
[#Page break"<br style=", 34, "page-break-before:always;", 34, ">", eif list_type = 0, "<p><b><font SIZE=+1>OPERATION LIST - CONTINUED...</font></b></p>", eelse, "<p><b><font SIZE=+1>TOOL LIST - CONTINUED...</font></b></p>", eopcountpg = 0]HTH.
-
Been busy like a mofo, connormac. Between work and the weenies that sold us our house, I can hardly find a minute to scratch my ....
Kelly, its a program I made in Visual Basic. It reads the NCF files, strips the "%" signs, and combines them all together in one file, then adds the "%" back. You can edit files before they're merged, or edit the merged file.
It's set up to be able to send that file to a floppy, or to a machine, (right now, just SComm, but anything is possible)
-
I do it all the time. It gets tiresome after a while having to do all those edits to so many files, so I (of course) made a VB app to do it for me.
It takes files via drag-drop, a file dialog, or from the command line.
Lemme know if interested.
-
I got the one email "forgot one', with 2 files.
THANKS!
-
Still alive and getting kicked. Err, I mean kicking!
If you sent that to my cox account, I no longer have it. Use the addy in my profile.
Post: Count All Operations (op_id)
in Mastercam C-Hook, NET-Hook and VBScript Development
Posted
Thanks. I'll play around and see what I come up with.