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:

Add New Toolbar for C-Hooks


Sunder
 Share

Recommended Posts

Hello all! headscratch.gif

 

I do have a problem in getting a new toolbar for C-Hooks which are not in customizeMastercam c-hookscategory.

 

I unable to find my new c-hook in the category

Is there any other way to add a new c-hoook to this list or change the existing comands button to map some other c-hook

 

thanks in advance

Link to comment
Share on other sites

To be able to create a toolbar icon for a C-Hook, it must be listed in a Customize-Category. To add the ability for a C-Hook (or NET Hook) to be "mapped" to an icon and/or keystroke it must defined in an .FT (Funtion Table) file, and the .FT file must reside in the CHOOKS folder so Mastercam will read it when X is started.

 

 

Sample FT file -->

 

code:

#--------------

# Wire_Entry.FT

#--------------

 

APPLICATION "Mastercam"

 

FUNC_DLL "chooksWireEntry.dll"

RES_DLL "chooksWireEntry.dll"

 

CATEGORY "Mastercam C-Hooks"

 

FUNCTION CPP "m_main"

SBMP 18001

LBMP 18002

TIP 1

END_FUNCTION

Obviously CATEGORY defines the Customize-Category for the icons used by the DLL will be placed.

(You can define your own Category is you wish!)

 

SBMP - defines the Resource ID of the "small" BMP icon (16x16 pixels).

LBMP - defines the Resource ID of the "large" BMP icon (24x24 pixels).

TIP - defines the Resource ID of the "Help Tip" string used.

Link to comment
Share on other sites

If this is a C-Hook you've developed, you should learn about making a Function Table (.FT) file (see the SDK documentation) and putting that FT file in the CHooks subfolder. If properly formatted, your C-hook(s) will appear in the Category list.

Also note that there is now a "Developer's Forum" on eMastercam - which also might provide answers for you.

 

---------------------------------

Edited....

 

Or you can do what Roger says in the previous post that beat me by a few seconds

----------------------------------

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

Ok, I am having a little trouble trying to get this to work for the silhouetteboundry.dll. Mastercam errors on startup that it can not read the .ft file.

 

This is what I have:

 

 

APPLICATION "Mastercam"

FUNC_DLL "chooksSilhouetteBoundary.dll"

RES_DLL "chooks SilhouetteBoundary.dll"

CATEGORY "Mastercam C-Hooks"

FUNCTION CPP "m_main"

SBMP 18001

LBMP 18002

TIP 1

END_FUNCTION

 

 

and saved it in the chook directory as:

silhouetteboudary.ft

 

What do I have wrong?

 

 

Tom

Link to comment
Share on other sites

Tom,

 

FYI,

The SilhouetteBoundary function is already loaded and available in the 'Geometry' category.

I beleive it is usually the last icon in the list.

 

Anyway...

If you want a separate FT for this, here it is ->

 

APPLICATION "Mastercam"

CATEGORY "Mastercam C-Hooks"

FUNC_DLL "chooksSilhouetteBoundary.dll"

RES_DLL "chooksSilhouetteBoundary.dll"

FUNCTION CPP "m_main"

SBMP 800

LBMP 801

TIP 1

END_FUNCTION

 

1> There was a 'space' in the RES_DLL path.

This will get you an error on startup about "Unable to open resource module..."

 

2> The Resource IDs (the icon bitmaps) for this function are not "18001" and "18002" (like some of the other DLLs), but "800" and "801".

This would not cause an error, but you would not have the desired icon loaded for the function.

You would get the default generic 'X' icon.

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

I did not set it as the startup C-Hook. With that FT file in place, it uses the cursor from the C-Hook , but is not actually in the C-hook at startup. In that condition I can run the C-Hook once and it will function correctly, but without turning off the "verify" cursor on exit. Here's what I put in the FT file:

 

APPLICATION "Ai_Freehand"

FUNC_DLL "chooksAi_Freehand.dll"

RES_DLL "chooksAi_Freehand.dll"

FUNCTION CPP "m_main"

SBMP 101

LBMP 102

TIP 1

END_FUNCTION

Link to comment
Share on other sites

Rick,

 

It's probably easier (for us rookies) to copy an existing .ft file and then edit it. You can open a .ft file with any text editor. Find a small one (1kb) and see what it looks like. You'll see plenty of them in the chooks folder.

 

Thad

Link to comment
Share on other sites

quote:

I did not set it as the startup C-Hook.

Matt, I missed your earlier reply. We both squeaked in at the same time. biggrin.gif

 

I used the same info for my .ft file and got the same results. I guess we'll have to wait for Takashi to reply.

 

Thad

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