找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 18683|回复: 9
打印 上一主题 下一主题

[原创] Mastercam VB Script

[复制链接]
跳转到指定楼层
1
发表于 2007-10-8 12:39:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
MasterCAM VB 想嘘唏的在此讨论共同学习,
这是一个转换CAD文件的例子,本人正在研究中,希望能有人一起合作研究

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2007-10-8 12:52:48 | 只看该作者
3
发表于 2007-10-8 14:24:10 | 只看该作者

Mastercam VB Script 功能介绍

The following documentation describes the constants and functions which give the VB Script programmer access to Mastercam functionality. If you need to view documentation regarding the VB Script language itself, please refer to SCRIPT56.CHM in the ‘Help’ sub-directory of your Mastercam installation.



Links:

          Constants   (



          Classes        (



          Functions     (





///////////////////////////////////////////////////////////////////////////////

CONSTANTS

///////////////////////////////////////////////////////////////////////////////



Links:

          Entity types

          Entity ‘bit’ flags

          Milling tool types

          Drilling tool types

          File Access modes

          Others



////  Entity types



//Point:

mc_pointtype

//Line:

mc_linetype

// Arc:

mc_arctype

// Rectangle:

mc_recttype



////  Entity ‘bit’ flags



//Entity is ‘alive’ (not deleted)?:

mc_alive  

//Entity is part of the system group?:

mc_group

//Entity is currently selected?:

mc_selected

//Entity is part of the system result?:

mc_result

//Entity is only temporary?:

mc_temporary

//Entity is blanked?

mc_blanked



//// Milling tool types



// tool has a flat end

mctool_flat

// tool has a spherical end

mctool_ball

// tool has a “bull-nose” (non-zero corner radius)

mctool_bull



//// Drilling tool types



//  a center drill

mctool_centerdrill

// a spot drill

mctool_spotdrill

// a standard drill

mctool_drill

// a left handed tap

mctool_lhtap

// a right handed tap

mctool_rhtap

// a reaming tool

mctool_reamer

// a boring bar

mctool_boringbar

// a counterbore tool

mctool_counterbore

// a countersink tool

mctool_countersink



//// Others



// current system tolerance – two reals less than this close together are identical

mc_tol

// current chaining tolerace – chaining will jump gaps that are smaller than this

mc_chaintol

// SIM number

mc_simnumber

// is the current Mastercam session in Metric (millimeter) mode?

mc_metric

//  toolpath operation was not successfully made

mcOPERATION_INVALID

//  geometry creation was not successful

mcENTITY_INVALID



// Cutter Compensation Flags

mcCUTTER_COMP_OFF

mcCUTTER_COMP_LEFT

mcCUTTER_COMP_RIGHT



// Contour Corner Roll Flags

mcCUTTER_ROLL_NONE

mcCUTTER_ROLL_SHARP

mcCUTTER_ROLL_ALL



// Pocketing Style Flags

mcPOCKET_ZIGZAG

mcPOCKET_ONEWAY

mcPOCKET_CONSTOVERLAPSPIRAL

mcPOCKET_PARSPIRAL

mcPOCKET_PARSPIRAL_CLEANCORNERS

mcPOCKET_TRUESPIRAL



// -- MarkWindow Input

mcWINDOW_INSIDE

mcWINDOW_INSIDE_INTR

mcWINDOW_INTERSECT

mcWINDOW_OUT_INTR

mcWINDOW_OUT



// Entity Construction

mcCONSTRUCTION_COLOR_CURRENT

mcCONSTRUCTION_LEVEL_CURRENT



// message box returns

mcMSG_CANCEL

mcMSG_NO

mcMSG_YES



// chaining constants

mcCHAIN_UNCLEAR

mcCHAIN_CW

mcCHAIN_CCW

mcCHAIN_ALL_NUMBERED_LEVELS

mcCHAIN_ALL_NAMED_LEVELS



// file access modes

mcFILE_ACCESS_READ

mcFILE_ACCESS_WRITE

mcFILE_ACCESS_TEXT

mcFILE_ACCESS_BINARY



// colors

mcCOLOR_BLACK

mcCOLOR_DARKBLUE

mcCOLOR_GREEN

mcCOLOR_TEAL

mcCOLOR_DARKRED

mcCOLOR_PURPLE

mcCOLOR_BROWN

mcCOLOR_LIGHTGREY

mcCOLOR_DARKGREY

mcCOLOR_BLUE

mcCOLOR_LIGHTGREEN

mcCOLOR_LIGHTBLUE

mcCOLOR_RED

mcCOLOR_MAGENTA

mcCOLOR_YELLOW

mcCOLOR_WHITE



// clockwise/counterclockwise flags

mcCW_AND_CCW

mcCW

mcCCW







///////////////////////////////////////////////////////////////////////////////

CLASSES

///////////////////////////////////////////////////////////////////////////////



Links:

          Point

          Line

          Arc

          Rectangle

          Leads

          DepthCuts



////  Class to hold a Point's X, Y, Z co-ordinates

McPt
McPt.X = Point’s X co-ordinate

McPt.Y = Point’s Y co-ordinate

McPt.Z = Point’s Z co-ordinate



//// Class to hold a Line's endpoints X, Y, Z co-ordinates

McLn

McLn.X1 = Line’s startpoint X co-ordinate

McLn.Y1 = Line’s startpoint Y co-ordinate

McLn.Z1 = Line’s startpoint Z co-ordinate

McLn.X2 = Line’s endpoint X co-ordinate

McLn.Y2 = Line’s endpoint Y co-ordinate

McLn.Z2 = Line’s endpoint Z co-ordinate



//// Class to hold an arc's center point X,Y,Z co-ordinates, radius, and angles

McAr
McAr.X = Arc’s centerpoint X co-ordinate

McAr.Y = Arc’s centerpoint Y co-ordinate

McAr.Z = Arc’s centerpoint Z co-ordinate

McAr.R = Arc’s radius

McAr.SA = Arc’s start angle in degrees

McAr.SW = Arc’s sweep angle in degrees

McAr.View = Arc’s view number



//// Class to hold a Rectangle’s cornerpoints and Z co-ordinate

McRe

McRe.X1 = Rectangle’s startpoint X co-ordinate

McRe.Y1 = Rectangle’s startpoint Y co-ordinate

McRe.X2 = Rectangle’s endpoint X co-ordinate

McRe.Y2 = Rectangle’s endpoint Y co-ordinate

McRe.Z = Rectangle’s Z co-ordinate



////  Class to hold toolpath Lead-in and Lead-out information

McLeads

McLeads.Useline = Use a line for leading in/out

McLeads.LineLength = Length of lead in/out line

McLeads.LineTangent = Is the line Tangent or Perpendicular?

McLeads.LineRampHeight = Height of lead in/out Line (defining a ‘ramp’)

McLeads.Usearc = Use an arc for leading in/out

McLeads.ArcRadius = Radius of lead in/out arc

McLeads.ArcSweep = Angular sweep of lead in/out arc

McLeads.ArcHelixHeight = Height of lead in/out Arc (defining a helix)



//// Class to hold toolpath Depth Cut information

McDepthCuts

McDepthCuts.MaxStep = Maximum step down of roughing passes

McDepthCuts.FinalStep = Desired depth of final pass







///////////////////////////////////////////////////////////////////////////////

FUNCTIONS

///////////////////////////////////////////////////////////////////////////////



Links:



          Script Debugging utilities

          Prompt area message functions

          Simple Input functions

          Entity Prompt/Inquiries functions

          Chaining functions

          Database Search functions

          Entity Creation functions

          Excel File Read/Write functions

          Utility functions

          Toolpath Generation functions



        



//// Script debugging utilities



// pop up a window with a string and an integer value

Void ShowValue(

String,   (Input: the string to place before integer value)

Integer  (Input: the integer value to display)

)

            

// pop up a window with a string and a real (or double prec.) value

Void ShowDouble(

String,   (Input: the string to place before real value)

Real  (Input: the real value to display)

)

            

// pop up a window with a string

Void ShowString(

String   (Input: the string to display)

)





//// Prompt area message functions
4
发表于 2007-10-8 14:58:41 | 只看该作者
非常支持!
我不会程序语言,只能提供一些建议。
希望可以开发出一些实用的东西出来,比如铜公分中台大小和坐标可以自动取整数,现在兴这个。


[ 本帖最后由 cncboy 于 2007-10-8 15:03 编辑 ]
5
发表于 2007-10-8 20:11:19 | 只看该作者
我也在研究中,不过没有什么资料,你有吗。
6
发表于 2007-10-11 10:12:14 | 只看该作者
努力啊 支持啊!
7
发表于 2007-10-11 12:04:42 | 只看该作者
说明,暂时不会开发,知识学习啊, 大家一起来学这样会很快的,我一个肯半天也职能明白几句而已 啊,资料还没有找到啊,软件自带一个,可以用不过太麻烦,看不懂啊,还没有了解结构呢
8
发表于 2011-4-5 22:44:10 | 只看该作者
我顶~~~
9
发表于 2011-4-5 22:49:26 | 只看该作者
完全不懂呀....惭愧惭愧
10
发表于 2011-4-6 23:09:10 | 只看该作者
vbs虽然没vba那么好用但细心地话也可以大大提高工作效率,但我期待x系列可以用上vbA
,但到了x4 都没有 x5没用过唉、、因为vbs致命伤是不支持api接口  这也是mastercam二次开发的一点弱智罢了、、、、、可能整合vba微软要昂贵的授权费吧(听说)

至于那vbs代码勉勉强强还好 看的懂
个人的一点儒见 有错请大家指正

本帖最后由 67580276996 于 2011-4-6 23:18 编辑
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2025-2-23 16:39 , Processed in 0.030218 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2025 www.iCAx.org

快速回复 返回顶部 返回列表