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:

C-Hook Adding Custom Material to the Material List


Recommended Posts

Hello,

I am getting a material from the Material Library and then Adding material with the following 2 methods (C++/CLR code):

	bool COperation::GetMaterial(String ^ mat_name, CMaterial ^%ctp)
	{
		bool result = false;
		ent opEnt;
		if (TpMainMatMgr.GetMainMatList().DatabaseRetrieve(mat_name, opEnt))
		{
			ctp = gcnew CMaterial(opEnt);
			result = true;
		}
		return result;
	}

	bool COperation::AddMaterial(CMaterial ^ctp)
	{
		bool result = false;
		ent opEnt;
		
		String2CharA(ctp->name, opEnt.u.matl.name);
		String2CharA(ctp->comment, opEnt.u.matl.comment);
		
		if (TpMainMatMgr.GetMainMatList().Add( opEnt.u.matl )>0)
		{
			result = true;
		}
		return result;
	}

I am ONLY setting the name and comment at this point.

It works just fine and the new material is in the list.

Yet when I re-open MasterCam, the material is gone.

I am sure there is something simple i need to do to make it save, but just can't figure out what is.

Thanks in advance!

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