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:

How to get info on machine groups and operations from the SDK.


Recommended Posts

Hi everyone,

 

I have the following SDK questions:

 

1. Each operation listed in the toolpath manager has a description associated with it. How do I access these descriptions from the SDK?

 

2. To get a list of all operations in the current model, I can call

 

list_manager(OP_ID, "", LSTMGR_GET, (void **)&operaThis);

 

How can I get a list of all machine groups in the current model?

 

3. How can I tell which machine group an operation is associated with or how can I get a list of all the operations associated with a machine group?

 

4. How do I access the description of a machine group

 

Thanks in advance.

 

CaKiwi

Link to comment
Share on other sites

quote:

1. Each operation listed in the toolpath manager has a description associated with it. How do I access these descriptions from the SDK?


I'm assuming you're asking about op.comment.

 

quote:

2. To get a list of all operations in the current model, I can call

 

list_manager(OP_ID, "", LSTMGR_GET, (void **)&operaThis);

 

How can I get a list of all machine groups in the current model?


Looks like the list_manager() function isn't used to get machine group data in X. I haven't played with the groups in X yet, so I'm of no help here. Did you find anything in Groups_CH.h that might help? I'm also of little help for questions 3 and 4. Hopefully someone else can help.

Link to comment
Share on other sites

Hi Bullines,

 

Thanks for the response.

 

I had looked at op.comment but it does not seem to hold the description of the operation. For example, if I load the sample part contour-shallow - add cuts.mcx, it has 3 operations shown in the Operations Manager each of which has a description associated with it ("Without - Shallow", "Shallow - Add Cuts" and Alt - Floor Toolpath"). But the op.comment field for each is empty.

 

I will look some more in groups_ch.h to see what I can find for my machine group questions.

 

Thanks again.

 

CaKiwi

Link to comment
Share on other sites

The only thing I have come up with so far is the grp_idn field in the cmn structure of the op structure of the op_list structure. I have a model with 2 machine groups, the first containing 3 operations and the second containing 1 operation. When I step through the operation list, the grp_idn field has values 2, 3, 4 and 6 respectively for each of the 4 operations. I am surmising that the 2 machine groups are in slots 1 and 5 and that when this number jumps by 2 we have started a new machine group. If this is all true (I need to try it out on a few more models), I at least know which operations are in which machine groups. If anyone has any better ideas, I would love to hear from them.

Link to comment
Share on other sites

I've found that if I call the routine GroupsMachineGroup with a NULL argument I get an arbitrary member of a list containing all the machine groups and operations and I can then get to the head of the list by following the head_ptr of this member. Calling it with a member of that list returns the machine group of that member. The following code finds the machine groups in the list.

 

code:

 

int idn;

group_list *pGroup1, *pGroup2;

pGroup1 = GroupsMachineGroup (NULL);

pGroup1 = pGroup1->head_ptr;

//printf("%s - %s", pGroup1->name, pGroup1->ogi.pg1.comment);

idn = pGroup1->grp_idn;

pGroup2 = pGroup1->next_ptr;

while (pGroup2 != NULL)

{

do

{

pGroup2 = pGroup2->next_ptr;

if (pGroup2 == NULL)

{

break;

}

pGroup1 = GroupsMachineGroup (pGroup2);

} while (idn == pGroup1->grp_idn);

if (pGroup2 != NULL)

{

//printf("%s - %s", pGroup1->name, pGroup1->ogi.pg1.comment);

idn = pGroup1->grp_idn;

}

}


I've also found a routine GetMachineList() but I've had a problem linking with it. I'll let you know if this provides a simpler solution.

Link to comment
Share on other sites
  • 2 months later...

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