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:

Lee1

Verified Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by Lee1

  1. Thank you Sir. Yes, you're right. I changed the first parameter to a null pointer, and the result was what I wanted
  2. Mastercam 2022 or late version, the CInterrogateMastercamFile function is change? chooks 2021 code update to 2022, the CInterrogateMastercamFile function error? how to fix this error, thanks. CInterrogateMastercamFile fileInterrogator CString mcxFileName = _T("E:\\Mastercam\\mc\\2023-08-26.mcam");//full path CLibraryOperation::EntAllocation entAllocation = CLibraryOperation::EntAllocation::LoadAndKeep;//LoadAndFree,LoadAndKeep bool kk = fileInterrogator.CInterrogateMastercamFile::Load(mcxFileName, entAllocation); bool isLoad = fileInterrogator.IsLoaded(); bool isExterlfile = fileInterrogator.IsExternalFile();
  3. Chook - How to Move solid To origin? If the solid not at the origin, want to move to the origin,? I found the translate_silent function, but is not work. function method translate_silent(&foundSolid,false,0, point1, point2, 1, 1, &succf,true); thanks. vs2019 + mastercam 2022
  4. OK, Thank you Sir, I'll re-post on Mastercam forum
  5. Hi Sir: I am learing c-hooks programming, I want to get the solid part pocket bottom depth, I can use u.sld.min[2] get the solid minmum z, But i dont kow use which function get procket depth. Thanks.
  6. Thank you for your help, But I want to achieve is that each time click a operation and get the parameters of the current operation, not looping to get the parameters of all operations
  7. 1,get all operation z max,z min write to buffer and call step 3 2,get all tool number write to buffer 3,get every tool parameter(diameter, radius,loc,ovl,z-min,ect..) and write to buffer 4,read buffer and write to nc code
  8. Below has NetHooks get selection operation parameter shown MainView, but only get one operation, if selection other operation show error and the parameter not update, I don't know where is error 'Option Infer On ' ----------------------------------------------------------------------- ' <copyright file="NETHookMain.vb" company="CNC Software, Inc."> ' Copyright 2014 CNC Software, Inc.. ' </copyright> ' ----------------------------------------------------------------------- Imports Mastercam.Database.Types Imports Mastercam.IO Imports Mastercam.IO.Types Imports Mastercam.Math Imports Mastercam.Support Imports System.Globalization Imports Mastercam.App Imports Mastercam.App.Types Imports Mastercam.BasicGeometry Imports Mastercam.Database Imports System.Collections.Generic Imports System.Diagnostics.CodeAnalysis Imports System.IO Imports System.Windows.Forms Imports Mastercam.Operations Imports Mastercam.Support.Group Imports Mastercam.Tools Imports Mastercam.GeometryUtility.Types Imports System.Math Namespace QuickParameters Public Class NETHookMain Inherits NetHook3App #Region "System Public Methods" Public Overrides Function Init(ByVal param As Integer) As MCamReturn Return MCamReturn.NoErrors End Function Public Overrides Function Run(ByVal param As Integer) As MCamReturn Using f As New MainView() 'f.ShowDialog() End Using GetParameter() Return MCamReturn.NoErrors End Function Public Overrides Function Close(ByVal param As Integer) As MCamReturn Return MCamReturn.NoErrors End Function Public Overrides Function Notify(ByVal event_code As MCamEvent) As MCamReturn Select Case event_code Case MCamEvent.OperationSelectionsChanged Dim selectedOperations = SearchManager.GetOperations() Dim ss = SearchManager.GetOperation(True) Dim xx As Boolean = ss.Selected If xx = True Then GetParameter(xx) End If 'End If Return MCamReturn.NoErrors Case Else Return MCamReturn.NoErrors End Select End Function #End Region Public Function GetParameter(Optional onlySelectedOps As Boolean = True) As Integer Dim Main As New MainView Dim sTool_typ As String = String.Empty Dim sOp_typ As String = String.Empty Dim sTool_clc As Double 'Dim ops = SearchManager.GetOperations(onlySelectedOps) Dim ops = SearchManager.GetOperations(onlySelectedOps) Main.Update() Try For Each op As Operation In ops Select Case op.OperationTool.ToolTypeID Case 1 sTool_typ = "CenterDrillTool" Case 2 sTool_typ = "SpotDrillTool" Case 3 sTool_typ = "DrillTool" Case 4 sTool_typ = "TapRHTool" Case 5 sTool_typ = "TapLHTool" Case 6 sTool_typ = "ReamerTool" Case 7 sTool_typ = "BoreTool" Case 8 sTool_typ = "CounterBoreTool" Case 9 sTool_typ = "CounterSinkTool" Case 10 sTool_typ = "EndMillFlatTool" Case 11 sTool_typ = "EndMillSphericalTool" Case 12 sTool_typ = "ChamferMillTool" Case 13 sTool_typ = "FaceMillTool" Case 14 sTool_typ = "SlotMillTool" Case 15 sTool_typ = "RadiusMillTool" Case 16 sTool_typ = "DoveMillTool" Case 17 sTool_typ = "TaperedMillTool" Case 18 sTool_typ = "LollipopMillTool" Case 19 sTool_typ = "EndMillBullnoseTool" Case 20 sTool_typ = "EngraveTool" Case 21 sTool_typ = "BradPointDrillTool" Case Else sTool_typ = "UndefinedTool" End Select Select Case op.Type Case 0 sOp_typ = "Unknown" Case 1 sOp_typ = "Contour" Case 2 sOp_typ = "Drilling 3-Axis Output Format" Case 3 sOp_typ = "Pocket" Case 4 sOp_typ = "Transform" Case 5 sOp_typ = "Multisurface rough parallel" Case 6 sOp_typ = "Multisurface rough radial" Case 7 sOp_typ = "Multisurface rough project" Case 8 sOp_typ = "Multisurface rough flowline" Case 9 sOp_typ = "Multisurface rough contour" Case 10 sOp_typ = "Multisurface rough pocket" Case 11 sOp_typ = "Multisurface finish parallel" Case 12 sOp_typ = "Multisurface finish radial" Case 13 sOp_typ = "Multisurface finish project" Case 14 sOp_typ = "Multisurface finish flowline" Case 15 sOp_typ = "Multisurface finish contour" Case 16 sOp_typ = "C-Hook Toolpath" Case 17 sOp_typ = "Manual entry" Case 18 sOp_typ = "Circle mill 3 Axis Output Format" Case 19 sOp_typ = "Point" Case 20 sOp_typ = "Trimmed" Case 21 sOp_typ = "Ruled" Case 22 sOp_typ = "Revolved" Case 23 sOp_typ = "Letters" Case 24 sOp_typ = "Swept 2D" Case 25 sOp_typ = "Swept 3D" Case 26 sOp_typ = "Coons" Case 27 sOp_typ = "Lofted" Case 28 sOp_typ = "Drilling 4 Axis or 5 Axis Output Format" Case 29 sOp_typ = "-axis curve" Case 30 sOp_typ = "Project toolpath onto a plane" Case 31 sOp_typ = "Project toolpath onto a cylinder" Case 32 sOp_typ = "Project toolpath onto a sphere" Case 33 sOp_typ = "Project toolpath onto a cone" Case 34 sOp_typ = "Project toolpath onto a cross section" Case 35 sOp_typ = "Project toolpath onto a surface" Case 36 sOp_typ = "Non-associative contour" Case 37 sOp_typ = "Non-associative drilling" Case 38 sOp_typ = "Non-associative pocketing" Case 39 sOp_typ = "Multisurface finish pencil trace" Case 40 sOp_typ = "Multisurface finish leftover stock" Case 41 sOp_typ = "Multisurface finish steep" Case 42 sOp_typ = "Multisurface finish shallow" Case 43 sOp_typ = "Multisurface finish constant scallop" Case 44 sOp_typ = "Multisurface rough plunge" Case 45 sOp_typ = "Multisurface finish -axis flowline" Case 46 sOp_typ = "Multisurface finish -axis" Case 47 sOp_typ = "Merged in ASCII NCI" Case 48 sOp_typ = "5-axis swarf" Case 49 sOp_typ = "5-axis roll die" Case 50 sOp_typ = "Unknown" Case 99 sOp_typ = "Unknown" Case 100 sOp_typ = "Thread mill" Case 101 sOp_typ = "Edit common operation parameters" Case 102 sOp_typ = "Facing" Case 103 sOp_typ = "Associative trimmed" Case 104 sOp_typ = "Solid drill control" Case 105 sOp_typ = "Slot mill" Case 106 sOp_typ = "Helix bore" Case 107 sOp_typ = "Multi-surface rough restmill" Case 108 sOp_typ = "Associative nesting container" Case 109 sOp_typ = "Multi-surface finish blend" Case 110 sOp_typ = "Multi-surface -axis, rough" Case 111 sOp_typ = "Slice 5-axis" Case 112 sOp_typ = "Port 5-axis" Case 113 sOp_typ = "Circle mill 4-Axis or 5-Axis Output Format" Case 114 sOp_typ = "Advanced drill" Case 115 sOp_typ = "Chamfer drill" Case 116 sOp_typ = "Unknown" Case 129 sOp_typ = "Unknown" Case 130 sOp_typ = "Tab cutoff" Case 131 sOp_typ = "Multi-surface rough pocket, light" Case 132 sOp_typ = "High-speed surface toolpaths" Case 133 sOp_typ = "Nesting onionskin" Case 134 sOp_typ = "2D hardmill machining/peel mill" Case 135 sOp_typ = "Saw" Case 136 sOp_typ = "FBM drill control" Case 137 sOp_typ = "FBM mill pocket" Case 138 sOp_typ = "FBM mill contour" Case 139 sOp_typ = "Solid model" Case 140 sOp_typ = "2D model chamfer" Case 141 sOp_typ = "Unknown" Case 149 sOp_typ = "Unknown" Case 150 sOp_typ = "Probe cycle: probe motion" Case 151 sOp_typ = "Probe cycle command block" Case 152 sOp_typ = "Probe cycle header" Case 153 sOp_typ = "Probe cycle trailer" Case 154 sOp_typ = "SafetyZone linking or multiaxis linking" Case 155 sOp_typ = "SafetyZone for multiaxis drill - only used for link_op" Case 156 sOp_typ = "Unknown" Case 300 sOp_typ = "Unknown" Case 301 sOp_typ = "Router contour - obsolete" Case 302 sOp_typ = "Router pocket - obsolete" Case 303 sOp_typ = "Router circmill - obsolete" Case 304 sOp_typ = "Router cutoff - obsolete" Case 305 sOp_typ = "Router surface rough pocket - obsolete" Case 306 sOp_typ = "Block drill" Case 307 sOp_typ = "Unknown" Case 415 sOp_typ = "Unknown" Case 416 sOp_typ = "Engraving" Case 417 sOp_typ = "Unknown" Case 438 sOp_typ = "Unknown" Case 439 sOp_typ = "Art" Case 440 sOp_typ = "Advanced multiaxis X9 and older" Case 441 sOp_typ = "Advanced multiaxis-Swarf" Case 442 sOp_typ = "Advanced multiaxis-Morph" Case 443 sOp_typ = "Advanced multiaxis-Parallel" Case 444 sOp_typ = "Advanced multiaxis-Along curve" Case 445 sOp_typ = "Advanced multiaxis-Triangular mesh" Case 446 sOp_typ = "Advanced multiaxis-Roughing" Case 447 sOp_typ = "Advanced multiaxis-Project" Case 448 sOp_typ = "Convert to 5-axis" Case 449 sOp_typ = "Port Expert" Case 450 sOp_typ = "Blade Expert" Case 451 sOp_typ = "Rotary advanced" Case 452 sOp_typ = "Unknown" Case 458 sOp_typ = "Unknown" Case 459 sOp_typ = "Deburr" Case 460 sOp_typ = "3+2 Automatic roughing" Case 461 sOp_typ = "Unknown" End Select sTool_clc = Round(op.CalcCycleTime, 3) Dim x As Long = Int(sTool_clc / 3600) 'hour Dim y As Long = Int(((sTool_clc - x * 3600) / 60)) 'min Dim z As Long = Round((sTool_clc - x * 3600 - y * 60), 2) Dim sTime As String = x.ToString("00") & ":" & y.ToString("00") & ":" & z.ToString("00") 'MsgBox(sTool_clc) sTool_min = op.GetMinimumZ.ToString Main.Label1.Text = op.OperationTool.Number Main.Label2.Text = sOp_typ Main.Label3.Text = op.OperationTool.Diameter Main.Label4.Text = op.OperationTool.LengthOffset Main.Label5.Text = op.FeedRate Main.Label6.Text = op.SpindleSpeed Main.Label7.Text = op.ToolPlane.ViewName Main.Label8.Text = op.ToolPlane.WorkOffsetNumber Main.Label9.Text = op.PlungeRate Main.Label10.Text = op.GetMinimumZ Main.Label11.Text = op.GetMaximumZ Main.Label12.Text = sTime Main.Label13.Text = op.OperationTool.CornerRadius Main.Label14.Text = sTool_typ Main.Show() Main.TopMost = True Next 'Main.Hide() Catch ex As Exception MessageBox.Show(ex.Message) End Try Return True End Function End Class End Namespace
  9. the mpmatster post, how to added work offset shift value, I use tox4$,toy4$,tox4$,but not change the postion.
  10. i use fq parameter input toolplane z axis offset 30mm, but i don't know the post how to calce rotary angle
  11. i want get Minimum Z by every operation for vb.net. but Z minimum is wrong value . below code vb.net 2013 & mastercam X9 For Each op As Mastercam.Database.Operation In Mastercam.Support.SearchManager.GetOperations(True) sTool_min = op.GetMinimumZ() msgbox(sTool_min) Next
  12. Hi: I use vb.net 2013 &mastercam X5 create Rectangle and Create 2D toolpath, but the toopath always fail,I tried to debug, but I failed. thanks WindowsAppVB.rar
  13. thanks a lot . but post process fail,error msg "ERROR-THE TOOL CAN NOT BE POSITIONED WITHIN MACHINE ROTARY LIMITS"
  14. The vertical 5 axis machine, A axis rotary X axis ,B axis rotary Y axis, B axis zreo on XY plane (parallel Z axis),B limit +45 to -110.(same as BC axis type) How can i configure rotaxis1$,rotdir1$,rotaxis2$,rotdir2$. see below picture picture show as B axis zero thanks
  15. vb.net2013 how can get mastercam.exe version number.below code can't get version number,thanks Public Overrides Function Version(mc_version As Integer) As Integer DialogManager.OK(Version, "Version Number") Return MCamReturn.NoErrors End Function
  16. I don't know where the problem is, and if you can provide a similar method or code, thank you very much. in vb.net source code Public Overrides Function Run(ByVal param As Integer) As MCamReturn Dim username As String Dim strComputerName As String username = Environment.GetEnvironmentVariable("USERNAME") strComputerName = Environment.GetEnvironmentVariable("COMPUTERNAME") 'DialogManager.OK(username + vbCrLf + strComputerName, "Logname") PostingManager.PostProcessorArguments = Val(username) Return MCamReturn.NoErrors End Function in mpfan.pst source code sparams : "" # Will be the command parameter line passed to the DLL strDll : "C:\Program Files (x86)\mcamx5\chooks\Logname.dll" #----------------------------------------------------------------------------- # Below code added your post same location #----------------------------------------------------------------------------- pheader$ #Call before start of file result = dll(strDll,sparams) *sparams,e$ error info
  17. in resource-> function->ico bath_16.png bath_24.png in ft file define ico FUNCTION NET "Run" dnSPNG "bath_16" dnLPNG "bath_24" dnTIP "TIP_STR" END_FUNCTION but in chooks folder no bath_16.png&bath_24.png files
  18. i need template for this method, i want get computer logname return to mastercam x5 post,thanks
  19. i use vb.net devlopment dll ,i defined ico file, but not show my define ico see below picture
  20. i want to know how to use vb.net devlopment dll link post for sample,that how can do it ?
  21. I know in pst has this parameter,but i want use vb.net to get this value,. i think know vb.net method to do . thanks.

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