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:

pkrzic

Verified Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by pkrzic

  1. But there is still no sign of "X2_Add_Ons" folder or "MD_CD_PST Path Utility (X2-MR2).zip"....
  2. Helho, I can't find this utility any more. Could anybody please attach a link to this utility. Thanks.
  3. Hello, My company just bought an old 5-axis machine with a FIDIA M20 control. We got no additional documentation about programming this control. I searched through internet but I could not find any downloadable operator's/programming manual.(Heidenhain, Fanuc and Sinumeric manuals are all easy to find and free to download). Does any one know where could I find an operator's/programming manual for this control? Thanks.
  4. Try thi one: http://filebase.heidenhain.de/doku/tnc_gui...0-xx/en/bhb.pdf
  5. Hello, I believe there is a way (and not only one). Here is how I would do it: - create a txt file (like customers.txt). this file will contain your customers (every line - one customer). - use functions like code: OpenAsTextStream to read this file. Here is some small example: of reading a text file line by line: code: strfile = c:customer.txt 'path to your txt file Set FSO2 = CreateObject("Scripting.FileSystemObject") Set TS = FSO2.GetFile(strFile) Set fsoTextFile = TS.OpenAsTextStream(1, -2) While fsoTextFile.AtEndOfLine <> True customer = fsoTextFile.ReadLine Wend - there is of course some more things to do: every time the while loop reads a line the script should count the number of the line (like: customer # = line #), if the input number of the customer is some other text (for instance: new customer name) the script shoud not go into the read file loop. Instead it should write a new line into the file at the and of this file (look at the help file for the writing mathod). - of course you can use similar methods to read the whole file and determine the number of customers, their names,... This information can help you improve user interface. I believe there are some more experineced VBS gurus on this forum like BULLINESS, etc., who can help much more than I can (I believe they would do it some other, more efficient way). I hope you will find this information useful. Pkrzic
  6. Bullines, I run MCAM X SP1 and MCAM X MR1 PC1. It does not work in both of them. Maybe it is a problem that this code is just a part of a script (it does some other things than just deleting entities). I can email you my whole *.vbs file.
  7. Bullines, I tried your method, but was not successful. I've ran out of ideas. Do you have any more ideas on how to fully erase all elements from a certain level (without using functions such as RAM SAVER or SCREEN REGENERATE)? Thanks.
  8. Tried this, but unsuccesfully. I also tried a Call RunMastercamCommand("OnScreenRegenerate"), but the function opens a YES/NO message. User must then click the YES button in order to continue the run of the script. This is not OK for me - I want to run it automaticly. All I want is to delete all elements from certain level (for instance level 10501)! Thanks for help.
  9. Hello, I have a problem with deleting entities using VBS function DeleteEntity(). The problem is that after deleting elements they still remain on the screen. To put it a little different: the elements are deleted from the database (I can not select them with a cursor...), but their image still remains on the screen. The use of screen repaint doesn't help. The only thing that erases these "phantom" elements from the screen is the RAM SAVER. I don't like this method because it takes too much time on the bigger models. Is there any better way to totally delete entities from the screen. Here is a sample of my code: code: Sub Brisanje() Dim bRet, level Dim intelementCount Dim objShell Set objShell = CreateObject("WScript.Shell") UnselectAll() bRet = StartDBSearch(mc_alive, mc_linetype) If bRet Then Do While bRet level = GetEntityLevel() bRet = GetEntityEptr() if level = 10501 then DeleteEntity(bRet) end if bRet = NextDBSearch Loop Else ShowString("There is no elements on the screen!") End If ' Call RunMastercamCommand("RAMSaver") ' objShell.SendKeys "{ENTER}" ' objShell.SendKeys "{ENTER}" End Sub
  10. If I put the cursor to the graphic window during Script run it works OK, if I put the cursor on the Operation manager Mastercam crashes. Do you know of any function I could use to move cursor in the certain point on the screen?
  11. No it does not. I have tried many different combinations of this function with no succes. Only moving the mouse works so far. Thanks for the quick reply.
  12. OK, now I have another problem. I wrote a script that creates 3 images of the model on the screen. On the rough it works like this: - change background color to White - set Gview to ISO - refresh the screen - call function "To clipboard" - call Irfan executable to process the image from clipboard and save it as .PNG image - change Gview to TOP - do it all over again - Change Gview to side - do it all over again Why did I take function "To clipboard"? Because I could not get good results with "Metafile" (not shaded) and "BMP" (only 256x256 pixels). Is there any better solution to create an image of the screen? And I have another problem: When the script is changing view (for instance from ISO to TOP) the screen doesn't get refreshed . As you can see from the script I use "Call RepaintScreen(True)" function. The refreshment is done only if I move the mouse cursor during the running of the script. You can imagine that every tume I run the script I move a mouse like mad all over the table. I also noticed that this problem occurs with bigger models (>500 sufs) - with smaller models it works OK. Have you seen and/or solved any problem like this? Here is the code: code: Public Function CreateImage(strGetpath1, FolderIrfan, strimage, strimage1, strimage2) Dim strPathToConv Dim strCnvtImage Dim objFSO ' FSO object Dim objWSHShell ' WSH Shell object Dim objShell Dim krneki Dim iSeconds iSeconds = 15 Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") strPathToConv = FolderIrfan & "i_view32.exe " ' objShell.SendKeys "{F9}" 'Call RunMastercamCommand("OnHideToolpath") Call SetBackGroundColor(mcCOLOR_WHITE) SetGViewNumber(mcVIEW_ISO) ' Isometric view Call RepaintScreen(True) ' Repaint screen Call RunMastercamCommand("OnScreenFit") Call Nap(iSeconds) ' Slow down processing a bit - it works better ' I use a method of pinging?! Call RepaintScreen(True) ' Another repaint ClearMenuAndPrompts Call RunMastercamCommand("ToClipboard") ' Save screen to clipboard objShell.SendKeys "{ESC}" ' Hit the Escape button Call Nap(iSeconds) strCnvtImage = strPathToConv + " /clippaste /resample=(1000,800) /convert=" + strimage + ".png" Set objWSHShell = CreateObject("WScript.Shell") objWSHShell.Run strCnvtImage, 0, True ' runing Irfan executable for converting the image ' Call ShellAndWait (strCnvtImage, False) ' runing Irfan executable SetGViewNumber(mcVIEW_TOP) ' Top View... RepaintScreen(True) Call RunMastercamCommand("OnScreenFit") RepaintScreen(True) ClearMenuAndPrompts Call Nap(iSeconds) Call RepaintScreen(True) Call RunMastercamCommand("ToClipboard") objShell.SendKeys "{ESC}" Call Nap(iSeconds) strCnvtImage = strPathToConv + " /clippaste /resample=(1000,800) /convert=" + strimage1 + ".png" Set objWSHShell = CreateObject("WScript.Shell") objWSHShell.Run strCnvtImage, 0, True ' Call ShellAndWait (strCnvtImage, False)' runing Irfan executable SetGViewNumber(mcVIEW_FRONT) Call RepaintScreen(True) Call RunMastercamCommand("OnScreenFit") Call Nap(iSeconds) Call RepaintScreen(True) ClearMenuAndPrompts Call RunMastercamCommand("ToClipboard") objShell.SendKeys "{ESC}" Call Nap(iSeconds) strCnvtImage = strPathToConv + " /clippaste /resample=(1000,800) /convert=" + strimage2 + ".png" Set objWSHShell = CreateObject("WScript.Shell") objWSHShell.Run strCnvtImage, 0, True 'Call ShellAndWait (strCnvtImage, False)' runing Irfan executable Call SetBackGroundColor(mcCOLOR_BLACK) SetGViewNumber(mcVIEW_ISO) Call RepaintScreen(True) Set objShell = Nothing Set objFSO = Nothing Set objWSHShell = Nothing End Function '/////////////////////// '// FUNCTION '/////////////////////// function Nap(iSeconds) Const DEF_LOCALHOST_IP = "www.microsoft.com" Dim objShell, pingstring ' Create a Shell object Set objShell = CreateObject("Wscript.Shell") pingstring = "ping -n 1 -w " & iSeconds & " " & DEF_LOCALHOST_IP objShell.Run pingstring, 0, True Set objShell = Nothing End function
  13. Sorry! In my previus post the image of the error message didnt upload correctly. Here it is:
  14. have some problems with Script linker. I haven't been able to produce any good results. Every time I try get this error. thanks!
  15. I found out what is the problem: the script is running too fast, so the functions like screen capture do not have time to execute. If I put some ShowMessaqe functions it works OK. My code is like this: Call Main() Sub Main() Dim strPathToConv Dim strCnvtImage Dim objWSHShell ' WSH Shell object Dim objShell strPathToConv = "C:mcamxmillPostsi_view32.exe" ' path to IrfanView executable Set objShell = CreateObject("WScript.Shell") SetGViewNumber(mcVIEW_TOP) Call RepaintScreen(True) Call SetBackGroundColor(mcCOLOR_WHITE) Call RepaintScreen(True) Call RunMastercamCommand("ToClipboard") objShell.SendKeys "{ESC}" Showstring ("waiting") ' !!!! added to wait some time strCnvtImage = strPathToConv + " /clippaste /resample=(500,375) /convert=c:picture1.png" ' set command line for pasting into Irfan, resampling and saving as picture1.png Set objWSHShell = CreateObject("WScript.Shell") Call ShellAndWait (strCnvtImage, False)' runing Irfan executable Call SetBackGroundColor(mcCOLOR_BLACK) Call RepaintScreen(True) Set objWSHShell = Nothing End sub So, is there any way to pause the runtime of the script for some time (Instead of the current Showstring ("waiting") solution). I tried the Shell.Sleep method, but It does not work. Anyhow I will look at the JSDraw also. Thanks.
  16. Thanks for help! the solutions were most helpful. Now I have a bit more tricky question. I can not find a way to create a picture (it must be colored and shaded - doMetafile can not produce something like this, the DoBitmapfile makes a picture with bad quality) I am trying with first changing background color, than calling the RunMastercamCommand("ToClipboard") at the and I paste the picture from the clipboard to IrfanView executable and save it from there. The results are not good. Is there any better solution to produce quality screen captions (white background and shaded). Here is my current code: Call Main() Sub Main() Dim strPathToConv Dim strCnvtImage Dim objWSHShell ' WSH Shell object Dim objShell strPathToConv = "C:mcamxmillPostsi_view32.exe" ' path to IrfanView executable Set objShell = CreateObject("WScript.Shell") SetGViewNumber(mcVIEW_TOP) Call RepaintScreen(True) Call SetBackGroundColor(mcCOLOR_WHITE) Call RepaintScreen(True) Call RunMastercamCommand("ToClipboard") objShell.SendKeys "{ESC}" strCnvtImage = strPathToConv + " /clippaste /resample=(500,375) /convert=c:picture1.png" ' set command line for pasting into Irfan, resampling and saving as picture1.png Set objWSHShell = CreateObject("WScript.Shell") Call ShellAndWait (strCnvtImage, False)' runing Irfan executable Call SetBackGroundColor(mcCOLOR_BLACK) Call RepaintScreen(True) Set objWSHShell = Nothing End sub
  17. I have several problems with VB scripts in MastercamX: - I use function RunMastercamCommand(). It looks like this function is not working in X - I can not find a way to delete elements on a certain level (like delete, all level function in MCAM), I also can not find a way to delete elements with certain color (like delete, all, color, red). Thanks for answers.
  18. I have a question. Is there any way to encrypt a VBS script that I use to automate some MCAM functions? In post processors there is MPBIN.DLL. Is there anything similar in Mastercam's VBS? Thanks for the answers.
  19. Thank you both for really useful tips! The DoMetaFile() is unuseful on my computer at job and also at home because WMF files still have black background. I decided to go with DoBitmapfile() even though it only supports 256x256bit files.
  20. To bullines: I tried ImageMagick, but if the input is not good, the output can't be great - bitmap picture which function DoBitmapfile() creates is much too small (only 256x256 pixels) for any advanced use. Is there any way to cofigure that this function would output a bigger bitmap picture (for instance: 900x900 pixels). By the way: the DoMetaFile() still doesn't work as it should. I looked at the InHouse HTML setup sheet and I found out that it uses the same technique to generate a part preview (it uses DoMetaFile() function in VBS file). I assume that some users of this product have the same problems with part preview in their HTML setup sheets as I do. Thanks for answers.
  21. To Dave: I tried your second solution (turning down the graphics acceleration) and it worked. But the problem is that it works only if I put the slider in the second position and restart my computer. After that If I change the slider position to anything else and then put it back to second position, it doesn't work anymore. To Bullines: DoBitmapfile()is OK but the image size is MUCH too small (the resolution is not high enough). If there was a way to increase the resolution of the BMP image the DoBitmapfile() would be good enough for me. The way it is - it is not good enough. To both: Why do I need this function? I need it to make HTML setup sheet (similar to InHouse HTML), but the customers demands are much higher than what InHouse HTML setup sheet has to offer. It would be great if customer wouldn't have do decrease graphic acceleration in order to make DoMetaFile() work. Anyway, thanks for answer that helped a little. I,m still searching for totally good solution.

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