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:

Mick George

CNC Software
  • Posts

    629
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mick George

  1. I took a look at the NET-Hook API and those properties are available so in theory you could write a NET-Hook to extract these values tally up the values and merge it into new XML tag of the XML data source but it is a little more advanced and you would need to have a little knowledge on how to create a NET-Hook. I'll see if I can whip up an example over the next few days.
  2. I did some more digging and unfortunately "Stock to leave on floor" and "breakthrough amount" are not currently exported to the XML. I had added a story to our backlog and will update you once it gets into a sprint.
  3. For those interested I modified PcRobitic's sub report to turn on the corner radius field based upon the corner radius type. If there is no corner radius the type the data in the xml will contain "None" (This might need to be localized if using a non English language but I am not entirely sure) and nothing more occurs because the corner radius field is hidden by default otherwise show the corner radius field and the value mapped to it will display.
  4. You could use the corner radius type tag and check that in your code, if it is NONE then don't show the radius.
  5. Try restarting Mastercam and see if you can reproduce this issue. I would also check profile for null before calling GetSegmentCount just to be safe, if it is null that could be an indication of a problem.
  6. What config options are you setting if any relative to reports?
  7. If I understand your code I think this might be what you are after. ' Get the corner radius value coming in Dim cornerRadius = Me.txtCORNER_RADIUS1.Value.ToString() ' Initialize variable that will hold the actual double value Dim radius As Double ' Sanity checks If String.IsNullOrEmpty(cornerRadius) Then txtCORNER_RADIUS1.Forecolor = Color.LightGray txtCORNER_RADIUS1.Text = "0" CR.Forecolor = Color.LightGray ElseIf Double.TryParse(cornerRadius, radius) Then txtCORNER_RADIUS1.Forecolor = Color.Blue CR.Forecolor = Color.Blue End If
  8. Could you attached your reports here and I'll take a look.
  9. You can switch the report to VB.NET and use VB code in place of C# code as shown in the attached image.
  10. I see a lot of customers using view-sheets for their setup sheets, I have also written a few NET-Hooks for customers that generate additional setup sheet data utilizing view-sheets and other data sources.
  11. PcRobotic, I whipped up a quick test as shown below. The images show what I updated in the sub report (always give your controls proper names), added some simple C# code to filter on corner radius and the last image shows the result. You should be able to take this and edit your report to fit your needs.
  12. Ray, This does sound like something a NET-Hook could do. I would first recommend downloading all of the example NET-Hook projects from mastercam.com under the 3rd Party Developers link to get familiar with how NET-Hooks work. You will want to install the free Community Edition of Visual Studio and I would recommend installing the Mastercam NET-Hook project template for Visual Studio too as that makes it easy to begin a NET-Hook project. Feel free to reply here for any additional help.
  13. Lee, I would recommend using the FileVersionInfo class to get file version information.
  14. Ken, If it is possible for you to zip up your VB.NET project and include the existing VBScript file I can take a look. Please rename the .vbs file to .txt and zip everything up and mail it to sdk (at) mastercam (dot com) thanks.
  15. Ken, This should do the trick. Public Overrides Function Run(param As Integer) As MCamReturn '' Make sure there is a line availble for selection Dim mask As New GeometryMask(False, True, False, False, False, False, False) '' Sanity check If Not SearchManager.GetGeometry(mask).Any() Then '' Not like this.... DialogManager.OK("There are no lines in current drawing for selection", "Select a Line") Return MCamReturn.FunctionExit End If '' Keep selecting While True '' Ok to go, Prompt user for a line Dim geometry = SelectionManager.AskForGeometry("Select a line", mask) '' Sanity check If geometry Is Nothing Then '' Likely user cancelled so bail Exit While End If '' Cast geometry type to a line Dim line = DirectCast(geometry, LineGeometry) '' Get the rise Dim dx As Double = line.Data.Point2.x - line.Data.Point1.x Dim dy As Double = line.Data.Point2.y - line.Data.Point1.y '' Define a new point Dim point = new Point2D(dx, dy) '' Get the angle Dim degrees = VectorManager.AngleDegrees(point) '' Display, formatted to 4 decimal places DialogManager.OK("Angle of selected line is " + degrees.ToString("###.####"), "Result") '' Unselect geometry SelectionManager.UnselectAllGeometry() '' Refresh GraphicsManager.Repaint() End While Return MCamReturn.NoErrors End Function
  16. Lee, Apologies for the late response as I don't visit here as often these days, you would be better posting on our API forum at mastercam.com for a faster reply as we do monitor daily. I'll take a look at this later today.
  17. If you just want to add the current time and date you can do that in the post, you don't need a NET-Hook to do that as Roger mentioned above.
  18. Where did you add your icons? What are the icons names and do they match the names in your FT?
  19. Lee, Just so I a clear, do you want to add the current time and date to the NC file each time you post?
  20. Hi, I apologize for the late response but I rarely browse this forum. I would recommend posting on the official forums for assistance as we have a number of people very knowledgeable with reports that can assist you.
  21. There is no SDK install required for .NET NET-Hooks, just add a reference to the NETHook DLL located in your Mastercam install folder. As for templates, I never created one for VS2008. I would install the free VS 2017 Community Edition which is essentially a Professional Edition and will be more than adequate for NET-Hooks. If you do and when you create a new Vb.NET NET-Hook project just remove the existing NET-Hook DLL reference from the project and add a new reference pointing to your Mastercam X5 location.
  22. I have published a Mastercam VB.NET NET-Hook project template for Visual Studio 2017 (All Versions) To install, start Visual Studio and from the Tools menu select Extensions and Updates, select Online and search for Mastercam and you should see the template as shown in the attached image.
  23. Lee, You can't create C-Hooks in VB.NET only with C++ and the C-Hook SDK. You create NET-Hooks with VB.NET if that is what you are looking todo?
  24. Sonny you will need to post this on the official Mastercam forum
  25. oihannah, You should be able to access the NET-Hook examples on our website so I am looking into that for you and hopefully have that resolved soon. My GitHub is there for things I play around with and you can use whats there if it is at all helpful. There is a project template for Visual Studio 2017 that you can install from Tools -> Extensions and Updates that helps get you started with a C# project if you were not aware of that. Many projects that target older versions of Mastercam can usually be updated to run with a newer version of Mastercam and that is as simple as updating the projects NETHook3_0.dll reference to point to the newer version. Occasionally functionality is deprecated but it should be easy to see what needs to be updated.

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