Message 1 of 8
Bind and save
Not applicable
05-01-2009
02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, I have put together a tool that goes through and batch binds, prints, PDF's and DWF's files (subject to user choice) everything works fine except once its finished with the drawing its publishing it closes and doesnt seem to save (none of the xrefs are bound when opened again) although if I watch the process I can see the refs being removed in the xref manager.
here is a snippet of code but dont know if you would want to see the actual bind process, PUBpage has a number of process indicators that show the progress:
Help please someone must know what im doing wrong.
{code}
Dim dwg
dwg = Application.DocumentManager.Open(DestinationFile, False)
Dim ThisDrawing As Document = Application.DocumentManager.MdiActiveDocument
Using LockDB As DocumentLock = ThisDrawing.LockDocument()
'-----------secondary publish--------------
'Bind drawings
If lines(2) = 1 Then
'progress meter
pubPage.BoundProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.BoundVal.Text = j
bindAllDrawings()
End If
If lines(5) = 1 Then
'Print DWFs''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
PrintDWFFiles(lines, FinIsFolder.Text & "\" & Strings.Left(DWGNm, Len(DWGNm) - 4))
'progress meter
pubPage.DWFProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.DWFVal.Text = j
End If
'Print PDFs
If lines(6) = 1 Then
PrintPDFFiles(lines, FinIsFolder.Text & "\" & Strings.Left(DWGNm, Len(DWGNm) - 4))
'progress meter
pubPage.PDFProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.PDFVal.Text = j
End If
'close and save the drawing
Dim DB As Database = ThisDrawing.Database
DB.SaveAs(DWGNm, DwgVersion.Current)
End Using
ThisDrawing.CloseAndSave(DWGNm)
ThisDrawing.Dispose()
Next
{code}
Daniel Edited by: dheselwood on May 1, 2009 9:16 AM
here is a snippet of code but dont know if you would want to see the actual bind process, PUBpage has a number of process indicators that show the progress:
Help please someone must know what im doing wrong.
{code}
Dim dwg
dwg = Application.DocumentManager.Open(DestinationFile, False)
Dim ThisDrawing As Document = Application.DocumentManager.MdiActiveDocument
Using LockDB As DocumentLock = ThisDrawing.LockDocument()
'-----------secondary publish--------------
'Bind drawings
If lines(2) = 1 Then
'progress meter
pubPage.BoundProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.BoundVal.Text = j
bindAllDrawings()
End If
If lines(5) = 1 Then
'Print DWFs''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
PrintDWFFiles(lines, FinIsFolder.Text & "\" & Strings.Left(DWGNm, Len(DWGNm) - 4))
'progress meter
pubPage.DWFProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.DWFVal.Text = j
End If
'Print PDFs
If lines(6) = 1 Then
PrintPDFFiles(lines, FinIsFolder.Text & "\" & Strings.Left(DWGNm, Len(DWGNm) - 4))
'progress meter
pubPage.PDFProgress.Value = ((ActionList.Items.Count * 100) - (j * 100))
pubPage.PDFVal.Text = j
End If
'close and save the drawing
Dim DB As Database = ThisDrawing.Database
DB.SaveAs(DWGNm, DwgVersion.Current)
End Using
ThisDrawing.CloseAndSave(DWGNm)
ThisDrawing.Dispose()
Next
{code}
Daniel Edited by: dheselwood on May 1, 2009 9:16 AM