[帮助]plot meth的问题
'Begin plot proccessDo While iCurrPage <= iEndPage
For i = 0 To lstPages.Size - 1
'Retrieves an page object for plot data aquisition
Set area = lstPages.getListItem(Int(i))
If area.PageNumber = iCurrPage Then
'Marks the plot area based on calculated element coordinates
Call AcadApp.ActiveDocument.ActiveLayout.SetWindowToPlot(area.StartPosition, area.EndPosition)
'Plot the marked area
Call AcadApp.ActiveDocument.ActiveLayout.GetWindowToPlot(area.StartPosition, area.EndPosition)
'Configures the marked area for window plot type
AcadApp.ActiveDocument.ActiveLayout.PlotType = acWindow
'Scales the area of impression to fit the page
AcadApp.ActiveDocument.ModelSpace.Layout.StandardScale = acScaleToFit
'Number of copies for one page
AcadApp.ActiveDocument.Plot.NumberOfCopies = iQntCopy
'Plot
Call AcadApp.ActiveDocument.Plot.PlotToDevice
'Resume if an error occurs
On Error Resume Next
'Increment the page counter
iCurrPage = iCurrPage + 1
End If
Next i
Loop
这是LUA吗?看起来很像,但有点不同。 不这是Visual Basic for Applications(VBA) 哦对不起,我错了。我能想到的唯一一件可能与他的错误是他设置I=0,最后他将iCurrPage=iCurrPage+1,当他第一次没有将其定义为iCurrPage时。
Public Sub PlotPreview()
If MsgBox("Preview", vbYesNo) = vbYes Then
ThisDrawing.Plot.DisplayPlotPreview acFullPreview
Else
ThisDrawing.Plot.DisplayPlotPreview acPartialPreview
End If
End Sub
应该是
For i = 0 To lstPages.Size - 1
至少在LUA是这样的。我只是基于这一点来思考,因为它们看起来很相似,我想它们的功能差不多。不过我可能错了。。。 你的意思是,可以使用LUA自动化AutoCAD吗?
你能帮我发一个示例代码吗。。。 For iCurrPage = 0 To lstPages.Size - 1
应该将其更改为
iCurrPage = iCurrPage + 1
因为一开始你叫它“我”。
我希望。。。我会尽力的。。。我相信你可以在21世纪的时候做这件事,但如果可以的话,它看起来几乎和你已经拥有的一模一样。
i = i + 1
大概是这样
Public Sub PlotPreview()
If MsgBox("Preview", vbYesNo) = vbYes Then
ThisDrawing.Plot.DisplayPlotPreview acFullPreview
Else
ThisDrawing.Plot.DisplayPlotPreview acPartialPreview
End If
End Sub
在卢阿。如果我用正确的方式做的话,会有更多的内容,但既然没关系,我只是给了你一个想法。 我可能错了,但我只是注意到了这一点。告诉我它是否有效。
Public Sub PlotPreview()
If MsgBox("Preview", vbYesNo) = vbYes Then
ThisDrawing
Plot
DisplayPlotPreview
acFullPreview
Else
ThisDrawing
Plot
DisplayPlotPreview
acPartialPreview
End
End
我认为你把if-then语句放错了地方,所以当你把“end if”放在末尾时,它没有if-then语句。我说错了吗?因为有时取决于你使用的脚本语言,它去哪里都无关紧要。 这是如何在VB中执行if条件。。。没什么不对的。。。 if-then语句与它的end函数不在同一个位置,有什么原因吗?我很好奇为什么会这样。你知道吗?如果不是,我不介意。 http://www.techonthenet.com/excel/formulas/if_then.php
页:
[1]
2