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:

Is there a way??


gcode
 Share

Recommended Posts

to set defaults on CAD operations,

We use the command "Break Many" alot

with it set to Curves and a tolerance of .0002

failure to set the command to those values can scrap very expensive and irreparable castings.

It would be nice with the Command opened with those setting instead on

5 and Lines   

  • Like 1
Link to comment
Share on other sites

I can't think of any way to automatically break entities based on a chord height, what is the reason that this is important for you do to do because I am not following the point of doign that or how it could cause scrap since the posted code gets converted to lines and arcs. I also know we can turn off the arc output for the xy plane in the control definition, so if the machine doesn't support arcs we can easily change the control definition to lineralize the code and can even set the chord height i believe for how it converts the arcs. if you can elaborate that would help because maybe there is a better way to do this or to let the control definition do it for us when we post

Link to comment
Share on other sites

maybe all your looking for is to have the Code all line moves? if thats the case that can easily be done and i can give details on how to do that, so instead of the geometry getting broken the geometry would stay the same and the post itself would convert everything into lines based on chord height, that sounds easier to do than to have a file broken on import and that would all be easy control definition changes. 

Link to comment
Share on other sites
20 hours ago, gcode said:

to set defaults on CAD operations,

We use the command "Break Many" alot

with it set to Curves and a tolerance of .0002

failure to set the command to those values can scrap very expensive and irreparable castings.

It would be nice with the Command opened with those setting instead on

5 and Lines   

If you need an automated process that manipulate the gui, you could accomplish this using Mastercams native vbscript to call an external vbscript process that uses send keys after a short delay to have the computer do it for you, I did it before it is possible.I can hook you up IF you want, it would only use tools you already have.

Link to comment
Share on other sites
19 hours ago, JoshC said:

I can't think of any way to automatically break entities based on a chord height, what is the reason that this is important for you do to do because I am not following the point of doign that or how it could cause scrap since the posted code gets converted to lines and arcs. I also know we can turn off the arc output for the xy plane in the control definition, so if the machine doesn't support arcs we can easily change the control definition to lineralize the code and can even set the chord height i believe for how it converts the arcs. if you can elaborate that would help because maybe there is a better way to do this or to let the control definition do it for us when we post

we do a lot of lathe profiles based on point tables 

the points create a Manual Spline

If we chain the spline the posted code is point to point and yields a faceted surface (scrap)

so we create the spline, then use the command "Break Many" set at curves/.0002" tolerance

This breaks the spline into a chain of arcs

The resulting gcode is a series of arcs and a very nice surface that passes the .005" profile requirement 

We had a trainee break a spline last week

He was in a hurry and used the default settings (linear/5 segments)

He failed to notice something was seriously wrong, Fortunately the operator was an old hand

and knew something was wrong. Had he run that code it would have scrapped a $20K casting.

 

 

Link to comment
Share on other sites

are you using the Filter settings and do you have Create arcs checked? Because it will fit arcs into the toolpath automatically, i dont see how it would be much different than going through those extra steps and breaking them up manually and seems like the filter setting from my quick test on a spline with a lathe toolpath worked well.

1111111111.jpg

Link to comment
Share on other sites
9 minutes ago, JoshC said:

are you using the Filter settings and do you have Create arcs checked? Because it will fit arcs into the toolpath automatically, i dont see how it would be much different than going through those extra steps and breaking them up manually and seems like the filter setting from my quick test on a spline with a lathe toolpath worked well.

1111111111.jpg

We developed this process 15years ago when lathe toolpaths did not have the Filter option

When they added Filter to lathe contour (2018???)  I tried it, but the results are not the same

Sometimes it works well, sometimes it yields a combination of arcs and point to point, sometimes it fails altogether

I tried it with this week's issue and the results were not acceptable.

 

 

Link to comment
Share on other sites
10 minutes ago, gcode said:

We developed this process 15years ago when lathe toolpaths did not have the Filter option

When they added Filter to lathe contour (2018???)  I tried it, but the results are not the same

Sometimes it works well, sometimes it yields a combination of arcs and point to point, sometimes it fails altogether

I tried it with this week's issue and the results were not acceptable.

In the chook SDK I found 

this appears to be the automated equivalent
BreakManyPieces_CH.H
 /// <summary> Executes a Break Many Pieces operation. </summary>

 ///

 /// <param name="selEptrs"> The list of selected eptrs to break into many pieces. </param>

 /// <param name="params"> The break many pieces parameters. </param>

 /// <param name="newEptrs"> The list of the new database eptrs created by this operation. </param>

 /// <param name="errEptrs"> The list eptrs that the operation had errors breaking into many pieces. </param>

 ///

 /// <returns> true if it succeeds, else false if not. </returns>

  DllImpExp bool BreakManyPieces (const EptrArray &selEptrs, BreakManyPiecesParams &params, EptrArray &newEptrs, EptrArray &errEptrs);

I would hit up the SDK team and see if they have a solution, could be they have an existing chook that does exactly what you are looking for.

 

Link to comment
Share on other sites

Here is a sample file and posted code if anyone wants to play with this

spline to arcs.nc is from my "break many" procedure

filtered spline.nc is what I got filtering the spline

the toolpath filter will not function with the tolerance set to .0002

to get Break Many to work with a .0002 tolerance you have to edit "max chordal deviation"

on the Tolerance page of System Config

change the default .001 setting to .0002

 

spline to arc.zip

Link to comment
Share on other sites

gcode, I set the chook function to match the parameters you described.

The chook will ask for a selection and break the selected entities.

Judging by the name it appears to be a c++ abstraction of the function you wanted

 

extern "C" __declspec(dllexport) int m_main(int not_used)
{
	// Must call this prior to accessing any Resources in the C-Hook DLL
	ChangeResCl res(GetChookResourceHandle());

	bool succf = false;
	auto preSelection = PRESEL_CLEAR;
	EptrArray selectedEptrs;
	EptrArray newEptrs; EptrArray errEptrs;
	SelectEnts(_T("Select geometry"), L_ID | NB_ID | S_ID | A_ID, succf, preSelection, &selectedEptrs) == MC_RETURN::MC_NOERROR && succf;
	auto params = Cnc::WFBreakManyPieces::BreakManyPiecesParams::BreakManyPiecesParams(false, .0002);
	params.m_Curves = true; params.m_Dispose = Cnc::WFBreakManyPieces::PostBreakAction::Delete; params.m_Curves = true; params.m_Tolerance = .0002; params.m_Method = Cnc::WFBreakManyPieces::SegmentationMethod::Tolerance;
	Cnc::WFBreakManyPieces::BreakManyPieces(selectedEptrs, params, newEptrs, errEptrs);


	return MC_NOERROR;
}

 

BreakManyAddIn.zip

Link to comment
Share on other sites
16 minutes ago, byte said:

gcode, I set the chook function to match the parameters you described.

The chook will ask for a selection and break the selected entities.

Judging by the name it appears to be a c++ abstraction of the function you wanted

 


extern "C" __declspec(dllexport) int m_main(int not_used)
{
	// Must call this prior to accessing any Resources in the C-Hook DLL
	ChangeResCl res(GetChookResourceHandle());

	bool succf = false;
	auto preSelection = PRESEL_CLEAR;
	EptrArray selectedEptrs;
	EptrArray newEptrs; EptrArray errEptrs;
	SelectEnts(_T("Select geometry"), L_ID | NB_ID | S_ID | A_ID, succf, preSelection, &selectedEptrs) == MC_RETURN::MC_NOERROR && succf;
	auto params = Cnc::WFBreakManyPieces::BreakManyPiecesParams::BreakManyPiecesParams(false, .0002);
	params.m_Curves = true; params.m_Dispose = Cnc::WFBreakManyPieces::PostBreakAction::Delete; params.m_Curves = true; params.m_Tolerance = .0002; params.m_Method = Cnc::WFBreakManyPieces::SegmentationMethod::Tolerance;
	Cnc::WFBreakManyPieces::BreakManyPieces(selectedEptrs, params, newEptrs, errEptrs);


	return MC_NOERROR;
}

 

BreakManyAddIn.zip

man your a pretty fart smeller, i mean smart feller! but in all seriousness this is pretty cool and great work man, very nice work! 

Link to comment
Share on other sites
1 minute ago, JoshC said:

man your a pretty fart smeller, i mean smart feller! but in all seriousness this is pretty cool and great work man, very nice work! 

Is the result a match?

Link to comment
Share on other sites
10 minutes ago, gcode said:

I will check this out.

Looks like good stuff !!!

Thanks

Cool,

We could also color the entities different colors if they were changed or not.

The selection could also be changed, just let me know if you need enhancements.

Link to comment
Share on other sites
/// ... ///
//we would insert this code at  the end to rewrite the entities if required
/// ... ///
#pragma region additional settings
	//loop through the new modified entities
	for (auto &newEptr : newEptrs)
	{
		//paint the modified entities dark grey
			newEptr->eptr->color = MC_DK_GRAY;
		   rewrite_ent(newEptr->eptr);
		//paint the modified entities unselected
		   if (sel_bit_is_on(newEptr->eptr->sel, SELECT_BIT))
		   {
			   sel_bit_turn_off(newEptr->eptr,SELECT_BIT);
		   }
		
	}
	//loop through the unmodified entities
	for (auto &newEptr : errEptrs)
	{
		//paint the unmodified entities dark red
		newEptr->eptr->color = MC_RED;
		rewrite_ent(newEptr->eptr);
		//paint the unmodified entities selected
		if (sel_bit_is_off(newEptr->eptr->sel, SELECT_BIT))
		{
			sel_bit_turn_on(newEptr->eptr, SELECT_BIT);
		}
	}
#pragma endregion

 

Link to comment
Share on other sites
  • 2 months later...
On 8/26/2020 at 7:37 AM, gcode said:

I will check this out.

Looks like good stuff !!!

Thanks

Hi Tom, was this issue resolve in an update?

If not, just a reminder, I had made a solution with your settings, I've actuallly been using it, you mentioned it was a potential risk.

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