-
Posts
97 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by PMDc
-
-
I am getting the attached error message when I call my NETHook a second time. If I close Mastercam and reopen it will work one time and report this error when called any subsequent time.
Below is the code I copy and pasted for my form. I am new to all of this so it appears that I am not closing my application properly. Any help is appreciated.
Thanks!
public override MCamReturn Run(int param)
{
MCamReturn result = MCamReturn.NoErrors;
//DialogManager.YesNoCancel("System function called", "Run()");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
return result;
}
-
Ok. I understand now.
Thanks for clarifying. I greatly appreciate your help.
-
How can it write back to the file descriptor if it is not accessible while MC is open?
Sorry you are having to deal with my current level of ignorance.
-
if you have the data, and it can be written, then why cant you read it back and put it in a form? Attach it to an .ft file and assign it an icon, and its in a toolbar.
That was my plan until you brought up the file descriptor. That was more appealing due to there not being an additional file to manage.
-
Yes the buffer files are written after posting is complete. Now that you mention it, that will do it. Now if I wouldn't have given my customer the idea that there is a way to have fields to populate in MC for this data... *Sigh*.... It's all good, I'm learning something new.
When I started this project I didn't think I'd be as deep as I currently am. I'm learning C# .NET language now with hopes that I won't be starting over when I want to write a CHook.
Thanks!
-
rocheey1,
Thanks for the information! Excuse my ignorance because I am totally new to this; would it be possible to have the nethook write the project data to a memory buffer while in MC then any time an MC save is executed the buffer would populate the structured storage?
As for the MP buffer file output, it worked great for exporting an ASCII text file until I hit the ceiling of my NC revision number counter needs to read the previous revision to increment. This works great when a file exists. However, when you post a file for the first time and the file does not exist the MP.exe reports an error for the missing file.
Thanks,
-Pat
-
Like many who post here, I've always wanted to learn how to write CHooks (NETHooks) but thought it would be too complex. I have installed VS Express 2012, SDK from Microsoft, the examples and samples from Mastercam as well as some other information from the internet and this forum. I have searched through this forum and found a few things that are close to what I want to do but not quite.
I am trying to create a place to store and output project information i.e. Customer, Part Number, Revision, Job Number, and NC revision number. I started by exhausting the buffer file option in MP.exe without acceptable results so I am looking for the path of least resistance to accomplish this. The Holy Grail would be to have an Operations Manager Tab with user customizable fields to enter this information then have the ability to output this data to NC as well as an Excel file for an MRP system to parse the data.
I will be excited as groom on his honeymoon if I can get a NetHook to write a .csv or .xml file with the data then read it again for the NC revision level. I accomplished this with the MP.exe buffer file however, it kicked up an error that I couldn't remove; the first time the post runs, the output file doesn't exist for the previous revision level value call.
From what I have read this is all doable in a CHook but I have not seen a solution that captures it.
Questions:
1.) Is there a Third-Party Developer that has done this already? If yes, is it customizable for file location, field labels, etc.?
2.) If I decide to tackle this myself, will the software I listed above be enough to accomplish the tasks?
3.) Where would you start?
Thanks!
-Pat
-
Give this a try.
It will not repeat tools of paths with the same NCI name. If you have mulitple NCI's in a file it will repeat tools if there are any.
I'm curious if anyone is using this or a version of it, please let me know.
Thanks
-
I did get it to not repeat the tools. I will post it later.
-
On the tool branch of each of the operations parameters, check the box for "force tool change"
Thanks for the reply. However this did not solve the problem. When I use a Mastercam supplied post it's there but the custom post I was given does not.
I'll keep searching or revise a "good" post to get what I need.
Thanks again.
-
I have a couple X5 posts derived from Mpmaster that will not post an M6 when the file has only one tool. Has anyone seen this before?
Thanks,
-Pat
-
***New Update***
I found out why I had repeating tool numbers in the one file. I did not have a common NCI name for all ops so the report repeated it. I feel better now knowing why it happened.
Of you who downloaded my tool list, have you made any improvements you'd like to share with the rest of us?
Thanks, -Pat
-
Update
It turns out that my issue with repeating tools is isolated to a single MCX file. No clue why, but so far works fine on other files. It still lists the tools in operation order instead of numerically but I can live with that for now.
Thanks to Headhunter for verifying and anyone else that played with it.
-Pat
-
I wonder then if you could modify the tool report to add in the info you need and just run a tool report instead? I'm sure there's a number of ways to do it. Just something to think about.
I have done this but could not find a way to enter the header information. The labels are there but no data. Is there a way to add a query to populate these when running the report?
-
Sorted Tool List...Sorted by what?
You guys are aware that you can right-click in the Tool Manager choose Arrange Tools > by Number, by Type, by Name, or by Diameter and then right-click choose import/export - detailed report or report.
This will give you a report in the way that you chose to arrange them. Is that what you guys are looking for?
It is, however, I need the data in the header of the report and the tool manager does not have this option. So setup sheet via active reports is the only method I have found.
-
You can call it in as sub report. You have to write in some custom code for it though. As far as I've been able to tell, that's the only way to make it happen.
This is how I brought mine in....
public void ActiveReport_ReportStart()
{
DataDynamics.ActiveReports.ActiveReport sbrpt = new
DataDynamics.ActiveReports.ActiveReport();
sbrpt.LoadLayout("C:\\Documents and Settings\\All Users\\Documents\\shared mcamx5\\common\\reports\\SST\\-tooldetail.rpx");
this.tooldetail.Report = sbrpt;
}
Where are you placing this code to get it to work?
Thanks, -Pat
-
Attached are the rpx files I created to generate the tool list I posted.
If anyone has a solution to the repeating tool or numerical order issues, please let me know asap.
Thanks,
-Pat
-
I like that I have been able to get a tool list layout like I need. However, the tools are not sorted in numerical order and repeat.
How is this done?
Thanks,
-Pat
-
I thought I might have to do that. Thanks!
-
I am trying to get the Mill.set file to post the "Amount of stock to leave XY" and also "Tip Comp" values to my setup sheet.
The mill.set file has a note that says to see 'Parameters Information.pdf' file from the Post Processor Reference Guide CD. Where can I get this file or CD for that matter?
Thanks!
Error message when I call the NETHook a second time
in Mastercam C-Hook, NET-Hook and VBScript Development
Posted
No that is not my intent. Being a total newbie to application programming, I was able to create my form and use a "test" project to debug in VS Express 2010 and everything worked so I copied what worked for the test to the Mastercam template and it works one time.... still very much in the dark as to how to interface with Mastercam. So not to exhaust anyone's patience here, where do I find the basics of how this all works?
I am slowly catching on to C# with online and professional help but have yet to uncover a step by step on simple NETHook creation.
Thanks!