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:

Capture a screen image


TK@PSG
 Share

Recommended Posts

I did a search for info on screen shots. Most people seem to use alt+printscreen and then patch it into some other software to save the image.

 

I would like to set up a key to do the screenshot exactly like Gunther does in his ncdatasheet.dll

 

Anybody able to help me?

Link to comment
Share on other sites

Try using this script:

 

code:

'///////////////////////////////////////////////////////////////////////////////

'//

'// Author: Chris Bellini [email protected]

'// Date: 08/19/2004 9:36 AM

'// File Name: SaveAsBMP_EMF.vbs

'//

'// Description: create a BMP and EMF from the current MC9

'//

'// Comments:

'//

'//

'//

'///////////////////////////////////////////////////////////////////////////////

 

'///////////////// CONSTANTS /////////////////

Const DEF_MC9_EXT = ".MC9"

Const DEF_BMP_EXT = ".BMP"

Const DEF_EMF_EXT = ".EMF"

 

 

' call the main subroutine

Call Main()

 

 

' Purpose: the main subroutine

Sub Main()

Dim strCurrMC9FullPath ' full path to current MC9 file

Dim strCurrPath ' path of the current open MC9 file

Dim strBname ' base file name

Dim strMC9 ' full path for saved MC9 file

Dim strBMP ' full path for saved BMP file

Dim strEMF ' full path for saved EMF file

Dim objFSO ' FileSystem object

 

 

' make sure the current MC9 actually has entity data

If (IsDrawing() = False) Then

ShowString "No MC9 file open. Exiting."

Exit Sub

End If

 

' get the full path of the currently open MC9

strCurrMC9FullPath = GetCurrentFileName()

 

' create an FSO object

Set objFSO = CreateObject("Scripting.FileSystemObject")

 

' get the current path

strCurrPath = objFSO.GetParentFolderName(strCurrMC9FullPath)

 

' get the base

strBName = objFSO.GetBaseName(strCurrMC9FullPath)

 

' save as BMP

strBMP = strCurrPath & "" & strBName & DEF_BMP_EXT

If (DoBitmapfile(strCurrMC9FullPath, strBMP) = False) Then

ShowString "Couldn't save as bitmap!"

End If

 

' save as EMF

strEMF = strCurrPath & "" & strBName & DEF_EMF_EXT

If (DoMetafile(strEMF) = False) Then

ShowString "Couldn't save as meta file!"

End If

 

' repaint the graphics window

RepaintScreen(False)

 

' cleanup

Set objFSO = Nothing

End Sub

 

 

' Purpose: Determine if something with geo is open in MC.

' I: (none)

' O: True=has geo, False=empty file

Function IsDrawing()

Dim bRet ' return value

 

 

' try to find an alive entity

bRet = StartDBSearch(mc_alive, -1)

 

' return

IsDrawing = bRet

End Function

It'll save both a BMP and EMF of the file you have open. The files will have the same name and be saved into the same directory as the MC9 file that you have open. Modify to suit your tastes.

 

HTH

Link to comment
Share on other sites

All I do is organise what I want a shot of, ie. zoom in or not, and press PRINT SCREEN, no alt or anything.

 

Then open up your fav paint program, then press ALT-V for paste

 

Voila, there is your screen shot.

 

HTH

Link to comment
Share on other sites

Did you accidentaly hit a key when pasting?

 

Perhaps try replacing this:

 

code:

    ' make sure the current MC9 actually has entity data

If (IsDrawing() = False) Then

ShowString "No MC9 file open. Exiting."

Exit Sub

End If

with this:

 

code:

    ' make sure the current MC9 actually has entity data

If Not (IsDrawing) Then

ShowString "No MC9 file open. Exiting."

Exit Sub

End If

Are you running the script from Create | Next Menu | Add-ins | McamVB?

Link to comment
Share on other sites

Which version of Mastercam are you running and what's the date on your mcamvb.dll?

 

quote:

Now an error on line 32 Type mismatch: 'showString'


Something's off since line 32 on mine is:

 

code:

    Dim strEMF              ' full path for saved EMF file

And that has nothing to do with the ShowString() sub. Maybe post the code exactly as you have it on your computer? Just so we can rule out copy 'n' paste problems.

 

Or maybe just try downloading it from here , unzip it into your VB directory and run it.

Link to comment
Share on other sites

Running version 9.1

 

code:

'///////////////////////////////////////////////////////////////////////////////'//

'// Author: Chris Bellini [email protected]

'// Date: 08/19/2004 9:36 AM'// File Name: SaveAsBMP_EMF.vbs

'//

'// Description: create a BMP and EMF from the current MC9

'//

'// Comments:

'//

'//

'//

'///////////////////////////////////////////////////////////////////////////////

'///////////////// CONSTANTS /////////////////

Const DEF_MC9_EXT = ".MC9"

Const DEF_BMP_EXT = ".BMP"

Const DEF_EMF_EXT = ".EMF"

' call the main subroutine

Call Main()

' Purpose: the main subroutine

Sub Main()

Dim strCurrMC9FullPath ' full path to current MC9 file

Dim strCurrPath ' path of the current open MC9 file

Dim strBname ' base file name

Dim strMC9 ' full path for saved MC9 file

Dim strBMP ' full path for saved BMP file

Dim strEMF ' full path for saved EMF file

Dim objFSO ' FileSystem object

 

 

' make sure the current MC9 actually has entity data

'If (IsDrawing() = False) Then

If Not (IsDrawing) Then

ShowString "No MC9 file open. Exiting."

Exit Sub

End If

 

' get the full path of the currently open MC9

strCurrMC9FullPath = GetCurrentFileName()

' create an FSO object

Set objFSO = CreateObject("Scripting.FileSystemObject")

' get the current path

strCurrPath = objFSO.GetParentFolderName(strCurrMC9FullPath)

' get the base

strBName = objFSO.GetBaseName(strCurrMC9FullPath)

 

' save as BMP

strBMP = strCurrPath & "" & strBName & DEF_BMP_EXT

If (DoBitmapfile(strCurrMC9FullPath, strBMP) = False) Then

ShowString "Couldn't save as bitmap!"

End If

 

' save as EMF

strEMF = strCurrPath & "" & strBName & DEF_EMF_EXT

If (DoMetafile(strEMF) = False) Then

ShowString "Couldn't save as meta file!"

End If

 

' repaint the graphics window

RepaintScreen(False)

 

' cleanup

Set objFSO = Nothing

End Sub

' Purpose: Determine if something with geo is open in MC.

' I: (none)

' O: True=has geo, False=empty file

 

Function IsDrawing()

Dim bRet ' return value

' try to find an alive entity

bRet = StartDBSearch(mc_alive, -1)

' return

IsDrawing = bRet

End Function

Thanks for your patience!

Link to comment
Share on other sites

I have a hot key set for print (alt-q) and I have a hotkey set for clipboard (alt-i).

 

Alt-q gets the background white and alt-i to clipboard. I just paste that onto a doc file and print from there. Or paste it onto any imaging file etc...

Link to comment
Share on other sites

One other thing, I don't like the print screen because it shows you the toolbars etc... clipboard you can window around what you want or hit esc to capture everything in the view.

 

And normally I will keep a doc open and minimized so I don't have to hunt one down.

Link to comment
Share on other sites

quote:

But where did the screenshot go?

What is it called?


If your MC9 file is called TEST.MC9 and it's located in the directory called C:MyStuff, you should see two new files after running the script; C:MyStuffTEST.EMF and C:MyStuffTEST.BMP. Those are the screenshots.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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