baihai wrote:
如下是在UG下,用 UF_DRF_create_note在图纸的某一位置写2行文字的程序,运行时老说内存错误,请高手指正。
#include <stdio.h>
#include <uf.h>
#include <uf_ui.h>
#include <uf_exit.h>
#include <uf_drf.h>
#include <uf_drf_types.h>
extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
/* Initialize the API environment */
int errorCode = UF_initialize();
if ( 0 == errorCode )
{
/* TODO: Add your application code here */
int num_lines_text;
char* text_string[2];
double origin_3d[3];
int orientation;
tag_t note_tag;
num_lines_text=2;
text_string[0]="adsadsadsafdsa";
text_string[1]="bbb";
origin_3d[0]=100.0;
origin_3d[0]=200.0;
origin_3d[0]=0.0;
orientation=0;
note_tag=NULL;
UF_DRF_create_note(num_lines_text,text_string,origin_3d,orientation,[$note_tag)]
/* Terminate the API environment */
errorCode = UF_terminate();
}
/* Print out any error messages */
PrintErrorMessage( errorCode );
}
欢迎光临 iCAx开思网 (https://www.icax.org/) | Powered by Discuz! X3.3 |