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:

Customizing Set-Up sheets by isolating the XML file. (X9)


e_ham
 Share

Recommended Posts

I have successfully created an Excel sheet that pulls in XML data by using the mapping feature under developer in Excel. So how it works is when I run the ActiveReport it creates an XML file and a bogus setup sheet. I then go to my excel sheet that I have fully customized to our liking and pull in the XML file that was just created and it populates all of the fields I need. 


 


My question is: How do I isolate the XML file? I want to be able to save it with a name that would overwrite the last XML file Mastercam had created. For example, always call the XML files "Setup sheet" because my Excel sheet will always refresh off of that file name in that location. That way the other engineers don't have to select the new file from the excel sheet; they can simply click a refresh button in Excel. I am trying to automate this process as much as possible. I would prefer a method that doesn't require actually creating an ActiveReport that we won't use. I was hoping for a simple Save or Export data as XML, but it is Mastercam so who knows. 


 


Maybe there is a 3rd party application to do this under Settings->Configuration->Toolpaths. 


 


 


Thanks in advance for any ideas.


Link to comment
Share on other sites

I don't see anything that allows generating the XML only from Mastercam or via a NET-Hook, I'd have to take a look to see if its possible via a C-Hook. In the meantime, I have written some NET-Hooks for customers that they run after running a setup sheet that copies and renames the XML to a folder, basically you run the report as usual then run a NET-Hook from a toolbar click. If this is something that might be of use let me know.

Link to comment
Share on other sites

Thanks for getting back to me Mick. Definitely see if it is possible with a C-Hook. That could be the ticket. That NET-Hook sounds good besides opening up the set up sheet but the ability to rename the XML file is useful. If there is a way to get that XML data without actually opening up a report with the ability to name it and save it, that would be exactly what I need to automate this process.

Link to comment
Share on other sites

Thanks for getting back to me Mick. Definitely see if it is possible with a C-Hook. That could be the ticket. That NET-Hook sounds good besides opening up the set up sheet but the ability to rename the XML file is useful. If there is a way to get that XML data without actually opening up a report with the ability to name it and save it, that would be exactly what I need to automate this process.

 

I'll see what I can find and get back to you in a couple days

Link to comment
Share on other sites

I whipped up a NET-Hook that is using a C-Hook function that is wrapped in a support dll (thanks Roger).

 

The NET-Hook will display a dialog that you can specify some properties, select a report and set the xml file name. When you click OK on the dialog the xml is created in the usual place , for example, C:\Users\Public\Documents\shared mcamx9\common\reports\XML. There is no other interaction, there is no viewer displayed.

 

I did not have time to save/load previous values but the source is there so if anyone feels like it they can implement it. For those interested the project source is located ->  https://github.com/Predatorie/SetupSheetXML

 

Unzip the attached zip file to a temp folder then right click each file and make sure none are blocked. Then copy all files to your X9 chooks folder. You can create a toolbar button for the NET-Hook as shown in the attached image. When you run the NET-Hook you will be presented with the dialog as shown in the attached image.

 

I did not spend a lot of time on this so if you run into any issues or have questions just reply to this thread.

 

 

The NET-Hook project is written in WPF C# using Visual Studio 2015 and is compatible with Visual Studio Community Edition 2015

 

UPDATE: The dialog will now save the values from the previous session and load them for the current session. Source updated accordingly.

post-4901-0-78427600-1465696763_thumb.png

post-4901-0-82742400-1465696771_thumb.png

SetupSheet.zip

Edited by Mick from CNC Software Inc.
Link to comment
Share on other sites

When I try and add it to a toolbar I get the category Setup Sheet XML but under that category I don't get the name or the correct icon as shown in your screen capture. I get the mastercam icon and a blank name. So I cannot get it to a tookbar. Do you have any idea why this is? I downloaded the ZIP file and extracted all then copied them into program files > mcamX0 > chooks. So I think the process is correct. 

 

Let me know if you have any ideas.

Link to comment
Share on other sites

When I try and add it to a toolbar I get the category Setup Sheet XML but under that category I don't get the name or the correct icon as shown in your screen capture. I get the mastercam icon and a blank name. So I cannot get it to a tookbar. Do you have any idea why this is? I downloaded the ZIP file and extracted all then copied them into program files > mcamX0 > chooks. So I think the process is correct.

 

Let me know if you have any ideas.

 

 

Make sure the files are not blocked. Copy all the files out of the Mastercam chooks folder to any temp folder, right click each file and go to properties and unblock and apply, once they are not blocked copy them back to the chooks folder.

Edited by Mick from CNC Software Inc.
Link to comment
Share on other sites
  • 1 year later...

Sweet! Just had a need for the "same name xml". Thanks. We also use Excel for our setup sheets. I made the formatted cells populate using the XML schema. It also sorts in numerical tool order (per setup personnel request), deletes duplicate tools and all their associated  offsets except if that tool is used in another work offset, then deletes empty Excel rows. I needed this to prevent the Mcam programmer from having to search for the latest xml generated from Active Reports and getting ticked-off. But now this automated setup sheet makes everything easier, faster, less prone to typos and allows easy edits from floor corrections/additions. Thanks !

  • Like 2
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...