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:

srbeyke

Verified Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by srbeyke

  1. Jeff, I deleted my code to make way for your code. I cut and pasted your example. I still had an error in the "For Each" line. So I added an "imports mastercam.database" and it seems to have cleared the problem. I think the "imports" statement in VB is similar to the "Using" statement in C#. I will test this as it is, and then start the process of tweaking it to do what I hope to do. You have been a great mentor and I appreciate the help. regards, Steven
  2. Jeff, Here is a short and clean version of the code I am working on: Dim WireFrameMask = New GeometryMask(True, True, True, True, True, False, False) Dim allWireframeEntities = SearchManager.GetGeometry(WireFrameMask) For Each (Dim wireframeEntity In allWireframeEntities()) Select Case wireframeEntity Case PointGeometry point ' Do something with the point geometry Case ArcGeometry arc ' Do something with the arc geometry Case LineGeometry line ' Do something with the line geometry End Select Next The first and second lines seem to be correct. No errors shown. The third line containing the "For Each" statement returns several errors including : "expression expected" "')' expected" "number of indices less than the number of dimension in indexed array." My guess is that the WireFrameEntity is not properly dimensioned or something. I tried to use your example as a guide, but I have obviously missed something . Thank you for taking the time to assist., me Steven
  3. Jeff, I would be glad to post what I have, but Give me just a little time to clean up my mess so don't look like the total idiot that I probably am. Steven
  4. Jeff, I must be as dense as a block of lead. I cannot get my system to allow me to enter the code without producing errors. I am sure this is due to my inexperience with both the MASTERCAM API and the VISUAL BASIC 2015 that I am using. I am attempting to take VBSCRIPTS that have been working well and translate them into nethooks. I initially thought it would not be as difficult to translate scripts that were proven to work. If there Is anything additional you can add It would be very helpful. best regards, Steven
  5. Thank you for the example. I will work with it and see what I can do. If anyone else has something to share also, I would very much appreciate it. So much to learn... Steven
  6. Hello all, I am progressing with converting from VBSCRIPT to using VISUAL STUDIO to create nethooks. I am currently trying to convert one of my scripts to a nethook. Since the script has been working well, I thought it a good project to start with. Can someone please pass along a project that shows how to do the equivalent in visual basic as the "Startdbsearch" / "Nextdbsearch" routine did in VBSCRIPT? I would like to select all existing geometry and sort it out. I am still trying to get an understanding of the the API. Thanks for any help provided. Steven
  7. Jeff, I finally got the download. I logged on, but did not find the files. I contacted my retailer and he had the same issue until he "jiggled the handle"\ by refreshing the "Mastercam Version" window a few times. Thanks again, will make for some interesting reading. Steven
  8. Jeff, Could you please post a link to where you found the API REFERENCE? I have been searching for the past half hour and have not found it. Thank you Steven
  9. Jeff, Thank you for following up. I did locate the sample files on the website. The issue may have been that I didn't log in, or something. I did get VISUAL STUDIO up and running, and was able to install the sample project. As I mentioned to my retailer, this must have been a training exercise in itself because the projects were from a previous version and all the data paths had to be changed as well as some other references. I did get a project to compile and copy the files into the chook folder. I still get a "COM" error when trying to DEBUG. I am looking into that as time permits. The project compiled with no errors or warnings so I take that as a good sign. I will go and try to find the API reference you mentioned. I believe that may be my key. After kicking the curb for so long, I may now have a toe-hold. Thanks again. Steven
  10. Thanks for all the suggestions so far. I am making a small amount of progress, but it feels like I am banging my bare toes against the curb. Steven
  11. Jeff, Thank you for responding. After MUCH searching I did not find any examples to download. I did however, find where users were asking questions about their own concerns. I did not find anything regarding changing tool and toolpath parameters. Perhaps I was simply looking in the wrong place, or did not understand what I was looking at. Much appreciation to anyone willing to give some assistance. Steven
  12. I am still using old school ( VB SCRIPT) until I can get my new school ( .NET ) built. Will anyone pass along some examples of scripts and / or .NET projects that change the machining parameters of a pre-existing tool and toolpath? Actually, I would appreciate ANY examples anyone would be willing to share. All help is very much appreciated. Steven
  13. Thank you for your in depth reply. It does indeed answer some of my questions. I did "miss-speak" when I asked about integer numbers allowed for names. I was understanding that the lable for numbered levels would be an integer number, ie "1". Given this, then level 501 may have a lable of "1", 502 could have a lable of "2", and so on. Please clarify if this is not the case. If I choose all numbered levels, then is this the same as telling it to chain ALL levels, regardless of being named or not? again, thank you for your assistance. As you can see, this type of detailed information is very difficult to find, Best regards, Steven
  14. rocheey1, In the VBS Mastercam help file, I find the following: Bool ChainAll( Bool, (Input : only generate closed chains?) Bool , (Input: only find chains at Z=0?) Integer, (Input: only find chains on this level? Use mcCHAIN_ALL_NUMBERED_LEVELS for all levels) String (Input: only find chains on this level? Use mcCHAIN_ALL_NAMED_LEVELS for all levels) ) Can you please explain a little on how Mastercam looks at the level names? Does Mastercam start at level one and work upward? If so, then would not levels be chained by assending level numbers? Does Mastercam sort all the level names and then chain in numerical order? Are only integer numbers allowed for names? Your feedback is very much appreciated as this information is not available in the help files. Regards, Steven
  15. Does anyone have any suggestions? regards, Steven
  16. Hello again, I would like to ask a couple of questions that might get me moving.... Can I use VBS to append another chain to an existing toolpath? If I have several toolpaths using the same tool and parameters, can I somehow collect all the chains and make one toolpath? Is there any way to manipulate the chain manager from VBS, and if so, where do I get some information? I very much appreciate any help anyone can give. Regards, Steven
  17. Hello all, I am currently running X-5, and trying to sort some chains for a toolpath. Using VBS, I have sorted 170 closed chains to different levels using the geometry's "Z" dims. Each closed chain is on a different sequential level with sequentially higher z depths. These levels have names "1" through "170". Can I chain these levels in lable order, or can I append chains by turning on or selecting levels? how do I cause starting points on each chain to start at a prefered location? Any information is most appreciated. Steven
  18. GREAT! Thanks for the reply. This is a wonderful start. Do you have any ideas how to sort chains by depth, select by order of depth, and start each chain at a prefered point? Any insight is appreciated. Steven
  19. Does anyone have any VBS examples of using the chain manager that they are willing to share? Also, any examples of setting any of the toolpath parameters. I have not found any info on setting Leadin and lead out using VBS. Thank you for any help you can give. Steven
  20. Hello again, I seem to need a little more help. Can anyone provide some SCRIPT examples of creating and modifying toolpaths? I would very much like some examples of chaining, and sorting chains. I have a project where a single contour path will contain up to 100 chains and should be sorted by "Z" level. Can anyone provide some examples of sorting chains in a toolpath, or information on how to sort while chaining? any information is much appreciated. Steven
  21. Hello again, Making great progress now.. thanks to all your help. Does anyone know how to retrieve the NC FILE NAME or the PROGRAM # from the toolpath group or using VB script? Thanks, Steven
  22. Thank you for the help. Could you please clarify where to get the list of commands for the "runmastercamcommand" function? I did not see what I expected to see in the help file. I did see a list of calls in the VB example for version 9, showing all the mastercam calls. Also, could you please explain calling hot keys? You have been most helpful and I really appreciate the time you are taking. Regards, Steven
  23. I have just tried several different calls to the MASTERCAM.FT file. None of them worked. Could it be that I do not have the location of the file correctly mapped out? Do I need to set any part of the configuration to allow Mastercam to use this function? All help is appreciated. Regards, Steven
  24. Hello all, I am currently using X5. I wish to find all available information for using VB script to automate as much of the "routine" tasks as possible. A very simple example would be to post to several different machines automatically. ( this routine partially functions, but the editor keeps popping open for each machine even though I have tried to keep it closed) I have read the "MASTERCAM.FT" file and found that many funtions can be called from SCRIPT as long as the correct parameters are used. Where can I find any detailed information on the proper use of this file? When should I pass any parameter along with the function call, and how do I know what they are? I have tried using some of them from script with less than total success. Can any hot keys be called directly from script? If so, how might I do it? I have also read the MASTERCAM help file located in the editor used for VB script. Much of that information also refers to "MC9" data. Is this file up to date? While looking through it I do notice that many of the calls do reference new features, but yet I feel something might be missing. Can anyone provide some insight ( examples of code) that would aid me in my learning process? Just for example, I translated (copied) some geometery. I ended up with both group and results. How do I clear the colors from both the group and the result? I tried using the 'CALL RUNFTCOMMAND("MASTERCAM","ClearColors")' but it did not work. Again, perhaps I am missing something. Also, I have tried using the "create_letters" function without any luck. If possible, please point me in the right direction. I have asked my tech support group for all the information they had. While they were very receptive to my questions, they did not have much information. Any and all help is most appreciated. Regards, Steven
  25. Thank you for the reply. I modified the code so that I generated the ascii file complete with row separation. Works great. I guess I was trying to make it more complicated than it needed to be. Thanks again for the help. Regards, Steven

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