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:

JCDFCM

Verified Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by JCDFCM

  1. Mick, I would like to run a script that executes an .exe then resumes the script of importing an operation into the current MC9 file and applying the imported toolpath to preselected points. I tried following your ToolpathDoor example and do not understand the MakeOperationFromName logic....particularly after the Then keyword. Documentation says function returns operation ID# or mcOPERATION_INVALID . When I run your sample script, everything works. If MakeOperationFromName(operationsLibrary,DEF_OP_INSIDE_ROUGH_POCKET,DEF_OP_INSIDE_ROUGH_POCKET, overrides) <> mcOPERATION_INVALID Then ' ******************************************************* ' * Import Operation and apply our finish contour routine ' ******************************************************* Else ShowString "Could not apply " & DEF_OP_INSIDE_ROUGH_POCKET & " operation" Call Init Exit Sub End If When I run the script below, notepad pops up and execution pauses until I close notepad as intended but then I get the "could not apply toolpath". If I understand the inputs, the 1st arg is the .operation-9 filename that I exported out to a library directory, then the operation name, then the comment. What am I missing? The script below is informal and was meant to just test out concepts and logic. Thanks, JCDFCM '// Description: Test calling up an executable then import an operation '// and modify it's feed, speed, and op comment. '// Comments: Using version X9 ' Constants Public Const DEF_NOTEPAD = "C:\test\notepad.exe" Const OP_FILE = "C:\test\Threadmill_Jc.operations-9" Const OP_NAME = "Thread Mill" Const OP_COMMENT = "Threadmill 1/4-20 3x" ' Start Script Call Main() Sub Main() Dim FSO, strShell, overrides Set FSO = CreateObject("Scripting.FileSystemObject") strShell = DEF_NOTEPAD Call ShellAndWait (strShell, True) Set overrides = New McOverride With overrides .FeedRatePercentOn = False .FeedRate = 80 .SpindleSpeedPercentOn = False .SpindleSpeed = 80 End With If MakeOperationFromName(OP_FILE,OP_NAME,OP_COMMENT, overrides) <> mcOPERATION_INVALID Then '??? Else ShowString("Could not apply Threadmilling toolpath") End If ' -- Clean up Set FSO = Nothing End Sub
  2. Is there some type of security provided with the integrated ActiveReports that comes with Mastercam. I basically open the particular .rpx file and go to the script tab to add or modify code. As the project grows, code can become lengthy and complex and probably should be protected. Currently users can open up the file and experiment. I believe you can turn off the script tab when you are distributing the EndUserDesigner with your report project when using the standalone version of ActiveReports with the following code: reportDesigner.EnableScripting = false; But what about our Mastercam version? Or is this a Windows file system topic? Thanks, JCDFCM
  3. I'm not familiar with the Mastercam posts and am curious if there is a setting or config option that will generate the tool name and tool description in the NCI file. Currently our NCI file only contains the tool name after posting. Thanks, JCDFCM
  4. In order to produce two separate tool sheets, one graphics based for building the tools and one text based to be used at the machine at the same time, I could possibly do the following: 1) Execute ActiveReports to write out the op comments to a text file and create the Tool Assembly graphics. 2) Post the Mastercam program which will buffer out the N#, T#, and tool description of each tool to a text file and after posting, execute the AfterPosting event code from the NetHook which will contain the VB.Net code to read in the text file containing the op comments and read in the buffered out file containing the N#, T#, and tool description of each tool and format the desired tool sheet. 3) Maybe even write a VB script that will launch the ActiveReports setup sheet followed by posting the program with one click of a button. Questions: 1) Is there a Mastercam project template for Visual Studio/VB.Net 2010? 2) Is the reason for setting the flag to indicate executing the NetHook code only if you are posting for the mill that you wanted this special tool list for? Thanks, JCDFCM
  5. Hello, We use an app that reads an external database to search for a tool then creates a .tooldb file representing that tool and saves it to a specific directory. User then brings this tool into the mastercam session via tool manager with all fields populated. The directory starts filling up and the .tooldb files get deleted for maintenance purposes. The problem I am having is when I go to clean out this directory and select the files to delete, I get a "The action can't be completed because the file is open in vshost32.exe close file and try again" error. Below is the relevant code...am I closing the database correctly? What is vshost32.exe? ' Declarations Public MasterCamConnection As New SQLiteConnection() Public MasterCamCommand As New SQLiteCommand “ “ “ “ Dim MasterCamConnectionString As String = "DataSource = " & MastercamToolFileName & ";Version=3;New=False;Compress=True;" ' Connect to the newly created .tooldb MasterCamConnection.ConnectionString = MasterCamConnectionString MasterCamConnection.Open() MasterCamCommand = MasterCamConnection.CreateCommand() ' Modify columns in the TlToolMill Table UpdateNeckDiameter() UpdateNumberOfFlutes() UpdateMfgEdpNumber() “ “ “ “ If Not IsNothing(MasterCamConnection) Then MasterCamConnection.Close() End If Any help is greatly appreciated. Thanks, JCDFCM
  6. Our goal is to update the Cam system with any manual edits and repost...tedious but it's nice to have a mastercam file match what is actually being run on the floor. With that said, sounds like I should continue in the post direction as you mentioned above. In hopes of understanding what your suggesting, using a buffer will post a partial file in addition to the full posted nc file at the same time as well as at the end, the post runs a .set file that would read the partial file and format it to our preference? What would be less painfull, writing the formatting logic in a custom post or in the .set file...or ActiveReports? Thanks, JCDFCM
  7. Thanks! That is how our current software is setup...a lot to be said on both files being in sync and produced with a single action. Will pursue that direction...you answered my question. JCDFCM
  8. I should clarify what I am after. The tool number, op number, comment, cycle time, etc. are all passed as XML tags and X+ and ActiveReports will both easily handle that type of info. What I am after is the N number from the posted output where the tool starts, it's in the NC program...it's the line number where you would call it up to run a specific tool in the middle of the program and adding that line number into the setup sheet. We currently have this in another CAM system that we use and would like to carry that functionality over into Mastercam. Thanks, JCDFCM
  9. If you look closer at the example tool list above, you see N15 above tool 47 and N5382 above tool 48...to do that, a reporting system would have to provide logic to either read the NCI file or the posted output and determine the line number of each occurrence of each tool. Additionally I need to list all operation comments under each occurrence of each tool as it is common for us to use the same tool at different parts of the program and utilize G10 lines to adjust part features cut with the same tool independently. Can X+ or Active Reports format a tool sheet like above or does the post processor have more lower level control accessing the NCI file. Though I have some VB.Net experience (not an expert), sometimes going a different direction can provide better results. My guess is that X+ is quick, down and dirty but will not provide the flexibility of Active Reports which has the power of .Net...of course at the expense of a longer learning curve. I would like to know if the post processer has access to more of the NCI file than the XML tags that Active Reports utilizes. Thanks, JCDFCM
  10. Hello, When it comes to creating setup sheets, which has more power and flexibility: Post Processing or ActiveReports with .Net? Below is a bare bones, to the point tool sheet with no graphics as an example: SEQ # | | TL # | TOOL ID | DESCRIPTION | GL N15___|___________|________________________________________________________|______ 47 |7000-85520 |.500 DIA 2-FLT EM 1.750 EXP |5.100 | | G10 L11 P47 R.000 (ADJUST LENGTH OFFSET) | | | G10 L13 P47 R.000 (ADJUST DIA COMP) | | | * ROUGH FACE BOSS | | | * REMOVE MATL | | | * ROUGH AROUND BOSS | | | * CLEARANCE STEP | N5382 |_______ ____|________________________________________________________|______ 48 |7000-84820 |.375 DIA 2-FLT EM 1.750 EXP |6.490 | | G10 L11 P48 R.000 (ADJUST LENGTH OFFSET) | | | G10 L13 P48 R.000 (ADJUST DIA COMP) | | | * FINISH O.D. | | | * FINISH FACE 2ND LEVEL | | | * FINISH BOSS | | | * FINISH FACE BOSS | Above, you can start tool 47 at line 15 in the program and the op comments of each tool are below the G10 lines. Sometimes the same tool will be used later in the program but we do not want all op comments per tool, we want them only when the tool is used. Not being familiar with the post language, but familiar with .Net, what direction would be more practical to generate the above? Which would be worth investing in the learning curve it would take to make any type of setup sheet or documentation? Thanks, JCDFCM
  11. the string is: BT40 - SEALED PRECISION COLLET CHUCK 3.54 GL - LYNDEX - VC13-90 the XML result: <HOLDER-NAME>BT40 - SEALED PRECISION COLLET CHUCK 3</HOLDER-NAME> 38 characters including white spaces. My intent is to create a holder in the stand alone tool manager and input a long descriptive name that I can apply string functions in the scripting of ActiveReports to extract what I need in the report. After I run a report, is shows exactly what is in the raw XML. Thanks, JCDFCM
  12. Hi Mick, It is the raw data from the generated xml file from Mastercam, I call it up in Visual Studio. The HOLDER-NAME tag is truncated. Thanks, JCDFCM
  13. Is there a limit to the number of characters that an xml tag can contain after generating the xml from a setup sheet. In the stand alone tool manager, I enter a long description for the tool holder name and had planned to extract what I need from the "HOLDER-NAME" tag but when I look at the xml output, it cuts off some of the characters that I entered in the name field of the tool holder. Is there any way around this? Thanks, JCDFCM
  14. Hi Mick, Thanks for the quick response. This is what I was looking for. So I could include an Imports System.XML.XPath statement at the beginning of my script and utilize XPath statements to search and modify the nodes in the generated XML file from Mastercam? I had planned on entering extra information in the fields of tools in tool manager and had hoped to be able to extract portions of the XML node (or tag) output and assign to a variable that can be used in the text property of a textbox controls. Would be sweet if that could be done. Happy New Year, JCDFCM
  15. Hello, Does the built-in ActiveReports in Mastercam X9 have full functionality of the version I see from GrapeCity on the web? I see an $800 standard edition as well as the $1600 professional edition with a 1000 page user guide for ActiveReports version 9 while not seeing to much in the Mastercam help. Does the Mastercam version allow VB.Net as when I hit the script tab, C# syntax shows up. If so, how do I use VB? Is it just the scripting language that can be used or do I have the full blown VB.Net at my disposal? I've invested time in Visual Studio/VB.Net as well as XML and wonder if it's worth bringing in the XML output from Mastercam into an ActiveReports application from outside Mastercam and being able to create detailed setup sheets with no limits? Thanks, JCDFCM
  16. Hello, Is it possible to access and modify the manufacturer name drop-down list? The X9 dialog in the tool manager only provides a drop-down list preventing the user from entering specific tool vendors such as Hanita, SGS, Fullerton, etc. Via NuGet/SQLite, I am able to access and modify the values of a .TOOLDB file and read it back into Mastercam, however I cannot seem to modify the Manufacturer name of the TLManufacturer table... this one field is being feisty. We have multiple cam systems and need to draw from one external cutting tool database which then updates and renames a stored .TOOLDB file. I followed a similar post "Tool manager - manufacturing names update??? in the Industrial forum but did not see a solution. Is it possible to update the Manufacturer name list via the Mastercam API?. Or is there some config file that a user can modify the list to represent the tool vendors that his or her company uses? Any help would be greatly appreciated. Thanks, JCDFCM
  17. Hello, Has this topic been resolved? I followed the posts and did not see a solution. I am using X9 and still cannot modify the Manufacturer name to a vendor such as Hanita, SGS, Fullerton, etc. I even went as far as developing a VB.Net app only to find out that I can modify most of the fields in the tool manager dialogs when defining an end mill except for...you guessed it: the Manufacturer name. As someone mentioned earlier, we have to constantly update our tool lists. We have multiple cam systems and need to draw from an external database and this one field is preventing us from true automation on the MasterCam side. We are happy with the system and for the most part have switched over to Mastercam as our primary system but we need a workaround for this issue. Any help would be greatly appreciated. JCDFCM
  18. Mick, You mentioned to be wary of making changes unless you know what you are doing...does that mean it is possible to read and write to a tooldb file? I would like to be able to connect to and update a tooldb file, rename it, then retrieve the new file in Mastercam. I would not use any of the Mastercam supplied tooldb files, I would create one, save it, and constantly reuse it. My current application connects to an external database and works in disconnected mode allowing the user to find the desired tool, then I had hoped to update a tooldb file with the values from the external database. I originally was updating the exported text file (now outdated). If it can be done, I would like to obtain the NET-HOOK project you mentioned. Thanks, JCDFCM
  19. Thanks Rich, I currently export XML from my VB.Net tool object for ProEngineer (but we're phasing out ProE). I do feel comfortable working with XML...can Mastercam import an XML file to populate the X9 tool dialog boxes? I thought Mastercam could only import text and not XML. The reason I tried the import text route first is it allowed me to generate tool files for different CAM systems from an external application not tied into a specific CAM API...however, if I can accomplish the same result with Mastercam's API, I wouldn't mind venturing into the .NET-HOOK world. Thanks, JCDFCM
  20. If you define a new end mill with the taper style shank, the Taper angle and Taper length is not output to the converted text file. I read the commented section of the text file describing lines 1-11 and it appears that there is not a field designated for each textbox in the Define End Mill dialogs of X9. Is this where .NET HOOKS and C-HOOKS come into play? I have a VB.Net routine that converts a record of a database into the text format that is output from MasterCams convert library to text and it's close but not close enough. Is the text file intended to be used in this manner? Thanks, JCDFCM
  21. JParis, Thanks for the detailed demo...it worked just like you demonstrated. After the Convert library to text, I was expecting a Save As instead of an Open button and I'm still unclear on the order...but it works fine. I did notice that if you define a new end mill with the taper style shank, the Taper angle and Taper length is not output to the converted text file. I read the commented section of the text file describing lines 1-11 and it appears that there is not a field designated for each textbox in the Define End Mill dialogs of X9. Is this where .NET HOOKS and C-HOOKS come into play? JCDFCM
  22. Hello, I am having trouble converting a library tool file to a text file in X9. If you click on a tool in the library tools or part tools, right click - Import/Export tools, convert a library to text, this brings you into the select tool library dialog and does not allow you to save to a text file. I would like to see the text output file from X9 as Tool Manager still converts an X7 text file into an X9 library tool but doesn't seem to populate the new tool manager dialogs correctly. Any help is greatly appreciated. Thanks, JCDFCM
  23. Hello, There still is a problem. If you click on a tool in the library tools or part tools, right click - Import/Export tools - convert a library to text, this brings you into the select tool library dialog and does not allow you to save to a text file. I would like to see the text output file from X9 as Tool Manager still converts an X7 text file into an X9 library but doesn't seem to populate the tool manager dialogs correctly. Any help is greatly appreciated. JCDFCM

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