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:

Can this be done and if so how??


Recommended Posts

I make all my set-up sheets in Mastercam. I have a template file that has my sheet information on it. I merge the file with my set-up sheet and the nchange the date, operation, Part #, Part Rev, Program Rev, and file name per part. Can you make a script to pull this information out of the operations manger and some operations where it is stored as mr variables and have it post up on the screen in those places which stay constant every time?? Just looking for something to speed things up when doing this. What are the guru's thoughts on this possible or this is just not enough parsing capability in Mastercam to do this?

 

Another thing could be something like X+ where you have template you impose on top of printing that merge the template extract information put it in those blocks using a .xlt template and script and then merge the screen shot of the set-up sheet with the .xlt template that pulled out the extracted data. Then o course the hard part would be making code that would do all of that.

Link to comment
Share on other sites

Most anything can be done, given enough time and $$$. wink.gif

 

"Can you make a script to pull this information out of the operations manger and some operations where it is stored as mr variables"

 

If by 'script' you mean VBScript - I highly doubt that.

To "walk" down thru the Operations in the OpMgr and dump some of the data contained in those Ops is not really that difficult - but a CHook is going to be the only way to get that "deep" into Mastercam's OpMgr.

Pulling 'mr' and/or 'mi' data is also possible, but a bit more involved. MR/MI data is in the NCI at each toolchange and Null Toolchange, so I'd assume you'd only want to capture the MR/MI's at a "real" toolchange.

All certainly doable - given enough time.

And extracting this data is only the start. Now you need a way to generate a report (aka. Setup Sheet) from this raw data.

 

Sample of some Op. data dumped out to an XML file...

 

code:

<?xml version="1.0" encoding="UTF-16" ?> 

<OP_DATA>

<VERSION>0.09</VERSION>

<SOURCE>X3</SOURCE>

<DATE_LONG>Friday, February 01, 2008</DATE_LONG>

<DATE_SHORT>02/01/2008</DATE_SHORT>

<TIME>00:00:00.00</TIME>

<YEAR>2008</YEAR>

<OPERATIONS>

<OPERATION type="Contour">

<COMMENT>Comment on Op#1</COMMENT>

<OP_ID>1</OP_ID>

<OPCODE>1</OPCODE>

<TOOL>

<TOOL_TYPE>10</TOOL_TYPE>

<TOOL_RADIUS_TYPE>0</TOOL_RADIUS_TYPE>

<CORNER_RADIUS>0.0</CORNER_RADIUS>

<TOOL_NAME>1/2 inch Flat Endmill</TOOL_NAME>

<TOOL_NUMBER>10</TOOL_NUMBER>

<DIAMETER_OFFSET>10</DIAMETER_OFFSET>

<LENGTH_OFFSET>10</LENGTH_OFFSET>

<RPM>1069</RPM>

<FEEDRATE>6.4176</FEEDRATE>

<PLUNGE_RATE>6.4176</PLUNGE_RATE>

<RETRACT_RATE>25.0</RETRACT_RATE>

<TOOL_DIAMETER>0.5</TOOL_DIAMETER>

<NUMBER_FLUTES>4</NUMBER_FLUTES>

<TIP_ANGLE>45.0</TIP_ANGLE>

</TOOL>

<CUTTER_COMP>

<CC_TYPE>Computer</CC_TYPE>

<CC_OPTIMIZE>No</CC_OPTIMIZE>

<CC_DIRECTION>Left</CC_DIRECTION>

<CC_ROLL>Sharp</CC_ROLL>

</CUTTER_COMP>

</OPERATION>

<OPERATION type="Contour">

<COMMENT />

<OP_ID>2</OP_ID>

<OPCODE>1</OPCODE>

<TOOL>

<TOOL_TYPE>10</TOOL_TYPE>

<TOOL_RADIUS_TYPE>0</TOOL_RADIUS_TYPE>

<CORNER_RADIUS>0.0</CORNER_RADIUS>

<TOOL_NAME>1/8 FLAT ENDMILL</TOOL_NAME>

<TOOL_NUMBER>232</TOOL_NUMBER>

<DIAMETER_OFFSET>232</DIAMETER_OFFSET>

<LENGTH_OFFSET>232</LENGTH_OFFSET>

<RPM>4278</RPM>

<FEEDRATE>6.1609</FEEDRATE>

<PLUNGE_RATE>6.1609</PLUNGE_RATE>

<RETRACT_RATE>6.1609</RETRACT_RATE>

<TOOL_DIAMETER>0.125</TOOL_DIAMETER>

<NUMBER_FLUTES>4</NUMBER_FLUTES>

<TIP_ANGLE>180.0</TIP_ANGLE>

</TOOL>

<CUTTER_COMP>

<CC_TYPE>Computer</CC_TYPE>

<CC_OPTIMIZE>No</CC_OPTIMIZE>

<CC_DIRECTION>Left</CC_DIRECTION>

<CC_ROLL>Sharp</CC_ROLL>

</CUTTER_COMP>

</OPERATION>

<OPERATION type="Contour">

<COMMENT />

<OP_ID>3</OP_ID>

<OPCODE>1</OPCODE>

<TOOL>

<TOOL_TYPE>10</TOOL_TYPE>

<TOOL_RADIUS_TYPE>0</TOOL_RADIUS_TYPE>

<CORNER_RADIUS>0.0</CORNER_RADIUS>

<TOOL_NAME>1/16 FLAT ENDMILL</TOOL_NAME>

<TOOL_NUMBER>230</TOOL_NUMBER>

<DIAMETER_OFFSET>230</DIAMETER_OFFSET>

<LENGTH_OFFSET>230</LENGTH_OFFSET>

<RPM>8556</RPM>

<FEEDRATE>6.1609</FEEDRATE>

<PLUNGE_RATE>6.1609</PLUNGE_RATE>

<RETRACT_RATE>6.1609</RETRACT_RATE>

<TOOL_DIAMETER>0.0625</TOOL_DIAMETER>

<NUMBER_FLUTES>4</NUMBER_FLUTES>

<TIP_ANGLE>180.0</TIP_ANGLE>

</TOOL>

<CUTTER_COMP>

<CC_TYPE>Computer</CC_TYPE>

<CC_OPTIMIZE>No</CC_OPTIMIZE>

<CC_DIRECTION>Left</CC_DIRECTION>

<CC_ROLL>Sharp</CC_ROLL>

</CUTTER_COMP>

</OPERATION>

<OPERATION type="Canned Cycle">

<COMMENT>Comment on Op#4 - DRILLING</COMMENT>

<OP_ID>4</OP_ID>

<OPCODE>2</OPCODE>

<TOOL>

<TOOL_TYPE>3</TOOL_TYPE>

<TOOL_RADIUS_TYPE>0</TOOL_RADIUS_TYPE>

<CORNER_RADIUS>0.0</CORNER_RADIUS>

<TOOL_NAME>NO. 34 DRILL</TOOL_NAME>

<TOOL_NUMBER>58</TOOL_NUMBER>

<DIAMETER_OFFSET>58</DIAMETER_OFFSET>

<LENGTH_OFFSET>58</LENGTH_OFFSET>

<RPM>2409</RPM>

<FEEDRATE>4.23986</FEEDRATE>

<PLUNGE_RATE>4.23986</PLUNGE_RATE>

<RETRACT_RATE>4.23986</RETRACT_RATE>

<TOOL_DIAMETER>0.111</TOOL_DIAMETER>

<NUMBER_FLUTES>2</NUMBER_FLUTES>

<TIP_ANGLE>118.0</TIP_ANGLE>

</TOOL>

<CUTTER_COMP>

<CC_TYPE>Off</CC_TYPE>

<CC_OPTIMIZE>No</CC_OPTIMIZE>

<CC_DIRECTION>Left</CC_DIRECTION>

<CC_ROLL>Sharp</CC_ROLL>

</CUTTER_COMP>

</OPERATION>

</OPERATIONS>

</OP_DATA>

Link to comment
Share on other sites

I follow that, but know dump that back into a level inside of Mastercam assigning a tag to a certain position or place holder so to speak and have the vaule you extracted from the script to the level or place that I keep my Solid Layout Set-Sheet on when making my Visual Set-up sheets.

 

Maybe ot be a little clearer I am not looking for something like X= this conpect is totally different. Solidworks, Pro-E, Catia can all take information from the CAD model and make it output to the Drawing template when making a 2d drawing. I am looking to do the same thing, but all my information is stored in the operation Manager not a Soild Tree though I would not be against putting it there if we could pull data out of the tree though I think not possible at all due to Mastercam solid tree limits. So anyway I am always making in essence 2d drawings using solid layout and now I take a Mastercam file that has my drawing box template and then merging it with the Mastercam file I am making the Drawing for. Be very cool to hit a button and pull the Data out of the operation manager, 1st operation's mr values and file name and then have them automatically file in my template.

 

Here is my template set-up and use: TEMPLATE.jpg

Link to comment
Share on other sites
  • 1 year later...

Hello all,

 

Roger, thanks for the prompt reply.

What I would like to extract is a group name, list of operations in a group, tool path parameters for each operation, contour or drill parameters as operation dictates. Tool information other then tool name for operation is not critical.

It probably should be something like this

'<' OPERATION_GROUPS '>'

'<'OPERATION_GROUP '>'

'<'GROUP NAME'>' "foo" '<'/GROUP_NAME'>'

'<'OPERATIONS'>'

'<'OPERATION'>'

'<'NAME'>' "bar" '<'/NAME'>'

'<'OPERATION type="Contour"'>'

'<'COMMENT'>'Comment on Op#1 '<'/COMMENT'>'

'<'OP_ID'>'1'<'/OP_ID'>'

'<'OPCODE'>'1'<'/OPCODE'>'

'<'TOOL'>'

'<'TOOL_TYPE'>'10'<'/TOOL_TYPE'>'

'<'TOOL_RADIUS_TYPE'>'0'<'/TOOL_RADIUS_TYPE'>'

'<'TOOL_NAME'>'

1/2 inch Flat Endmill'<'/TOOL_NAME'>'

...

'<'/TOOL'>'

'<'TOOLPATH_PARAMETERS'>'

...

'<'/TOOLPATH_PARAMETERS'>'

'<'DRILL_PARMETERS'>'

...

'<'/DRILL_PARMETERS'>'

'<'CONTOUR_PARMETERS'>'

...

'<'/CONTOUR_PARMETERS'>'

'<'/OPERATION'>'

'<'/OPERATIONS'>'

'<'/OPERATION_GROUP'>'

'<'/OPERATION_GROUPS'>'

 

[ 04-17-2009, 02:18 PM: Message edited by: FV ]

Link to comment
Share on other sites

Ron

If you use the post to output the op info to a text file (either buffer or one of the predefined subs) then at the end of posting you can have the post launch a script.As Roger said the scripting isn't powerful enough on its own, but you can have it call a .dll . The dll can read the afore mentioned text file and do anything you can write in vb or whatever you language you prefer.

 

I used an example from Mick to launch a dll in the Barefoot_ellipse script on the ftp site. Call me if you need some help with this.

Link to comment
Share on other sites

Hello all,

 

I would appreciate getting some pointers or hints of how to programatically read information stored in .operations file ( operations library). The next step which is walking down operation tree and related nci elements seems to be straightforward.

The missing information is how to access data stored in library files? Does one need to cin raw data and unpack it into srutcures or there is a c-hook function which opens and processes the operation library data? After RTFM'ing over and over again I seems to be at lost...

TIA.

FV. banghead.gif

Link to comment
Share on other sites

This I understand ->

"...walking down operation tree and (retrieving) related nci elements...

 

But, why do you wish to pull data directly from an OPERATIONS file (on disk)?

What would you be looking for in the OPERATION file?

 

If you absolutely want to suck data from an OPERATIONS file, you can 'load' it into Mastercam's database (as an MCX, 'cause that's what it is!) and then ->

"...walk down operation tree and (retrieving) related nci elements...

 

[ 04-22-2009, 04:40 PM: Message edited by: Roger Martin from CNC Software ]

Link to comment
Share on other sites

Hello all,

quote:

If you absolutely want to suck data from an OPERATIONS file, you can 'load' it into Mastercam's database (as an MCX, 'cause that's what it is!) and then ->

"...walk down operation tree and (retrieving) related nci elements...


Thanks Roger, for some reason I was thinking there should be a separate read function for libraries...

 

 

quote:

But, why do you wish to pull data directly from an OPERATIONS file (on disk)?

What would you be looking for in the OPERATION file?

Imagine a number of NC programmers using local .operations files. Each of them most probably made some changes/improvements/tweaks over the years...

In an infinite wisdom of standartizaton/unification/six sigmas/lean and so on... there is a push to consolidate all of it. Information stored in operation libraries needs to be analyzed/compared/categorized and eventually the best practices would surface. To pipe info from libraries through some stream processor would seem to be a reasonable way to avoid massive man-hours.

 

FV.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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...