Imports ZWCAD
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objConfig As ZcadPlotConfiguration
Dim objAcadApp As Object
Dim objDwg As Object
'Dim objAcadApp As ZcadApplication
'Dim objDwg As ZcadDocument
Dim blnresult As Boolean
objAcadApp = CreateObject("zwcad+.application")
objDwg = objAcadApp.ActiveDocument
Dim myspace As ZWCAD.ZcadModelSpace
myspace = objDwg.ModelSpace()
Dim myline As ZcadLine
Dim startpoint(2) As Double
startpoint(0) = 0 : startpoint(1) = 0 : startpoint(2) = 0
Dim endpoint(2) As Double
endpoint(0) = 10 : endpoint(1) = 200 : endpoint(2) = 0
myline = myspace.AddLine(startpoint, endpoint)
myline.Update()
objDwg.SendCommand("_zoom e ")
PlotToDevice样例程序
最新推荐文章于 2023-11-28 13:50:03 发布
这段代码展示了如何使用ZWCAD API创建线条并将其发送到指定网络打印机进行打印。在按钮点击事件中,首先创建ZcadApplication和ZcadDocument对象,接着在模型空间中绘制一条线,并放大显示。然后,配置新的打印设置,指定网络打印机路径,并调用PlotToDevice方法进行打印。
摘要由CSDN通过智能技术生成