''''取当前文档对从顶模型空属性DimindexAsIntegerForindex=0Tosp.Count-1DimnameAsStringname=sp.Item(index).ObjectName''''判断模型空间中的项目是否是一个块引用IfnameLike"*Ac*"ThenDimblockRefAsAcadBlockReferenceSetblockRef=sp.Item(index)''''块引用的插入点DiminsertPointAsVariantinsertPoint=blockRef.InsertionPoint''''放大比例DimxScale,yScaleAsIntegerxScale=blockRef.XScaleFactoryScale=blockRef.YScaleFactor''''宽高基数Dimwidth,heightAsDoublewidth=297height=210''''打印区域DimUpperRight(0To1)AsDouble,LowerLeft(0To1)AsDoubleUpperRight(0)=insertPoint(0)UpperRight(1)=insertPoint(1)LowerLeft(0)=insertPoint(0)+width*xScaleLowerLeft(1)=insertPoint(1)-height*yScalelist.AddItem"inserPoint:X="&UpperRight(0)&"Y:"&UpperRight(1)list.AddItem"lowerLeft:X="&LowerLeft(0)&"Y:"&LowerLeft(1)DimplotConfsAsAcadPlotConfigurationsSetplotConfs=ThisDrawing.PlotConfigurationslist.AddItemplotConfs.CountDimplotconfAsAcadPlotConfigurationSetplotconf=plotConfs.Add("plot")''''list.AddItemplotconf.GetPlotDeviceNames(5)''''SetplotConf=ThisDrawing.PlotConfigurations.Add''''设置定义要打印的布局范围的坐标ThisDrawing.ActiveLayout.SetWindowToPlotLowerLeft,UpperRight''''指定布局或打印配置的类型ThisDrawing.ActiveLayout.PlotType=acWindow''''按局部或完整视图预览方式显示打印预览对话框ThisDrawing.Plot.DisplayPlotPreviewacFullPreview''''打印布局到设备ThisDrawing.Plot.PlotToDeviceEndIfNextindex
阅读全文 >