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:

group type in MC API


ksoufi
 Share

Recommended Posts

Guest CNC Apps Guy 1

In the mill text file there is a section thal looks like this;

 

[groups]

1. "Group already exists with the same name."

2. "Select entities to add to group(s)"

3. "Group does not exist."

4. "Unable to read groups from file!"

5. "Enter unique group name"

6. "Restoring group members..."

7. "Current system GROUP"

8. "Current system RESULT"

9. "Select entities to remove from group(s)"

10. "Deleting Groups"

11. "Are you sure?"

12. "Select geometry that belongs to a group"

13. "Groups are used in toolpath operations. Are you sure?"

14. "XXXXXXXX-XXX"

15. "XXXXXXXX-XX1"

16. "Naming a group 'UNDEFINED' is not allowed."

17. " entities in selected group(s)"

(default group name - a number will be added to this)

20. "Group"

 

The "X" is how I have MC name it different from "Toolpath Group".

 

HTH

Link to comment
Share on other sites

ksoufi,

 

I think you might be having the same problem I'm having. In chooks you use the functions in m_db.h to create, delete, and add entities to groups.

 

list_grp_add_empty

list_grp_add_ents

list_grp_append_ents

list_grp_remove_ents

 

They all take a 'name' variable. But unless you created the group how do you know the 'name'? right?

 

For the life of me I can't find a function to get a list of current group names. I think this is the same problem you're having. right?

 

Maybe Product Developement Guy or one of the other developers could help.

 

I know the 'op_common' structure in 'm_avars.h' refer to a group idn number but I can't find how use the group number to get the group name.

 

frown.gif

 

Bryan smile.gif

Link to comment
Share on other sites

Bryan & James

Thanks for reply

In fact i'm trying to do this :

_____________________________________________

//create a new group

list_grp_add_empty ("group1",TRUE,1,&succf);

if (!succf)

return;

.

.

.

//add entities to group

list_grp_append_ents ("group1",1,&e_ptr,&succf)______________________________________________

 

There is two problem

1) th 1st one is after creating successfuly the "group1" and when running the list_grp_append_ents , there's a warning msg dlg box : memory allocation error

and then it pops up a second dlg box: this time is a Debug message :

list_grp_append(2)

Temporary file cfeated .....

2) the second problem is that once the "group1" was created, it doesn't appear in the list of Groups dlg box. When trying to create a new group by the icon "new", it gives me a warning : group1 already exists with the same name. This's what you said Bryan, there's no function to retrieve group from list_group!

there's allso some questions about the "type" input, what's exactly?!

I hope find answers for all our questions confused.gif

Link to comment
Share on other sites

Let's see, under list_grp_add_empty and list_grp_add_ents the 'type' (short type) is the type of group to create.

 

0=geometry - normal group for adding entities - ie lines, points, and arcs.

1=operations - groups seen in the operation manager - adding toolpaths

2=SystemGroup

3=SystemResult - these last two I assume are for creating the groups 'Group' and 'Result' like when to xform-tranlate-copy entites. they're stuck in Group and Result groups.

 

If you're trying to add geometry like lines and arcs to a group that might be part of your trouble. Your using 1 (operation group)

code:

  list_grp_add_empty ("group1",TRUE,1,&succf);

Another problem is you're calling TRUE in your second variable. This sets the group to hidden. That also might be why it isnt showing up in the group list.

 

Bryan smile.gif

Link to comment
Share on other sites
  • 1 year later...
  • 9 months later...

hello

Does anybody know how to append an operation to Toolpath Group 2"?,

I'm trying like this, pelase anyone help me smile.gif

 

code:

    op_list *opl;

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

while (opl != NULL)

{

list_grp_append_ents ("Toolpath Group 2", // I: new group name

1, // I: number of ents in eptr list, 0=use .sel ents

&opl->eptr, // I: list of entity eptrs

succf);

 

opl=opl->next_ptr;

}

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