Mastercam Help

Embed Size (px)

DESCRIPTION

help

Citation preview

Is there a way to convert drafting notes into machinable geometry

Is there a way to convert drafting notes into machinable geometry? Customer sent a file with lots of engraving done to it. It would be much quicker to work off his notes than to create my own letters...

Modify-break-Draft\line

You change Hatch Lines to standard lines to.Using Break Hatch\Line

this way you can machine them both.

Andrew, Since V7 you can convert a library to a text file and work with it in excel or an editor and then convert back from text.

Right-click in the tool library to select those functions.

Hi,

this is "wannabe" C-hook programmer again. What follows is a part of testassc.c example. Before running c-hook, I created a drill operation (it is expected to exist). The question is: why don't I see any "little teapot" text in the generated .nci file?

Thanks,Marko===============#include "m_vars.h"#include "m_init.h"#include "m_assoc.h"

static void error(const char *s) {MessageBox(0, s, "Test", MB_ICONASTERISK);}

static void test_nci_mgr (boolean *succf) {operation op;nci_bin n;db_ptr_type e_ptr;long fpos;tl_list *tl;

// regenerate ALL operations that require regeneration (op.db.nci_flag == TRUE)nci_manager (0, NCIMGR_REGEN_ALL, &n, &fpos, succf);if (!*succf) { error("NCIMGR_REGEN_ALL"); return; }

// post ALL the operationsnci_manager (0, NCIMGR_POST_ALL, &n, &fpos, succf);if (!*succf) { error("NCIMGR_POST_ALL"); return; }

// set binary nci file ptr to the end of the binary nci filenci_manager (0, NCIMGR_FEND, &n, &fpos, succf);if (!*succf) { error("NCIMGR_FEND"); return; }

// make a manual entry operation using the 1st tool found in the databasememset (&op, 0, sizeof (operation));op.opcode = TP_MANUAL_ENTRY;// get a list of tools from the databaselist_manager (TL_ID, "", LSTMGR_GET, &tl);if (tl != NULL){op.tl.slot = tl->tl.op.slot; // set the tool # if you want the operation to init the toollist_manager (TL_ID, "", LSTMGR_FREE, &tl); // free the tool list}// add a commentstrncpy (op.comment, "I'm a manual entry operation", COMMENT_SIZE-1);// OPMGR_INIT_ADD writes the 'start of section' - // no need to call nci_manager (NCIMGR_WR_SOS) - OPMGR_INIT does not write the sosoperation_manager (&op, OPMGR_INIT_ADD, &e_ptr, succf); if (!*succf) { error("OPMGR_INIT_ADD"); return; }

// go to the end of the binary ncinci_manager (0, NCIMGR_FEND, &n, &fpos, succf);if (!*succf) { error("NCIMGR_FEND"); return; }

// write the start of file - sof, tool info and (if turned on) parameters// set the rapid position to X1 Y2 Z0 for the 1002 linememset (&n, 0, sizeof (nci_bin));n.gcode = NCI_RAPID; // gcode for sof must be NCI_RAPID or NCI_LINEARn.op_idn = op.op_idn; // ALWAYS assign the parent operation's id number to all nci linesn.tp_ent_idn = 0; // set this to 0n.u.m0.ep1[X] = 1.0; // home position Xn.u.m0.ep1[Y] = 2.0; // home position Yn.u.m0.ep1[Z] = 0.0; // home position Znci_manager (op.op_idn, NCIMGR_WR_SOF, &n, &fpos, succf);if (!*succf) { error("NCIMGR_WR_SOF"); return; }

// write some comments to the binary ncimemset (&n, 0, sizeof (nci_bin));n.gcode = NCI_COMMENTNO;n.op_idn = op.op_idn;n.tp_ent_idn = 0;strncpy (n.u.m1005.comment, "I'm a little teapot short and stout", COMMENT_SIZE-1);nci_manager (0, NCIMGR_WR, &n, &fpos, succf);if (!*succf) { error("NCIMGR_WR 1"); return; }strncpy (n.u.m1005.comment, "This is my handle", COMMENT_SIZE-1);nci_manager (0, NCIMGR_WR, &n, &fpos, succf);if (!*succf) { error("NCIMGR_WR 2"); return; }strncpy (n.u.m1005.comment, "This is my spout", COMMENT_SIZE-1);nci_manager (0, NCIMGR_WR, &n, &fpos, succf);if (!*succf) { error("NCIMGR_WR 3"); return; }

// now write the 'end of section' marker for the new operationmemset (&n, 0, sizeof (nci_bin));nci_manager (op.op_idn, NCIMGR_WR_EOS, &n, &fpos, succf);if (!*succf) { error("NCIMGR_WR_EOS"); return; }

// or you could write the end of section with the operation_manager as shown// operation_manager (&op, OPMGR_NCI_ACCEPT, &e_ptr, succf);

// let's post the new operationnci_manager (op.op_idn, NCIMGR_POST_ONE, &n, &fpos, succf);if (!*succf) { error("NCIMGR_POST_ONE"); return; }}

void CH_ENTRY m_main(long *ptrs) {boolean succf;if (!open_app(ptrs))return;test_nci_mgr (&succf);close_app(ptrs);}

Some suggestions:

1 - Make sure the succf flag's are returning a value of TRUE after writing the comment lines.

2 - Make sure you're writing the NCI_EOS line after those comment lines.

3 - The NCI result you're looking is after the binary nci has been converted to ascii. To see what's really in your nci file call up the operation manager, hold down the Ctrl and Shift keys and double-right mouse click on the title bar (or anywhere off a control) of the Operation Manager. This will give you access to a super-duper secret debugging utility known only to a chosen few where you can select and display the contents of the binary nci file. Make sure those comment lines are in there. If not, it's gotta be something simple you're overlooking. Millman,

Here is the file generated by the .set template. The VB code I use in Access parses the part data and tool data, then exports the tool data to a csv format which is imported to the current record on a sub form, along with the part data.code:

-------------------------------| This file is automatically || generated. Do Not Change It. || Design by Matthew Finley | ------------------------------- StartPart:ProgramName = XXXXXX-001 REV A.NCFMastercamName = XXXXXX-001 REV A.MC9ProgramNumber = O0001ProgramDate = 08/28/03MaterialType = ALUMINUM inch - 4047WorkOffset = G54StockSize = X 12.0000 Y 6.0000 Z 0.0300StockOrigin = X-.05 Y-.05 Z0. From Part ZeroPartOrigin = Z0 Top, X0 Y0 on Front Left CornerStartTools:ToolID;ToolNumber;Dia;Flutes;TLO;CRC;Len;FLen;Depth;ToolDescription;MfgCode01;0.0938;4;01;01;0.5000;0.3000;-0.0200;3/32 CB EM 4FL TIALIN;71240-09430S00002;0.2500;1;02;02;1.0000;0.5000;-0.0070;1/4 CHAMFER MILL;72110-2500SS09003;0.0938;4;03;03;0.5000;0.3000;-0.0280;3/32 CB EM 4FL TIALIN;71240-09430S000EndToolsCycleTime = 0 Hrs, 17 Min, 16.59 Sec

The tools, material, customer and machines are stored in different tables than the part data. The database assigns a ToolID to the current record, and links to that tool table. (There's lots of redundancy here, but I'm working on a method for the tool table to remove duplicates, and assign similar tools to multiple records.)

It's a very nice setup sheet if I do say so myself, and yes, I plan on marketing it when it's done.Millman,

Here is the file generated by the .set template. The VB code I use in Access parses the part data and tool data, then exports the tool data to a csv format which is imported to the current record on a sub form, along with the part data.code:

-------------------------------| This file is automatically || generated. Do Not Change It. || Design by Matthew Finley | ------------------------------- StartPart:ProgramName = XXXXXX-001 REV A.NCFMastercamName = XXXXXX-001 REV A.MC9ProgramNumber = O0001ProgramDate = 08/28/03MaterialType = ALUMINUM inch - 4047WorkOffset = G54StockSize = X 12.0000 Y 6.0000 Z 0.0300StockOrigin = X-.05 Y-.05 Z0. From Part ZeroPartOrigin = Z0 Top, X0 Y0 on Front Left CornerStartTools:ToolID;ToolNumber;Dia;Flutes;TLO;CRC;Len;FLen;Depth;ToolDescription;MfgCode01;0.0938;4;01;01;0.5000;0.3000;-0.0200;3/32 CB EM 4FL TIALIN;71240-09430S00002;0.2500;1;02;02;1.0000;0.5000;-0.0070;1/4 CHAMFER MILL;72110-2500SS09003;0.0938;4;03;03;0.5000;0.3000;-0.0280;3/32 CB EM 4FL TIALIN;71240-09430S000EndToolsCycleTime = 0 Hrs, 17 Min, 16.59 Sec

The tools, material, customer and machines are stored in different tables than the part data. The database assigns a ToolID to the current record, and links to that tool table. (There's lots of redundancy here, but I'm working on a method for the tool table to remove duplicates, and assign similar tools to multiple records.)

It's a very nice setup sheet if I do say so myself, and yes, I plan on marketing it when it's done.What Prosoft is wanting to know, is wether Mastercam can provide a roughing path which can do a standard OD rough pattern, but at the end of the pass "stop short" of the end of the contour, retract, and then face rough the end of the contour. The reason for this, is that a potential customer of his, is looking at purchasing Mastercam. They machine a lot of stainless steel components, and when machining the second op, if they use the above method, it removes the "waste ring" of material that is left, which can jam against the jaws, and/or hammer the insert.Yet it can be done quickly and I do it in such a way.You are talking about roughing , right .I write a rough pass I depth only compensation to computer .Backplot my geometry and save it .Now i build an add-on for a center of the mill.I replace my original geometry with a backplotted and add my add on geometry ,change compensation type to off , add depth cuts->depth cuts order by depth and here we are !

OK friends, here's my suggestion, use the "Direction" switch on the second page of the toolpath parameters page. You can control plunge angle as well as approach angle at the same time for entry and exit.... and a pond further reading, if the customer/potential customer wants the ability to add cutter comp to the path, just go into the "Toolpath Editor", find the point before the approach and turn comp on, find the last pass, and where the exit is (using "Direction" in conjunction with this gives clean results) turn comp off.

Is there a variable available that records the last Y axis position?

I beg it differ - it always works and you do know what the value in the 'prv' variable is.

A 'prv_[varname]' is automatically created by MP for every numeric variable.

The prv_[varname] variable is always loaded with the value of the [varname] variable every time the value in [varname] is output to the NC file, or you can explicitly force this update from the value in [varname] to prv_[varname] by using the '!' prefix.

Example:!xabs, *yabs

Would copy the current value in 'xabs' into 'prv_xabs'. Note that using the '!' this update occurs WITHOUT any output being written to the NC file.

'prv_yabs' would also get loaded from 'yabs' in this example because it's value was FORCED to output to the NC using the '*' prefix.

There's a few tricks to do what you want. The one I prefer requires you to have your center drill, drill & reamer operations already saved in a library and goes like this:

METHOD #1

1 - Start a drill operation and pick your points.

2 - On the first page of the drill parameters, right click in the tool list pane. Select Get operations from library...

3 - Select your center drilling, drilling, reaming, etc operations from the library and hit OK.

4 - Say NO to the Import/add the operation groups also? question.

5 - Say NO to the Retain depth values of merged points? question.

Unknown the the user (that's you), the system has now created a new operation for each operation you selected to import and they all share the same points.

6 - Select the OK button (without having to fill in any other parameters).

7 - Say NO to the Create the current operation in addition to the ones you have imported? question.

*** You now have operations that all share the same points. This is very powerful as you can execute this method and share geometry on ANY type (drill, msurf, etc) of existing operation at any time and import any operation from any library or other Mastercam MC9 file. ***

METHOD #2

1 - Create your first drilling operation (let's say it's the center drilling one) like you usually would.

2 - Create your next drilling operation, but instead of select point geometry, select the Subpgm ops option.

3 - Select the center drilling operation that you created in step #1 from the list and hit OK .

4 - Fill in your parameters like normal and hit OK .

*** Your second operation is now associated and shares the same points as the first operation. Change/delete a point in the first operation and regenerate and the second operation will regenerate also. ***

METHOD #3

1 - In the operation manager, create a new operation group (or use an empty one that contains no operations).

2 - Import your center drill, drill & reamer operations from your library into this new group.

3 - Edit the geometry for the first operation and add your points. Select OK .

4 - In the operation manager drag the points from the geometry branch of the first operation to the group name. Select the Replace option.

*** This deletes all the geometry from all the operations in the group (which there was none in all but the first operation anyway) and stuffs in the points from the first operation. ***

Draw a tic-tac-toe board and put a border around it. Each of the squares formed this way is one patch, so this coons surface will be three along by three across. In the along direction there will be 4 contours, each consisting of three segments. In the across direction there will also be four contours, each consisting of three segments. To chain the surface correctly, you will need to break each contour at it's intersection points. The wireframe will look something like this:code:

Coloumns:

1 2 3 4 |---+---+---| prv_progno, [peof, pheader, ]-----------------------------------Millman, here's a sample of a routine I made for HAAS to use the G187 .0003 corner rounding function via Misc Values...code:

pcorner_round#corner rounding () if mi5 = 1 & mr5 > 0 & flg_mi5 = 0, [ sav_mr5 = mr5, pbld, n, "G187", *sav_mr5, e flg_mi5 = 1 ] if mi5 = 1 & mr5 = 0, [ "( WARNING!! CORNER ROUNDING CONTROL HAS )", e "( BEEN ENABLED WITHOUT A VALUE SET! USE )", e "( MISC VALUES-MISC REALS TO SET A VALUE )", e "( CORNER ROUNDING CONTROL IS DISABLED )", e ] if mi5 = 0 & flg_mi5 = 1, [ n, "G187", e flg_mi5 = 0

]

Then when I want to test for it, like during a tool change... you just call it like so..code:

ptlchg #Tool change () pcorner_round pcuttype toolchng = one toolcount = toolcount + 1 if toolcountn