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 level from secting entity.


Recommended Posts

Hello, I'll start by saying i am new to C++ Waiting for a fall Class). Ive been slowly learning, actually made a few small programs so far. I've dove into a larger project and need a push. I'm trying to create a hook that will associate a name and thickness(from a dialog box) prompt the user to select a piece of geometry (from which i can get a level from) and create a WCS for. All this inforation will be collected and kept in the hook and the user can turn on and off diferent related selections from it. I'm currently a little stuck on the prompt for geometry right know. I am looking at using select_ent then i saw something about GetLevelNumber somewhere.

 

1)Does this sound like a good direction to head in? Or is there something better?

 

1a)Am I supposed to use restore_mcam_afx_state and restore_chook_afx_state around select_ent? If i am how do i fix : undeclared identifier

 

2)I guess i need to make my hook modeless. I read about the m_open m_close m_enter but not sure where they go. m_open replces m_main the rest i'm not sure.

 

Sorry but my Codeing skills are rather Embarassing. I am using MSVC6.0 Mastercam V9

Link to comment
Share on other sites

select_ent will allow your user to select an entity. which you can then get the level information from. The other function probably prompts the user to select a level from the level manager.

 

2) just rename m_main to m_open. It's called the first time the chook is run. m_enter is called every time the chook is called after that. m_close is called when mastercam exits.

 

When I use them my code is structured sorta like this:

m_open -> initialization stuff; ie allocate memory. Call main chook code.

m_enter -> call main chook code.

m_close -> clean up. ie release memory

 

bryan smile.gif

Link to comment
Share on other sites

O.K. i'm missing something, My hook starts with a dialog box I careated then the user presses a button which prompts for another dialog box I made then enters data there. After OK to that box it closes and I want to prompt the user to select_ent, how do I lose focus on the original dialog to give focus to mastercam? I'm in way over my head but trying to breate through a small straw.

 

Thanx for any advice!

Link to comment
Share on other sites
  • 8 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...