Search the Community
Showing results for tags 'VB Script'.
-
Good Morning All, I have recently been working on automating some rather repetitive steps that we take between NX and MasterCAM. I have the NX part complete but seem to be having a hard time finding much research material online for Mastercam VB Scripting. In UG I could record a macro in VB and learn and tweak from that but I am having a hard time figuring out a good way do do something similar in Mastercam. I have scavenged through the example VBS files and managed to pick out a little of what I needed but it is minimal. The steps I am needing to take are... 1) Draw 2 lines outside of the part. 2) Create a Ruled/Lofted Surface between these two lines. 3) Create Curve at Intersection a) Selecting a Parasolid that is already open. Using the Created Ruled/Lofted Surface as Intersection of Parasolid. Can you please point me to a good resource or example for these steps that I can pick apart a bit? Thanks all! James Here is what I have so far, it isn't much yet... Public Const PlaneLevel = 2 Call Main() Sub Main() Call ResetAll Call CreateOutline Call RepaintScreen(True) End Sub Sub ResetAll() Call RepaintScreen(True) Call ClearPromptLines End Sub Sub CreateOutline Dim CLine Dim intRet Set CLine = New McLn With CLine .X1 = -20 .Y1 = -30 .Z1 = 0 .X2 = -20 .Y2 = 50 .Z2 = 0 intRet = CreateLine(CLine, mcCONSTRUCTION_COLOR_CURRENT, PlaneLevel) .X1 = 20 .Y1 = -30 .Z1 = 0 .X2 = 20 .Y2 = 50 .Z2 = 0 intRet = CreateLine(CLine, mcCONSTRUCTION_COLOR_CURRENT, PlaneLevel) End With Set CLine = Nothing End Sub
-
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
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.