YesThenobjPlot.PlotToDeviceobjLayout.ConfigNameElseIfUserSel=vbCancelThenExitSubEndIfEndIf'关闭文档False为不保存修改IfAutoCloseThenobjDoc.CloseFalse,ThisDrawing.NameEndSubPublicFunctionIsFrame(entobjAsObject,AutoModeAsBoolean)AsBoolean '判断是否为图框OnErrorResumeNextIsFrame=FalseDimiAsIntegerDimFrmNameListAsVariantFrmNameList="blkFrame,A1,A2,A3,A4,PC_PAPER_DIC" '图框块、编组名列表FrmNameList=Split(FrmNameList,",")Fori=0ToUBound(FrmNameList)Ifentobj.Name=FrmNameList(i)ThenIsFrame=TrueExitForEndIfNext'块名不符时由大小比例判断是否为图框(可能会误判,不过几率不高)IfIsFrame=FalseAndAutoModeAndentobj.ObjectName="AcDbBlockReference"Thenentobj.GetBoundingBoxptMin,ptMaxDebug.PrintptMin(0)&"--"&ptMax(0)IfAbs((ptMax(1)-ptMin(1))/(ptMax(0)-ptMin(0))-1.414)<0.01OrAbs((ptMax(1)-ptMin(1))/(ptMax(0)-ptMin(0))-0.707)<0.01ThenIsFrame=TrueEndIfEndIfEndFunction