调用EWDraw.ocx控件实现2D和3D的类似cad功能
By
admin
at 2020-02-25 • 0人收藏 • 2498人看过
只是简单的测试了下, 代码如下
import win.ui; /*DSG{{*/ var winform = win.form(text="aardio form";right=759;bottom=469) winform.add( button={cls="button";text="开启网格";left=11;top=428;right=175;bottom=470;z=1}; button2={cls="button";text="画线";left=194;top=428;right=288;bottom=470;z=3}; button3={cls="button";text="画圆";left=293;top=428;right=387;bottom=470;z=4}; static={cls="static";text="Static";left=0;top=0;right=760;bottom=424;transparent=1;z=2} ) /*}}*/ import console console.open() var ew = winform.static.createEmbed("EWDRAW.EWDrawCtrl.1") var EWdraw1 = ew._object winform.button.oncommand = function(id,event){ EWdraw1.SetGridValue( 5, 5, 100, 100, 0) EWdraw1.SetGridOn( true) } winform.button2.oncommand = function(id,event){ //EWdraw1.SetDisplayToolBar(true) var a = com.SafeArrayV({0;0;0}); var b = com.SafeArrayV({5;5;0}); console.log( EWdraw1.Line(a,b) ) } winform.button3.oncommand = function(id,event){ var a = com.SafeArrayV({0;0;0}); var b = com.SafeArrayV({0;0;1}); console.log( EWdraw1.Circle(a,20,b) ) } winform.show(); win.loopMessage();
更多功能请参考文档吧...
主要是注意一下这个控件里面的点的初始化方法就行
登录后方可回帖