| 查看: 3153 | 回复: 3 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
sixulianyi新虫 (初入文坛)
|
[求助]
利用Ledit的C语言的宏程序画余弦S弯曲线,能和软件连接但是画不出图!!代码已附上 已有1人参与
|
|
|
想在L-edit里面画余弦S弯曲线,故写了一个C语言的宏程序,在Ledit里面运行了,能与软件连接,能显示光标坐标位置以及弹出参数的对话框,但是画不出曲线图。代码如下面所示。语句上按照软件的说明以及自带的例子看了一遍没有错误,实在找不出什么原因。,求问群里的大神哪里出错了!!! #include <stdlib.h> #include <math.h> #include <ldata.h> void SMacro ( void ) { /********************************************************************/ /* 余弦S弯 */ /********************************************************************/ double Height, Length, Width, Deltax; long P, Points_Total; double PI = 3.141592654; LPoint Points [ 1002 ]; LObject Polygon; LCell Cell_Draw = LCell_GetVisible( ); LFile File_Draw = LCell_GetFile ( Cell_Draw ); LPoint pt = LCursor_GetPosition ( ); LDialog_MsgBox( LFormat( "( %lf, %lf )", pt.x, pt.y) ); LDialogItem Dialog_Items [ 3 ] = { { "Height ", "50.0" }, {"Length ", "1500"}, { "Width ", "5.0" } }; /********************************************************************/ if(LLayer_Find (File_Draw, "Poly" == NULL){ LDialog_AlertBox("There is no Poly layer.\nMake sure Poly is in the layer map!" ;return; } if( LDialog_MultiLineInputBox ( "S Properties", Dialog_Items, 3 ) ) { Height = atof ( Dialog_Items [ 0 ].value ); Length = atof ( Dialog_Items [ 1 ].value ); Width = atof ( Dialog_Items [ 3 ].value ); return 1; } else return 0; Deltax = 3.0; for ( P = 0; P <= Points_Total; P++ ) { Points [ P ].x = pt.x +Deltax*P; Points [ P ].y = pt.y + Height/2*(1-cos(PI*( Deltax*P )/Length)); Points [ 1002 - P ].x = Points [ P ].x ; Points [ 1002 - P ].y = Points [ P ].y +Width ; } Polygon = LPolygon_New ( Cell_Draw, LLayer_Find ( File_Draw, "Poly" ), Points, 1002 ); LCell_SetView ( Cell_Draw, LCell_GetMbb ( Cell_Draw ) ); LCell_MakeVisible ( Cell_Draw ); LCell_HomeView ( Cell_Draw ); } int UPI_Entry_Point( void ) { LMacro_Register("S", "SMacro" ;return 1; } |
» 猜你喜欢
北方工业大学储能技术-02电化学储能与氢能方向招收2026级二次调剂学生
已经有0人回复
求助WO3.cif文件 对应PDF卡片 43-1035,单斜晶系 , P21/n 。
已经有2人回复
金属材料论文润色/翻译怎么收费?
已经有76人回复
稀土发光分析|核壳结构|寿命拟合
已经有13人回复
稀土发光分析|核壳结构|寿命拟合
已经有6人回复
稀土发光分析|核壳结构|寿命拟合
已经有0人回复
稀土发光分析|核壳结构|寿命拟合
已经有0人回复
26 届青岛大学纺织化学与染整工程硕士(液体纳米分散染料方向)求申博建议
已经有4人回复
26 届青岛大学纺织化学与染整工程(液体纳米分散染料)求浙理工纺织 / 材料博导名额
已经有1人回复
敢问Acta Pharmaceutica Sinica B with Editor 三周了,能是什么情况?
已经有0人回复
yuguofang
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 348.4
- 散金: 10
- 帖子: 41
- 在线: 24.8小时
- 虫号: 6453695
- 注册: 2017-05-05
- 专业: 半导体电子器件
3楼2021-05-18 18:12:26
sixulianyi
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 131.5
- 散金: 20
- 红花: 1
- 帖子: 22
- 在线: 7.3小时
- 虫号: 2429791
- 注册: 2013-04-22
- 专业: 光子与光电子器件
2楼2016-06-21 16:06:49












== NULL)
回复此楼