2016年5月27日
导入布局的代码,运行无错误,但就是无法导入,从windows系统里看图纸集文件的修改时间也没有变化,哪位大神给看看问题出在哪啊
-
- Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
- Try
- ' Get a reference to the Sheet Set Manager object
- Dim sheetSetManager As IAcSmSheetSetMgr
- sheetSetManager = New AcSmSheetSetMgr
- For Each item As ListViewItem In lvwLayouts.Items
- ' Open sheet set file
- Dim sheetSetDatabase As AcSmDatabase
- sheetSetDatabase = sheetSetManager.OpenDatabase(txtFileName.Text)
- ' Get the Sheet set from the database
- Dim sheetset As AcSmSheetSet
- sheetset = sheetSetDatabase.GetSheetSet()
- Dim strLayoutName As String = item.SubItems(0).Text
- Dim strSheetNum As String = item.SubItems(1).Text
- Dim strSheetName As String = item.SubItems(2).Text
- 'Dim strObjID As String = item.SubItems(3).Text
- If sheetSetDatabase.GetLockStatus = AcSmLockStatus.AcSmLockStatus_UnLocked Then
- sheetSetDatabase.LockDb(sheetSetDatabase)
- End If
- Dim layoutReference As New AcSmAcDbLayoutReference
- layoutReference.InitNew(sheetSetDatabase)
- layoutReference.SetFileName(Autodesk..ApplicationServices.Application.DocumentManager.MdiActiveDocument.Name)
- layoutReference.SetName(strLayoutName)
- Dim sheet As AcSmSheet
- sheet = sheetset.ImportSheet(layoutReference)
- sheetset.InsertComponent(sheet, Nothing)
- sheet.SetNumber(strSheetNum)
- sheet.SetTitle(strSheetName)
- sheetSetDatabase.UnlockDb(sheetSetDatabase)
- ' Close the sheet set
- sheetSetManager.Close(sheetSetDatabase)
- Next
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
- Me.Close()
- End Sub
2016年6月1日
很简单,关闭数据库的时候,第二个参数为true就保存了。
2016年6月2日
图纸集确实很好用,管理图纸非常方便,但是AutoCAD自带的图纸集管理器不是很人性化,准备自己搞一个,起码可以批量编辑图纸属性。 |