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:

Zaffin_D

Verified Members
  • Posts

    374
  • Joined

  • Days Won

    1

Everything posted by Zaffin_D

  1. You have a different nc file name set for some operations. Select all operations and right click in the operations manager. Then from the context menu, Edit selected operations > Change NC file name...
  2. Why no use smc_shared_dir$ to do this? Seems easier. sbufname4$ = smc_shared_dir$ + "buffer4.txt"
  3. I think at this point it's best that you contact your Mastercam reseller. Thanks, Jeff
  4. Is your maintenance current? If not, you will not be able to download posts from the tech exchange.
  5. That's showing you that the op is set to use sub programs if I'm not mistaken.
  6. Only thing I can think of is that you're not linked on mastercam.com. That link was direct to the 2019 DX32 post, in case that's the issue head to https://community.mastercam.com/TechExchange, sign in, and search for "DX32".
  7. The system clock (metric 2) is usually not a good way to test preformance.
  8. Just about 5 minutes for a Ryzen 5 2600x.
  9. There's a DX32 post on Mastercam's tech exchange.
  10. There isn't one. It is available in ToolNetApi.dll, so you can get the value in your posted code using a NET-Hook.
  11. Have you contacted your reseller?
  12. Try setting them up in a string select table, like below. tool_rad : 0 sDA : "DA" sDB : "DB" sDC : "DC" stool_rad : "" #Target string fstrsel sDA tool_rad stool_rad 3 -1 The change your ptoff post block to the below. ptoff #Tool radial offset if tloffno$ = 10001 | tloffno$ = 10002 | tloffno$ = 10003 | tloffno$ = t$, [ if tloffno$ = 10001 | tloffno$ = t$, tool_rad = 0 if tloffno$ = 10002, tool_rad = 1 if tloffno$ = 10003, tool_rad = 2 stool_rad if op_id$ <> prv_op_id$, result = force(tool_rad, tool_rad) ] else, *tloffno$ !tloffno$ You'll also have to add the force line (shown below) to the psof$ postblock result = force(tool_rad, tool_rad)
  13. In MP strings are non modal so the literal string will always be output. This also applies to strings that are in a variable, for example sg56. Adding the force leader (*) to sg56 is redundant, it will always be output. Strings that require modality are usually set up in a string select table.
  14. If you are interested in a NET-Hook solution the below code may help. public override MCamReturn Run(int param) { var postArgs = PostingManager.PostProcessorArguments; var postArguments = (PostProcessorArgumentsType)postArgs; var opID = postArguments.Argument1; if(!int.TryParse(opID, out var operationID)) { return MCamReturn.ErrorOccurred; } var returnArgs = PostingManager.PostProcessorArguments; var returnArguments = (PostProcessorArgumentsType)returnArgs; if (AllOpsPosted(operationID)) { returnArguments.Argument1 = "1 "; } else { returnArguments.Argument1 = "0 "; } PostingManager.PostProcessorArguments = returnArguments; return MCamReturn.NoErrors; } private bool AllOpsPosted(int operationID) { var currentOperation = SearchManager.GetOperation(operationID); var allOperations = SearchManager.GetOperations(currentOperation.GroupNumber); foreach (var operation in allOperations) { if (!operation.Selected) { return false; } } return true; } Below is a sample post that shows how you would call the NET-Hook. fs2 4 1 0 1 0 pheader$ "(--- Start of File ---)", e$ *e$ psof$ "(--- Start of File ---)", e$ *e$ pAllOpsPosted(op_id$) if (allOpsPosted), [ "All operations posted", e$ ] else, [ "Subset of operations posted", e$ ] *e$ peof$ "(--- End of File ---)", e$ fmt "" 4 opID dllReturn : 0 allOpsPosted : no$ sdq : '"' sspace : " " snoArgument : "noArg" sDLLArgs : "" sallOpsPostedDLL : "AllOpsPosted.dll" pAllOpsPosted(opID) sDLLArgs = sdq + drs_str(2, opID) + sdq + sspace + sdq + snoArgument + sdq + sspace + sdq + snoArgument + sdq dllReturn = dll(sallOpsPostedDLL, sDLLArgs) allOpsPosted = rparsngl(spost_arg_0$, 1)
  15. You should send this in to CNC's post department. Starting with 2019 the posts are encoded as UTF-8, and it seems like your charters are getting re-encoded. I'm positive they want to investigate this issue.
  16. I think that check only works if the first op and last op in the machine group are posted. Let's say we have 5 op's in a machine group; that check would work if ops 1, 3 and 5 were posted, but wouldn't if ops 1, 2 and 3 were posted.
  17. I'm pretty sure you'll need to call a NET-hook from your post in order to do this. Posting in Mastercam only generates the NCI and related data for the selected operations.
  18. If you (or anyone else) is still interested in this, I've uploaded an example project to GitHub. It's not a NET-hook, but it could be converted to one with a little massaging.
  19. I don't doubt that it's working, but CNC doesn't recommend it's use in mill, router, or lathe posts.
  20. Using scalex$, scaley$, and scalez$ is only safe in wire posts.
  21. If you use lines, the below method may be helpful. I'm not a programmer, so there is definitely a better way to do this. public bool ProcessLinesOnLevel(int level) { var selectLines = new GeometryMask { Lines = true }; var selectAll = new SelectionMask { All = true }; // Get all lines on a given level var selectedGeometry = SearchManager.GetGeometry(selectLines, selectAll, level); // Make sure there are lines to process if (selectedGeometry.Count() > 0) { // Iterate through each entity foreach (var entity in selectedGeometry) { // Cast the entity to LineGeometry var line = (LineGeometry)entity; // Create instances of Vector3D for the start and end points var startPoint = new Vector3D(line.EndPoint1.x, line.EndPoint1.y, line.EndPoint1.z); var endPoint = new Vector3D(line.EndPoint2.x, line.EndPoint2.y, line.EndPoint2.z); // Calculate the vector var vector = Vector3D.Subtract(startPoint, endPoint); // Normalize/Unitize the vector vector.Normalize(); // Write the values to a list of strings for output later lineData.Add($"{Math.Round(startPoint.X, 8)};{Math.Round(startPoint.Y, 8)};{Math.Round(startPoint.Z, 8)};" + $"{Math.Round(vector.X, 8)};{Math.Round(vector.Y, 8)};{Math.Round(vector.Z,8)};"); } return true; } else { return false; } } That gets you the XYZ position and the unitized vector of a given line. I think you would have to convert that vector into Euler angles then convert the Euler angles to quaternions. Converting the unit vector to Euler angles is simple. It appears that converting Euler angles to quaternions is simple, though I've never done it; I may try tonight for fun.
  22. I would try the engrave toolpath.
  23. Have you tried setting the axis address rather than using the nwadrs function? Should be able to set it in pheader$, something like below? pheader$ if not(isTransform), str_pri_axis = "A1" else, str_pri_axis = "A2"

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