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:

rocheey1

Verified Members
  • Posts

    341
  • Joined

  • Last visited

Everything posted by rocheey1

  1. should also mention using umnanaged API for listview controls would be possible in X7, but its pretty much guaranteed to break on X8 :/
  2. Just noticed the pinned topic about this ... I usually skip by them. Cleared the Chrome cache, and now it no longer accepts my password. I haven't posted for days, and I'm getting antsy ( good luck to our foreign members trying to interpret 'antsy')
  3. I'm trying this now from my cell phone. Since your recent upgrade of the forum, o am unable to post from Google chrome or desktop PC. Others may be having the same prob. But will be unable to concur. What happened ?
  4. I was unable to 'jig' geometry using the nethook API. What I was attempting to do was have the user box select some geometry, then overlay our company drawing template to the geometry. I also wanted the user to be able to drag/resize the template for a more accurate positioning / resizing of the MasterCam geometry around the title blocks/rev blocks, etc. What I ended up doing was creating an invisible userform, with the visible borders / titleblocks / etc made from labels. The interior was transparent, and allowed the geometry underneath to be visible thru the interior. I restricted the form drag/resize to the extents of the drawing window.
  5. I had a LOT of problems with the X7 betas. The current X7 is more stable for me than X6, or X5. X8 beta seems stable for me so far, but I've never been a fan of Metro/WPF interfaces :/
  6. Aren't these two statements mutually exclusive ? As a developer, and Beta tester (but not for MasterCam) I can can tell you that error messages do not necessarily originate from the error point, but percolate up. And as a contract software programmer who has been given a plate of spaghetti code (complete with spaghetti modules and spaghetti classes and with spaghetti events), I can see how this would slip thru. But you are saying a .Net app, written from scratch, will pop up this DOS error code? I searched thru the system error message archive at http://msdn.microsof...1(v=vs.85).aspx and was unable to find this error. Every error message has a code/value, could you please share this value ? Note to self: forget now ever becoming a MasterCam beta tester :/
  7. Characters SHOULD be bytes .. with the exceptions of UniCode, and the various permutations of EOB chars. But both should be constant within a specific post.
  8. I've tried *importing* iges thru code, but MasterCam changes the name of the existing MCX-7 file to the iges filename. Ive successfully imported and exported using VbScript.
  9. Unfortunately I hear this a lot at work - but usually supply the Secret Decoder Ring before i open my mouth :/
  10. Not here, either. MadPickinSkills, I'd say either upgrade your video, or get out and push. Either would be faster. :/
  11. OMG ... I'm stunned not just because it references DOS (do we have to save as 8 * 3 as well ?) but that the app was upgraded from std windows to .net winforms, at the expense of speed. We use a .net GCode editor here, which can keep up with all but the best of unmanaged apps, speed wise, but can save to all SORTS of devices, URLs, etc. Sounds like this app needs some TLC.
  12. Ive been sticking my toe into that pool recently, as well. But for the Android platform
  13. Most ppl forget to run their command prompt as admin.
  14. I know, I know.... been tryin' for years now. While I got a knack for finding bugs, they usually turn out to be my OWN code :/
  15. Anyone download the beta yet? And, more specifically, anyone here have a chance to see 'whats new' in the API?
  16. Dude ... take a browse thru the NetHook 3 API .. you will be *amazed* at what was added. Satisfied customer Hoboken, NJ, USA
  17. I had it off and on for weeks; haven't seen it at all lately, and hopefully your post doesnt JINX me
  18. i googled ''Drape C-Hook Interior Design'' and there apparently IS such an animal. But it's not for MX4 .... it's for hanging curtains :/
  19. Ill import my fixture as a solid, import my exported stl from verify, and then export them both again as stl to be used in the next verify :/
  20. FWIW, I also just cobbled together a c# nethook (VS2012) doing much the same. And it did much the same :/
  21. I just loaded 2013, and tried it again - both debug, and release; both x64 and AnyCPU. Results still the same - locks up once the 'Create new Tool" dialog is closed, toolmanager is frozen, Mcx is 'white'. (After first tool creation). If I load the nethook after i have made one tool, it works fine.-
  22. Im using MasterCam X7, 64 bit, Windows 7 64bit, Visual Studio 10, .Net FrameWork 4, NetHook3_0 if I have a simple form open in my nethook, the entire application freezes if I create a new tool. To reproduce the problem: 1) Create a new nethook using the supplied template. 2) add a new form to the application. leave all the default settings for the form in place 3) In the default NetHook Namespace, in the Mastercam RUN function (Public Overrides Function Run(ByVal param As Integer) As MCamReturn) launch your form: Dim MyForm as new Form1 MyForm.show 4) Run your Nethook, and load a Mastercam file with toolpaths (no matter what order) 5) Launch ToolManager, and create a new tool - the defaults are fine (Click "Next", click "Finish") Once you close the Create New Tool window, Mastercam freezes. Is this reproducible on newer versions of Visual Studio ? And if so, is there a workaround ?
  23. I can tell you that we use a 5 axis Heidenhain post, done thru a 'brand name' developer, and it works well. Also, canned cycles are output as conversational. Expect the post to be (partially) binned.
  24. I had thought, rightly or wrongly (is that a real word?) that he wanted the window to remain visible, and without .TopMost, the window will disappear behind MasterCam on user selection, much like hiding the form. And once .Topmost is used, I needed an extra click to set the focus back to MasterCam. Also, the IDE gives me the error that "Geometry' is not a member of 'Form.Form1". The only non-mcx reference I could find in the object browser for 'Geometry' was "System.Windows.Media.Geometry", but it doesn't contain any Public Members. A search for .Showdata in the Object browser didn't return any references.
  25. If you dont show the form modally, then your form will disappear behind Mastercam when the user selects. So, you set your form to TopMost, but then you lose the first click when the user is prompted to select onscreen. Here is a module I use for such things. Create a new module in VB, erase all text in it, and paste this in: Imports System.Runtime.InteropServices Imports System.Diagnostics Module modMcxHwnd Delegate Function EnumChildWindProc(ByVal hWnd As System.IntPtr, ByVal lParam As Integer) As Boolean <DllImport("user32.dll", CharSet:=CharSet.Auto)> _ Private Function EnumChildWindows(ByVal hWndParent As System.IntPtr, ByVal lpEnumFunc As EnumChildWindProc, ByVal lParam As Integer) As Boolean End Function <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _ Private Function GetWindowText(ByVal hwnd As IntPtr, ByVal lpString As String, ByVal cch As Integer) As Integer End Function <DllImport("user32.dll", CharSet:=CharSet.Auto)> _ Private Function GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer End Function <DllImport("user32.dll", SetLastError:=True)> _ Function SetActiveWindow(ByVal hWnd As IntPtr) As IntPtr End Function Private lstChildrenHandles As New System.Collections.Generic.List(Of IntPtr) Public McxMainHwnd As IntPtr = IntPtr.Zero ' Handle to main MasterCam window Public McxOpMgrHwnd As IntPtr = IntPtr.Zero ' Handle to the Op Manager Public McxGfxHwnd As IntPtr = IntPtr.Zero ' Handle to the Graphics Window Sub GetMcxHandles() Dim RetVal As Integer Dim procC As New EnumChildWindProc(AddressOf EnumChild) Dim procD As New EnumChildWindProc(AddressOf EnumChild) Dim stringBuffer As String = New String(Chr(0), 256) ' get the current MasterCam Process Dim myProcess As System.Diagnostics.Process = System.Diagnostics.Process.GetCurrentProcess() ' Get the window handle to main mastercam window McxMainHwnd = myProcess.MainWindowHandle ' loop thru and look at all the Mcx Child Windows lstChildrenHandles.Clear() EnumChildWindows(McxMainHwnd, procC, 0) For Each wHndChild As IntPtr In lstChildrenHandles RetVal = GetWindowText(wHndChild, stringBuffer, 256) ' Get the window title of each window Dim sClassName As New System.Text.StringBuilder("", 256) Dim childTitle As String = stringBuffer.Substring(0, RetVal) Call GetClassName(wHndChild, sClassName, 256) If childTitle = "Op Manager" Then ' found Op Manager McxOpMgrHwnd = wHndChild ElseIf childTitle = "" And sClassName.ToString = "Afx:0000000140000000:ab:0000000000000000:0000000001900011:0000000000000000" Then ' main ghraphics window McxGfxHwnd = wHndChild End If Next End Sub Private Function EnumChild(ByVal hWnd As IntPtr, ByVal lParam As Int32) As Boolean lstChildrenHandles.Add(hWnd) EnumChild = True End Function End Module When you call the sub "GetMcxHandles", it finds Mastercam in memory, and, specifically, the Graphics window. To use in your code, modify your sub like the following: Dim GeoMask As GeometryMask = New GeometryMask(False) GeoMask.Lines = True GetMcxHandles() ' call main routine to find mastercam in memory SetActiveWindow(McxGfxHwnd) ' set the focus to MasterCam gfx window Dim SelectedGeo As Mastercam.Database.Geometry = SelectionManager.AskForGeometry("Select one line", GeoMask) SetActiveWindow(Me.Handle) ' set the focus back to your form This code was tested under MasterCam X7, and 64bit. The calls should work in 32 bit, tho.

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