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:

Does anyone know this VB Command


Recommended Posts

Screen/Next Meun/Clip Board

 

I am trying to make a quick and nasty screen capture to insert pictures into my set-up sheet. I know there are program out there I can open and do this but I what I am trying to accomplish is all in one press of the key. I hit F11 then my screen turns white. I hit F12 my screen turn back to Black. I want to hit F11 and have it turn my screen white run the clipboard then turn the screen back black.

 

Here is the simple script:

code:

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

'//

'// Author: Crazy^Millman

'// Date: 12/10/2004

'// File Name: CAPTURE SCREEN.vbs

'//

'// Description: Turn the Background White, Use Clipboard,

'// Then turn Background Back to Black

'//

'// Comments: Beta Testing Right Now

'//

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

 

' -- Start Script

Call Main()

 

 

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

' Sub Declaration

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

Sub Main()

 

 

' -- Invoke color selector and preselect light blue

SetBackGroundColor(mcCOLOR_WHITE)

 

' -- Force a repaint otherwise we wont see the change, handy for exporting images!

Call RepaintScreen(True)

 

' RunMastercamCommand(mcWINDOW_INSIDE)

 

'SetBackGroundColor(mcCOLOR_BLACK)

 

'Call RepaintScreen(True)

 

 

 

 

 

 

 

 

End Sub

Any help or Ideas would be appericated.

Link to comment
Share on other sites

BTW, here's a list of the commands you can call from mastercam in case you don't have it already.

 

code:

            ''9001. "zoom:     Screen-Zoom"                   

''9002. "unzoom: Screen-Unzoom"

''9003. "repaint: Screen-Repaint"

''9004. "analyze: Analyze"

''9005. "delete: Delete"

''9006. "file: File"

''9007. "modify: Modify"

''9008. "create: Create"

''9009. "dispinfo: Screen-Display info"

''9010. "help: Help"

''9011. "fit: Screen-Fit"

''9012. "unzoom8: Screen-Unzoom by 0.8"

''9013. "curpos: Cursor Tracking (Toggle)"

''9014. "delwndw: Delete-Window"

''9015. "editfile: File-Edit"

''9016. "blank: Screen-Blank"

''9017. "config: Screen-Configure"

''9018. "drwaxes: Screen-Draw axes"

''9019. "rundll: Execute C-Hook"

''9020. "draftpm: Draft-Globals"

''9021. "font: Menu Font"

''9022. ""

''9023. "mmalloc: List Memory"

''9024. "mfile: List Files"

''9025. "undo: Undo"

''9026. "surfdisp: Screen-Surf Disp"

''9027. "drawnc: Screen-Draw Toolpath"

''9028. "vwports: Screen-Viewports"

''9029. "version: Version"

''9030. "xform: Xform"

''9031. "autosave: File-AutoSave"

''9032. "group: Groups"

''9033. "chgcolrs: Screen-Change Colors"

''9034. "chglevs: Screen-Change Levels"

''9035. "autocl: Automatic Centerlines"

''9036. "color: Main Color"

''9037. "level: Levels-Main"

''9038. "mask: Levels-Mask"

''9039. "tplane: Tplane"

''9040. "cplane: Cplane"

''9041. "gview: Gview"

''9042. "zdepth: Cplane-Depth"

''9043. "levdlg: Levels-Dialog"

''9044. "vislev: Levels-Visible"

''9045. "toolbar: Toolbar Visible (Toggle)"

''9046. "dbstats: Screen-Statistics"

''9047. "endpts: Screen-Endpoints"

''9048. "clrcolrs: Screen-Clear Colors"

''9049. "shade: Screen-Surf Disp-Shading"

''9050. "crpoint: Create-Point"

''9051. "crptpos: Create-Point-Position"

''9052. "ptalong: Create-Point-Along Entity"

''9053. "nodepts: Create-Point-Node Points"

''9054. "ctrlpts: Create-Point-Cpts NURBS"

''9055. "ptdynmic: Create-Point-Dynamic"

''9056. "crptlen: Create-Point-Length"

''9057. "ptsrfprj: Create-Point-Surface Project"

''9058. "crline: Create-Line"

''9059. "clhorz: Create-Line-Horizontal"

''9060. "clvert: Create-Line-Vertical"

''9061. "clepts: Create-Line-Endpoints"

''9062. "clmulti: Create-Line-Multi"

''9063. "clpolar: Create-Line-Polar"

''9064. "cltan: Create-Line-Tangent"

''9065. "cltanang: Create-Line-Tangent-Angle"

''9066. "cltan2a: Create-Line-Tangent-2 Arcs"

''9067. "cltanpt: Create-Line-Tangent-Point"

''9068. "clperp: Create-Line-Perpendicular"

''9069. "clparal: Create-Line-Parallel"

''9070. "crarc: Create-Arc"

''9071. "capolar: Create-Arc-Polar"

''9072. "cactrpt: Create-Arc-Polar-Center Point"

''9073. "casktch: Create-Arc-Polar-Sketch"

''9074. "castart: Create-Arc-Polar-Start Point"

''9075. "caend: Create-Arc-Polar-End Point"

''9076. "caepts: Create-Arc-Endpoints"

''9077. "ca3pts: Create-Arc-3 points"

''9078. "catan: Create-Arc-Tangent"

''9079. "catan1: Create-Arc-Tangent-1 Entity"

''9080. "catan3: Create-Arc-Tangent-3 Entities"

''9081. "catanpt: Create-Arc-Tangent-Point"

''9082. "ca2ptcir: Create-Circle-2 Points"

''9083. "ca3ptcir: Create-Circle-3 Points"

''9084. "captrad: Create-Circle-Point/Radius"

''9085. "captdia: Create-Circle-Point/Diameter"

''9086. "captedge: Create-Circle-Point/Edge"

''9087. "crfillet: Create-Fillet"

''9088. "crspline: Create-Spline"

''9089. "crcurve: Create-Curve"

''9090. "ellipse: Create-Ellipse"

''9091. "ccconst: Create-Curve-Const Parameter"

''9092. "ccedge: Create-Curve-One Edge"

''9093. "ccinter: Create-Curve-Intersect"

''9094. "ccpatch: Create-Curve-Patch Boundaries"

''9095. "ccflow: Create-Curve-Flowline"

''9096. "ccproj: Create-Curve-Project"

''9097. "ccdynmic: Create-Curve-Dynamic"

''9098. "ccpart: Create-Curve-Parting Line"

''9099. "crsurf: Create-Surface"

''9100. "csloft: Create-Surface-Loft"

''9101. "cscoons: Create-Surface-Coons"

''9102. "csruled: Create-Surface-Ruled"

''9103. "csrev: Create-Surface-Revolved"

''9104. "csswept: Create-Surface-Swept"

''9105. "csdraft: Create-Surface-Draft"

''9106. "csfillet: Create-Surface-Fillet"

''9107. "csofst: Create-Surface-Offset"

''9108. "cstrim: Create-Surface-Trim"

''9109. "csblend: Create-Surface-2 Surface Blend"

''9110. "crrec: Create-Rectangle"

''9111. "rec1pt: Create-Rectangle-1 Point"

''9112. "rec2pts: Create-Rectangle-2 Points"

''9113. "crdraft: Create-Drafting"

''9114. "cddim: Create-Drafting-Dimension"

''9115. "crnote: Create-Drafting-Note"

''9116. "crlabel: Create-Drafting-Label"

''9117. "crleader: Create-Drafting-Leader"

''9118. "crwit: Create-Drafting-Witness Line"

''9119. "eddraft: Create-Drafting-Multi edit"

''9120. "crhatch: Create-Drafting-Hatch"

''9121. "chamfer: Create-Chamfer"

''9122. "crlets: Create-Letters"

''9123. "pattern: Create-Pattern"

''9124. "anzpt: Analyze-Point"

''9125. "anzonly: Analyze-Only"

''9126. "anzbpts: Analyze-Between points"

''9127. "anzang: Analyze-Angle"

''9128. "anzdynm: Analyze-Dynamic"

''9129. "anzarea: Analyze-Area Calculations"

''9130. "eamod: Entity Attributes (Apply)"

''9131. "anzscurv: Analyze-Surfaces-Curvature"

''9132. "anznorm: Analyze-Surfaces-Test Normals"

''9133. "anzbase: Analyze-Surfaces-Base Surfs"

''9134. "delchain: Delete-Chain"

''9135. "deldup: Delete-Duplicate"

''9136. "delonly: Delete-Only"

''9137. "delall: Delete-All"

''9138. "delgrp: Delete-Group"

''9139. "delreslt: Delete-Result"

''9140. "crptperp: Create-Point-Perpendicular"

''9141. "crptcirc: Create-Point-Small Circles

''9142. "undelete: Delete-Undelete"

''9143. " "

''9144. "filemrg: File-Merge"

''9145. "filesave: File-Save"

''9146. "fileget: File-Get"

''9147. "hardcopy: File-Hardcopy"

''9148. "browse: File-Browse"

''9149. "communic: File-Communications"

''9150. "convert: File-Convert"

''9151. "ascii: File-Convert-ASCII"

''9152. "cadl: File-Convert-CADL"

''9153. "dxf: File-Convert-DXF (pre-V9)"

''9154. "iges: File-Convert-IGES"

''9155. "vda: File-Convert-VDA"

''9156. " "

''9157. "renumber: File-Renumber"

''9158. " "

''9159. "shell: File-DOS Shell"

''9160. "levelrep: Levels-Report"

''9161. "trim: Modify-Trim"

''9162. "trim1: Modify-Trim-1 Entity"

''9163. "trim2: Modify-Trim-2 Entities"

''9164. "trim3: Modify-Trim-3 Entities"

''9165. "trim2pt: Modify-Trim-To Point"

''9166. "trimmany: Modify-Trim-Many"

''9167. "closearc: Modify-Trim-Close Arc"

''9168. "divide: Modify-Trim-Divide"

''9169. "break: Modify-Break"

''9170. "brkarcs: Modify-Break-Arcs"

''9171. "brkmany: Modify-Break-Many Pieces"

''9172. "brk2pcs: Modify-Break-2 Pieces"

''9173. "brklen: Modify-Break-At Length"

''9174. "brknote: Modify-Break-Draft/Line"

''9175. "brkhatch: Modify-Break-Hatch/Line"

''9176. "brkcdata: Modify-Break-Cdata/Line"

''9177. "join: Modify-Join"

''9178. "modnorm: Modify-Normal"

''9179. "modnbs: Modify-Cpts NBS"

''9180. "x2nbs: Modify-X to NBS"

''9181. "extend: Modify-Extend"

''9182. "drag: Modify-Drag"

''9183. "scrnctr: Screen-Center"

''9184. "initscrn: File-New"

''9185. "combvws: Screen-Combine Views"

''9186. "plot: Screen-Plot"

''9187. "xfmmir: Xform-Mirror"

''9188. "xfmrot: Xform-Rotate"

''9189. "xfmscale: Xform-Scale"

''9190. "xfmsqsh: Xform-Squash"

''9191. "xfmtrans: Xform-Translate"

''9192. "xfmofst: Xform-Offset"

''9193. "xfmoctr: Xform-Offset Contour"

''9194. "tpmenu: Toolpaths"

''9195. "contour: Toolpaths-Contour"

''9196. "drill: Toolpaths-Drill"

''9197. "pocket: Toolpaths-Pocket"

''9198. "ncflow: Toolpaths-Flowline"

''9199. "ncmsurf: Toolpaths-Surface"

''9200. "ncproj: Toolpaths-Project"

''9201. "nctrim: Toolpaths-Trim"

''9203. "nccoons: Toolpaths-Coons"

''9204. "ncruled: Toolpaths-Ruled"

''9205. "ncswept: Toolpaths-Swept"

''9206. "ncrev: Toolpaths-Revolution"

''9208. "manent: Toolpaths-Manual Entry"

''9209. "ncpoint: Toolpaths-Point"

''9215. "filter: NC Utils-Filter"

''9216. "pstmenu: NC Utils-Post"

''9217. "pstchg: NC Utils-Post-Change"

''9218. "pstrun: NC Utils-Post-Run"

''9219. "pstrev: NC Utils-Post-Reverse"

''9220. "deftls: NC Utils-Define Tools"

''9221. "setsht: NC Utils-Setup Sheet"

''9223. "exefunc: Execute Function"

''9224. "prompt: Prompt Visible (Toggle)"

''9225. "gvtop: Gview-Top"

''9226. "gvfront: Gview-Front"

''9227. "gvside: Gview-Side"

''9228. "gviso: Gview-Isometric"

''9229. "gvnum: Gview-Number"

''9230. "gvlast: Gview-Last"

''9231. "gvent: Gview-Entity"

''9232. "gvrot: Gview-Rotate"

''9233. "gvmouse: Gview-Mouse"

''9234. "gvdymic: Gview-Dynamic"

''9235. "cporgn: Cplane-Origin"

''9236. "cp3d: Cplane-3D"

''9237. "cptop: Cplane-Top"

''9238. "cpfrnt: Cplane-Front"

''9239. "cpside: Cplane-Side"

''9240. "cpnum: Cplane-Number"

''9241. "cplast: Cplane-Last"

''9242. "cpent: Cplane-Entity"

''9243. "cprot: Cplane-Rotate"

''9244. "cpnorm: Cplane-Normal"

''9245. "cpmouse: Cplane-Mouse"

''9246. "cppxz: Cplane-XZ(+)"

''9247. "cpnxz: Cplane-XZ(-)"

''9248. "cppdz: Cplane-DZ(+)"

''9249. "cpndz: Cplane-DZ(-)"

''9250. "eamgr: Entity Attributes Manager"

''9251. "extsrf: Modify-Surface-Extend"

''9252. "clipbrd: Screen-To Clipboard"

''9253. "regen: Screen-Regenerate"

''9254. "slccrvs: Create-Point-Slice"

''9255. "slcsrfs: Create-Curve-Slice"

''9256. "catan2: Create-Arc-Tangent-2 Entities"

''9257. "circmill: Toolpaths-Circle Mill"

''9258. "sprlhlx: Create-Spiral/Helix

''9259. "crptgrid: Create-Point-Grid"

''9260. "crptbcir: Create-Point-Bolt Circle"

''9261. "fillet: Create-Fillet-2 Entities"

''9262. "filletc: Create-Fillet-Chain"

''9263. "mcplay: Macro-Playback (Toggle)"

''9264. "mcrec: Macro-Record (Toggle)"

''9265. "mcstop: Macro-Pause (Toggle)"

''9266. "anzsnrms: Analyze-Surfaces-Set Normals"

''9267. "crpolyg: Create-Polygon"

''9268. "clprppt: Create-Line-Perpendicular-Pt"

''9269. "clprpar: Create-Line-Perpendicular-Arc"

''9270. "clplldst: Create-Line-Parallel-Dist/Side"

''9271. "clpllpt: Create-Line-Parallel-Point"

''9272. "clpllar: Create-Line-Parallel-Arc"

''9273. "clbisect: Create-Line-Bisect"

''9274. "catancl: Create-Arc-Tangent-Center Line"

''9275. "undelent: Delete-Undelete-Single"

''9276. "hide: Hide"

''9277. "gridprms: Screen-Grid"

''9278. "catadyn: Create-Arc-Tangent-Dynamic"

''9279. "ramsaver: File-RAMsaver"

''9280. "chgattrs: Screen-Change Attributes"

''9281. "jobsetup: Toolpaths-Job Setup"

''9282. "oplist: Toolpaths-Operations Manager"

''9283. "namview: WCS / View Manager"

''9284. "cnv2arcs: Modify-Convert to Arcs"

''9285. "ccedges: Create-Curve-All Edges"

''9286. "studio: Screen-Surf Disp-Studio"

''9287. "clclose: Create-Line-Closest"

''9288. "autocur: AutoCursor (Toggle)"

''9289. "shadetog: Fulltime Shading (Toggle)"

''9290. "quitop: Delete-Last Operation"

''9291. "editlast: Modify-Last Operation"

''9292. "grnamed: Gview-Named"

''9293. "cpnamed: Cplane-Named"

''9294. "tpnamed: Tplane-Named"

''9295. "multiax: Toolpaths-MultiAxis"

''9296. "curve5ax: Toolpaths-Curve 5 Axis"

''9297. "drill5ax: Toolpaths-Drill 5 Axis"

''9298. "swarf5ax: Toolpaths-Swarf 5 Axis Floor"

''9299. "flow5ax: Toolpaths-Flow 5 Axis"

''9300. "rotary4x: Toolpaths-Rotary 4 Axis"

''9301. "grnormal: Gview-Normal"

''9302. "greqcpln: Gview-Equals Cplane"

''9303. "greqtpln: Gview-Equals Tplane"

''9304. "autodesk: File-Convert-AutoDesk"

''9306. "dfregen: Draft-Regenerate-All"

''9307. "dfrgsel: Draft-Regenerate-Selected"

''9308. "dfrgaut: Draft-Regenerate-Auto (Toggle)"

''9309. "crdmhz: Create-Dimension-Horizontal"

''9310. "crdmvt: Create-Dimension-Vertical"

''9311. "crdmpll: Create-Dimension-Parallel"

''9312. "crdman: Create-Dimension-Angular"

''9313. "crdmdia: Create-Dimension-Circular"

''9315. "crdmbsln: Create-Dimension-Baseline"

''9316. "crdmchn: Create-Dimension-Chained"

''9317. "crdmord: Create-Dimension-Ordinate"

''9318. "crdmpt: Create-Dimension-Point"

''9319. "dfvdate: Draft-Regenerate-Validate"

''9320. "sldhist: Create-Solids-History"

''9321. "sldmake: Create-Solids"

''9322. "hidemore: Hide-Hide More"

''9323. "unhdsome: Hide-Unhide Some"

''9324. "makebbox: Create-Bounding Box"

''9325. "setmain: Levels-Main (from entity)"

''9326. "gvbottom: Gview-Bottom"

''9327. "gvback: Gview-Back"

''9328. "gvleft: Gview-Left"

''9350. "gvdypan: Gview-Dynamic Pan"

''9351. "gvdyzum: Gview-Dynamic Zoom"

''9352. "attribs: Attributes"

''9353. "anznumbr: Analyze-Number"

''9354. "anzchain: Analyze-Chain"

''9355. "anzckmdl: Analyze-Surfaces-Check Model"

''9356. "anzsmall: Analyze-Surfaces-Small Surfs"

''9357. "anzcksld: Analyze-Surfaces-Check Solid"

''9358. "xfmstrch: Xform-Stretch"

''9359. "xfmroll: Xform-Roll"

''9360. "sldext: Solids-Extrude"

''9361. "sldrev: Solids-Revolve"

''9362. "sldsweep: Solids-Sweep"

''9363. "sldloft: Solids-Loft"

''9364. "sldflt: Solids-Fillet"

''9365. "sldchmfr: Solids-Chamfer"

''9366. "sldshell: Solids-Shell"

''9367. "sldbool: Solids-Boolean"

''9368. "sldprim: Solids-Primitive"

''9369. "slddrfac: Solids-Draft face"

''9370. "sldtrim: Solids-Trim"

''9371. "sldlayot: Solids-Layout"

''9372. "sldfeat: Solids-Find features"

''9373. "sldthick: Solids-Thicken"

''9374. "sldrmfac: Solids-Remove faces"

Just use: "Call RunMastercamCommand(unzoom)".

 

HTH

Link to comment
Share on other sites

Well Matt says that is undefined

 

Here is the script now:

code:

' -- Start Script

Call Main()

 

 

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

' Sub Declaration

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

Sub Main()

 

 

' -- Invoke color selector and preselect light blue

Call SetBackGroundColor(mcCOLOR_WHITE)

 

' -- Force a repaint otherwise we wont see the change, handy for exporting images!

Call RepaintScreen(True)

 

Call RunMastercamCommand(clipbrd)

 

Call SetBackGroundColor(mcCOLOR_BLACK)

 

Call RepaintScreen(True)

 

End Sub

This is taken from one of Mick scripts but I can not get things to work right.

 

BTW Thanks for Help!~!~!~!~!~!~!~!~!~!

Link to comment
Share on other sites

Meh bad, try this:

 

code:

Const CLIP_BOARD = "clipbrd"

' -- Start Script

Call Main()

 

 

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

' Sub Declaration

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

Sub Main()

 

 

' -- Invoke color selector and preselect light blue

Call SetBackGroundColor(mcCOLOR_WHITE)

 

' -- Force a repaint otherwise we wont see the change, handy for exporting images!

Call RepaintScreen(True)

 

Call RunMastercamCommand(CLIP_BOARD)

 

Call SetBackGroundColor(mcCOLOR_BLACK)

 

Call RepaintScreen(True)

 

End Sub

You have to declare it first.

Link to comment
Share on other sites

No problem, Ron. Any time.

 

Yes, I believe you would have to declare any of the commands you're going to use like that.

 

Kyle, you can run scripts from posts/sets and posts/sets from scripts. I haven't done the former, but I think there's a few examples here somewhere by Mick and/or some others. Ron's prolly got them in his book. wink.gif

Link to comment
Share on other sites

Ok there are some of these that are defined but looks like we will have to delcare all that are not but not that big of a deal.

 

I am not using a set type sheet mine is a Excel sheet that we have here and if I can get things worked out I am hoping to have a VB to go along with that one soon. I think the biggest obticale right now is NCI sepration for the tools think once that is under control the peron doing this will have a kick but script which will not hurt my feelings any. I think I am going to add some level control to the script above so if the level you are on is not the one you want you can just answer a yes/no and if it is ye then it gives you the winod if it is no then the level manger will come up and allow you to change levels like that. I maight even add a view control to this going back to the scipt that you Helped me with Matt that see all of the views and then you can pick them by number.

 

I again appericate the help Matt and you should stop by the shop sometime.

 

Ron

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