PublicSub ChangeSheet(ByVal DrawingFormatFile AsString) Dim sheetOwner As IpfcSheetOwner Dim DrawingFormat As IpfcDrawingFormat Dim modelDesc As IpfcModelDescriptor Dim retrieveModelOptions As IpfcRetrieveModelOptions Dim model As IpfcModel Try If Isdrawding() = TrueThen sheetOwner = CType(asyncConnection.Session.CurrentModel, IpfcSheetOwner) '打开一个图框文件 modelDesc = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_DWG_FORMAT, Nothing, Nothing) modelDesc.Path = DrawingFormatFile retrieveModelOptions = (New CCpfcRetrieveModelOptions).Create retrieveModelOptions.AskUserAboutReps = False '加载图框 model = asyncConnection.Session.RetrievemodelWithOpts(modelDesc, retrieveModelOptions) '设定图框 DrawingFormat = CType(model, IpfcDrawingFormat) sheetOwner.SetSheetFormat(sheetOwner.CurrentSheetNumber, DrawingFormat, Nothing, Nothing) EndIf Catch ex As Exception MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString) EndTry EndSub