Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Capture Macro

Status
Not open for further replies.

rstupplebeen

Mechanical
Joined
May 9, 2007
Messages
1,281
Location
US
I am recording a macro that:
1. Sets the background to white
2. Image capture
3. Sets the background back to the original color
I am hard coding in the background color so this is not mean to be elegant at all. When I record the image capture does not make it into the macro. Does anyone know the command? I figure someone else has done this already so if you have code that already works and are willing to share that would be great. Below is my code. Thanks
Rob Stupplebeen

' ******************************************************************************
' C:\DOCUME~1\stupplrk\LOCALS~1\Temp\swx2964\Macro1.swb - macro recorded on 01/30/09 by stupplrk
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.SetUserPreferenceIntegerValue swSystemColorsViewportBackground, 16777215
swApp.SetUserPreferenceIntegerValue swSystemColorsViewportBackground, 13813955
End Sub
 
What command are you using for image capture?
 
Why not just use "Save As" with JPEG file-type to capture your image?

SWhelp said:
Retval = ModelDocExtension.SaveAs ( Name, Version, Options, ExportData, Errors, Warnings)

New name of the document' the file extension indicates any conversion that should be performed (for example, Part1.igs to save to IGES)

[bat]Honesty may be the best policy, but insanity is a better defense.[bat]
-SolidWorks API VB programming help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top