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:

Get Post Processor


Recommended Posts

I haven't used it myself, but it looks like you can use Mastercam.Posting.PostingManager to receive up to 3 arguments from the post, no idea how to get the post to send them though since there isn't any documentation that I could find really, but it might be a start of a place to look.

 

Other than that I couldn't find anything else that lets you get the post, and even that seems like it would only work when you posted something (not beforehand in other words) and also looks like it wouldn't allow you to change posts, only possibly get a string from the post that named the current post.

 

Using MachineDefManager would let you create a new machine group, but only the default, doesn't look like there is any way to specify what machine def to use when creating the group.

 

Other than that you could also use MachineDefManager to tell what product type, ie lathe, mill etc.. but I don't think that's what your after. .

Link to comment
Share on other sites

Q. What version of Mastercam are you running?
Though in this case it doesn't make a difference, for other situations it very will may.

 

You cannot just “change the Post Processor”, as it’s meant to be part of the Machine Definition.
The Mastercam.Posting.PostingManager is not going to help you here.
That is from passing (3 strings) to/from a Post Processor. It has nothing to do with the “selection” of the Post.

Ref: Mastercam.Support.MachineDefManager class -> the “CreateMachineGroup” methods…
You can create a Machine Group;
Either using the “default” Machine, or by specifying the name of the Machine Definition to use.

 

There is not a method for replacing the Machine Definition in a Machine Group using a NET-Hook.
Sounds like something to put on the NET-Hook API to-do list!


 

Link to comment
Share on other sites

Roger,

 

FYI - I am using X8 with the latest updates. 

 

I am not actually using these methods to code right now, but I am just trying to get a better understanding of the nethook methods etc.

 

When someone asked a question I tried to help out since in general helping someone else makes me learn as well.

 

I only mentioned PostingManager as a possible method to get the name of the post processor since the original poster had asked for a way to Get or Set the name, since those are common methods to read object properties I assumed he meant get as in a read only property so I mentioned it might be possible to pass the post name - I think it would be clumsy at best and not quite what he was after, but I figured I would mention it just in case it helped.

 

Anyhow, I looked at the CreateMachineGroup method before my original post, but I cant see one that allows you to create it with a specific machine.. maybe i'm missing something?

 

The only CreateMachineGroup method I see is this one

 

 

Public Shared Sub CreateMachineGroup(Product As Mastercam.Database.Types.ProductType)

Member of Mastercam.Support.MachineDefManager

Summary:

This method creates a new default machine group of the specified product type.

Parameters:

Product: The type of machine group to create.

 

 

It does say Product - type of machine group to create, however when I look at  Mastercam.Databse.Types.ProductType I see this..

 

 

Public Enum ProductType As Integer

Member of Mastercam.Database.Types

Summary:

The different product modes that Mastercam can be in at any given time

 

 

And then looking at the types themselves there is ..  Design, Draft, Lathe, Mill, MillTurn, Router, Wire and ErrorType

 

It appears from the definition that this wouldn't allow creation of a Machine Group with anything but the default machine, it does look like it would allow you to create machine groups for each type of machine, Mill, Lathe etc.

 

When I looked at the definition of CreateMillMachineGroup, it also states that it creates a default mill machine group. 

 

So anyhow that's how I came to my conclusion that it wasn't in fact possible to create a machine group with anything but the default machine, if there is a way to do it I would love to see an example.

Link to comment
Share on other sites

I ran a quick test and I was able to update the machine definition and posts for multiple machine groups.

 

C#

  var millGroups = SearchManager.GetGroups(ProductType.Mill);

            foreach (var group in millGroups.Where(GroupManager.MakeGroupCurrent))
            {
                OperationsManager.ActiveMachine = Path.Combine(
                    Mastercam.IO.SettingsManager.SharedDirectory,
                    "CNC_MACHINES\\MILL 4 - AXIS VMC.MMD-8");

                OperationsManager.PostName = Path.Combine(
                    Mastercam.IO.SettingsManager.SharedDirectory,
                    "mill\\Posts\\Generic Fadal Format_1 4X Mill.pst");
            }

VB.NET

            Dim millGroups = SearchManager.GetGroups(ProductType.Mill)

            For Each group In millGroups.Where(Function(e) GroupManager.MakeGroupCurrent(e))
                OperationsManager.ActiveMachine = Path.Combine(Mastercam.IO.SettingsManager.SharedDirectory, "CNC_MACHINES\MILL 4 - AXIS VMC.MMD-8")
                OperationsManager.PostName = Path.Combine(Mastercam.IO.SettingsManager.SharedDirectory, "mill\Posts\Generic Fadal Format_1 4X Mill.pst")
            Next

Before on left, after running NETHook on right. It's not quite perfect but you may be able to work with it.

post-4901-0-05873900-1424271538_thumb.png

Edited by Mick from CNC Software Inc.
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...