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. One other thing - once you stop using .ShowDialog, your form can get sent to the back, behind Mastercam. To keep this from happening, set your form to .topmost
  2. Well, if your Form is shown as non-modal (not ShowDialog), you should be able to click on the entities, just tried it, and it works ...... however ... you have to click on the graphics screen first to set the focus, so your first click is wasted. There is another way to set the focus to the graphics window beforehand, using Interop API calls. This type of coding is not guaranteed to work between major versions, tho. Lemme know if you are interested ...
  3. AFAIK, you gotta edit 'em the same way you created them. If you had made them using "Combine Operations" on your extrude cuts, it woulda been easier.
  4. Looks like a healed STL to me ... which could be a product of the software that was used
  5. same problem here. except i was able to create something close using just parameters, and no geometry, as a workaround.
  6. The MasterCam .net API allows a program to be notified just before, and just after a save is done. I'm running my own little macro on myself, partially to keep track of what, and when, things were done. It pops up a little box letting me add a description before it saves, then logs the date/time/description of the save. You might also wish to check out these post parameters (I have never used these, myself) 15087 Selected for editing, deleting and reordering (True/False) 15095 Binary NCI of operation has been edited (True/False) 15326 Number of times the operation has been edited 15338 Toolpath edited (True/False)
  7. Not robustly. And definitely not pretty enough code to post here :/
  8. sounds like deleting the op, and then recreating/re-importing will be faster
  9. TY Roger, again ... I did a lousy job of explaining in the duplicate post
  10. Check out: Mastercam.App.Types.MCamReturn = 1 (escape key hit)
  11. that's a rather vague question. Outline? Not sure how that pertains to Active Reports. User defined menu? In Mastercam, or ActiveReports?
  12. do you have any manual ops in there? I seem to remember having to workaround something very similar to this when I parsed the results of the mill.set file.
  13. do they all use the same post? i have vbscript that changes the post name for an individual mcx drawing; it wouldnt be much to add a folder to look in, then have it open and do all mcx files in that directory, and all subdirectories.
  14. drop to a dos box, and type in the word "SET". There should be a listing there that says "TEMP=" (and then a path). That is the path to your windows Temp dir. (%TEMP%). Its a hidden (system) folder; make sure you enable viewing of those files. Cheers.
  15. If you used the embedded generic .FT file with the wizard, AND the resources are in the "Resources" folder of your .Net project, then add the line in RED to your .ft file: FUNC_DLL "chooks\Drill_auto.dll" RES_DLL "chooks\Drill_auto.dll" dnRES_NAME "Drill_auto.Resource" CATEGORY "NeTHook"
  16. or run the .exe, and before you close it, look in your %TEMP% dir. The source files will be there, and it runs a little faster.
  17. if they are also cutting the exact same geometry, the colors shouldn't change
  18. Any time I try to create a new tool in MasterCam X7, the Tool Manager just freezes. I end up having to kill Mcx thru Ctrl-Alt-Del. Im working around this by coping a random tool from a random library, then re-editing the tool to make a 'new' tool. I was previously running 32 bit ver of X7, 4 gigs Ram, and did not have this problem. I recently wiped my hdd clean, installed 64 bit, using 10 gigs ram, Quadro FX1800, and have installed the latest OEM network / Gfx drivers. I have disabled the antivirus, ensured no extraneous programs are running, and have no other apps installed on this box except for MsOffice. Any ideas ?
  19. Could you possibly have a NetHook/CHook watch a folder for file creation/modification? We are currently doing this as real-time SPC; not with MasterCam, but with Excel. But the principle would be the same, just use a different host application.
  20. Haa haa, I had to reinstall when I tried that. But one CAN disable the service
  21. Sorry for the late reply. Just got some free time to try it out today. Works great! You da man, Roger!
  22. and those are awesome examples. I'd bet those two snippets, along with my fav, "Toolpath Door CHook.vbs", are plagiarized more than any other code except the very first "Hello World" program. (at least after I was done with them) If you want a little more functionality than they give, its a LOT more work, and less speedy code (CHooks excluded, natch) and as you can see from my Last Post , me and my old friend VBScript still spend some quality time
  23. Are there different types of "selected" states for entities? I ask because, other than using "SelectionManager.SelectAllGeometry()", which highlights the selected Geometry like manual selection, any other type of selection thru code does not highlight the entities. It seems that only the highlighted entities will get erased by hitting the "delete" key. Selecting entities thru code, and verifying that they are selected, will not be erased when hitting the 'delete' key. And it is also the same for code requiring preselected geometry. Im bringing this up because I need to preselect geometry thru code. Manually selecting beforehand, or using "SelectAllGeometry", works. Ive tried 'SelectAllGeometryOnLevel', and SearchManager.GetGeometry. Ive then run a loop to debug.writeline geometry.selected, and it comes back TRUE. I can also rerun the loop and use Geometry.selected=False, and debug,writeline tells me the geometry is not selected. Im trying to translate, and scale, a large amount of entities. The .net version is prohibitively slow, and Ive found that outputting some on-the-fly vbs works well. However, it only works on geometry that is preselected manually, or preselected using SelectAllGeometry, which highlights the geometry. The selection thru VBS "Chaining" fails the same way .... I either have to manually preselect, or use "SelectAll" Is there another way ?
  24. Well, first,, there are two ways I know of to access the tool info - 1) from the tool library inside the MCam document, which would be all tools, regardless if they are used or not 2) by parsing thru all the (selected) operations, and getting only the tools used, but you have to filter out the duplicates. Second, you didnt specify what version of MasterCam you are coding for. The code below works in MCam X6, but SHOULD work as legacy in X7. (using the supplied Nethook 2 lib) Third, if you have the choice, GO WITH X7. The nethook library has been drastically updated, and you can access all Tool Params, where in X6, it is limited. The first sub below will run just by calling it. It gives you all the tools in the MCam document. The second requires you to select some operations before you call it. It will give you a list of only the tools used, with duplicates filtered out. This list is not sorted (because your head may explode) but when you are ready for sorting, gimme a whistle. The MCam Excel lib is very stable; however, if you need more functionality, you'll need to roll your own, and Late Binding has proved for me to be the most stable between Office versions. Cheers. Sub GetLibraryTools() Dim AllTools() As Mastercam.Database.Tool = Mastercam.Support.SearchManager.GetTools() 'GC.Collect() ' uncomment this line if you are getting strange crashes in X6 Dim ToolNumber As Integer = 0 Dim ToolDia As Double = 0.0 Dim FluteLength As Double = 0.0 Dim Msg As String = String.Empty For Each SingleTool As Mastercam.Database.Tool In AllTools ToolNumber = SingleTool.Number ToolDia = SingleTool.Diameter FluteLength = SingleTool.FluteLength Msg = Msg & ToolNumber.ToString & vbTab & Format(ToolDia, "0.000") & vbTab & Format(FluteLength, "0.000") & vbCrLf Next MsgBox(Msg, MsgBoxStyle.Information, "Complete Tool List") End Sub Sub GetOperationTools() ' parse down selected ops and get tools associated with those SELECTED ops Dim op As Mastercam.Database.Operation Dim OpList() As Mastercam.Database.Operation = Mastercam.Support.SearchManager.GetOperations(True) Dim intOuterLoop As Integer = -1, intInnerLoop As Integer = -1 Dim ToolIsDuplicate As Boolean = False Dim ToolList() As Mastercam.Database.Tool = {} Dim ToolListCount As Long = -1 Dim ToolNumber As Integer = 0 Dim ToolDia As Double = 0.0 Dim FluteLength As Double = 0.0 Dim Msg As String = String.Empty For Each op In OpList Select Case op.Type Case 17, 4, -1 ' MANUAL, tRANSORM, OR UNKNOWN - no tool or cant extract tool Case Else Dim SingleTool As Mastercam.Database.Tool = op.OperationTool ToolNumber = SingleTool.Number ToolDia = SingleTool.Diameter FluteLength = SingleTool.FluteLength ToolIsDuplicate = False If ToolListCount = -1 Then ToolIsDuplicate = False Else ' check the list For intInnerLoop = 0 To ToolListCount If ToolNumber = ToolList(intInnerLoop).Number Then ToolIsDuplicate = True Exit For End If Next End If ' If our Tool is not flagged as a duplicate, add it to the array If ToolIsDuplicate = False Then ToolListCount = ToolListCount + 1 ReDim Preserve ToolList(ToolListCount) ToolList(ToolListCount) = SingleTool Msg = Msg & ToolNumber.ToString & vbTab & Format(ToolDia, "0.000") & vbTab & Format(FluteLength, "0.000") & vbCrLf End If End Select Next op MsgBox(Msg, MsgBoxStyle.Information, "Operation Tool List") End Sub FYI: check out this link: http://www.emastercam.com/board/index.php?showtopic=65946

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