没有合适的资源?快使用搜索试试~ 我知道了~
首页VERICUT API Guide-converted
资源详情
资源评论
资源推荐

VERICUT Development Tools

VERICUT Development Tools
1
OptiPath API
Introduction
OptiPath API is designed to enable an interface between VERICUT and customized plug-
in toolpath optimization programs. OptiPath API is only available on Windows platform.
When a system environment variable "CGTECH_OPAPI" is defined with a user's
optimization library name, VERICUT will automatically run OptiPath in API mode and
connect to user's program. VERICUT's own OptiPath function will no longer be
available.
NOTE: The files (opapi.lib, opapi_template.c, optiapi.h and optimport.h) referred to
below, are all located the \windows\optipath_api\ folder of your VERICUT software
installation.
How to build a plug-in library
The plug-in format used by VERICUT is a "WIN32 Dynamic Linked Library" which can
be built using MSVC. The following files/libraries are needed:
opapi.h, optimport.h, opapi.lib, opapi.dll
and a sample C file called "opapi_template.c"
The easiest way to build such a plug-in dll , for example, "opapi_usr.dll", is to start with
creating a C/C++ file, like "opapi_usr.c", with the skeleton code found in
"opapi_template.c".
There is one setup function must be present with exactly the declaration style and name
provided below:
void opapi_setup(void);
where optimization callback functions must be registered inside this setup function.
The following functions can be used to register these callbacks in setup:
void opapi_set_initialize_function(OPAPI_InitializeFunction);
void opapi_set_optimize_function(OPAPI_OptimizeFunction);
void opapi_set_terminate_function(OPAPI_TerminateFunction);
void opapi_set_tool_change_setup_function(OPAI_ToolSetupFunction);
void opapi_set_user_data(void *);

VERICUT Development Tools
2
In addition, there are 25 optional utility functions that provide the user program with
detailed process data. All the functions are described in the Function Definition section at
the end of this document. Examples can be found in "opapi_template.c".
char *opapi_get_variable_value(char *);
double opapi_get_axial_depth(void);
double opapi_get_program_feedrate(void);
double opapi_get_spindle_speed(void);
double opapi_get_total_distance(void);
double opapi_get_total_time(void);
double opapi_get_total_volume_removed(void);
double opapi_get_volume_removed(void);
int opapi_get_conventional_cut_flag(void);
int opapi_get_side_cut_flag(void);
int opapi_get_thin_cut_flag(void);
int opapi_get_turning_contact_profile(int*, int**, sOPAPI_PROFILE **);
void opapi_free(char *);
void opapi_get_contact_area(int *, double *);
void opapi_get_current_tool(char **, int *, sOPAPI_APT_CUTTER *);
void opapi_get_cut_machine_position(double[12], double[12]);
void opapi_get_cut_tool_position(double[6], double[6]);
void opapi_get_decompressed_map_data(sOPAPI_MAP, int *, char **);
void opapi_get_grid_map(sOPAPI_MAP *);
void opapi_get_motion_type(eOPAPI_MOTION_TYPE *, double[6]);
void opapi_get_radial_width(void);
void opapi_get_toolpath_record(int *, char **);
void opapi_send_message(char *, int);
void opapi_set_override_rpm(double);
void opapi_set_resolution(double);
void opapi_write_out_comment_line(char *);

VERICUT Development Tools
3
Include "opapi.h" and "optimport.h" in "opapi_usr.c". Compile and link all the usr files
with "opapi.lib". This will generate a ".dll" library.
Set system environment variable "CGTECH_OPAPI" set to where this dll is , for
example, "c:\opapi\opapi_usr.dll" and place "opapi.dll" in the same directory where
"CGTech.dll" is. OptiPath API mode is now ready to go.

VERICUT Development Tools
4
Function Definitions
Setup Functions
void opapi_setup(void)
Setup function. Must be present with exactly the same declaration style and name. Called
when OptiPath API library is first loaded. It is to register user's optimization function.
The following functions can be and should only be called in this setup function:
opapi_set_initialize_function(OPAPI_InitializeFunction);
opapi_set_optimize_function(OPAPI_OptimizeFunction);
opapi_set_terminate_function(OPAPI_TerminateFunction);
opapi_set_tool_change_setup_function(OPAI_ToolSetupFunction);
opapi_set_user_data(void *);
void opapi_set_initialize_function(OPAPI_InitializeFunction func_p)
Register user's initialization function with VERICUT. The initialization function
registered, func_p, should have the following declaration style:
typedef int (*OPAPI_InitializeFunction)(void *userData);
which returns 1 if initialization is successful or 0 if initialization failed. If failed, OptiPath
will be turned off. This function should only be called in opapi_setup() function. Once
registered, the initialization function, func_p, will be called each time the user turn
OptiPath on.
void opapi_set_optimize_function(OPAPI_OptimizeFunction func_p)
Register user's optimization function with VERICUT. The optimization function
registered, func_p, should have the following declaration style:
typedef void (*OPAPI_OptimizeFunction)(void *userData);
This function should only be called in opapi_setup() function. Once registered, the
optimization function, func_p, will be called in a frequency defined by user (see
opapi_set_resolution(double)) during cutting process.
剩余63页未读,继续阅读




JamesSivan
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- Xilinx SRIO详解.pptx
- Informatica PowerCenter 10.2 for Centos7.6安装配置说明.pdf
- 现代无线系统射频电路实用设计卷II 英文版.pdf
- 电子产品可靠性设计 自己讲课用的PPT,包括设计方案的可靠性选择,元器件的选择与使用,降额设计,热设计,余度设计,参数优化设计 和 失效分析等
- MPC5744P-DEV-KIT-REVE-QSG.pdf
- 通信原理课程设计报告(ASK FSK PSK Matlab仿真--数字调制技术的仿真实现及性能研究)
- ORIGIN7.0使用说明
- 在VMware Player 3.1.3下安装Redhat Linux详尽步骤
- python学生信息管理系统实现代码
- 西门子MES手册 13 OpcenterEXCR_PortalStudio1_81RB1.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0