03-01-2023
07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-01-2023
07:01 AM
Hi @MKE_Howard. Maybe this simple example will work for you, or at least get you the needed information to build your own similar version. The key method here is the Sheet.CopyTo method, that copies a sheet from the current drawing to another drawing.
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oPathAndName As String = ThisDoc.PathAndFileName(Fasle)
For Each oSheet As Sheet In oDDoc.Sheets
Dim oNewIDW As DrawingDocument = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject)
Dim oCopiedSheet As Sheet = oSheet.CopyTo(oNewIDW)
For Each oSht As Sheet In oNewIDW.Sheets
If oSht IsNot oCopiedSheet Then oSht.Delete
Next
'need code here to provide different file name to each new document
Dim oNewFullFileName As String = oPathAndName & "-" & oSheet.Name & ".idw"
oNewIDW.SaveAs(oNewFullFileName, False)
Next
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS)
.
Wesley Crihfield
(Not an Autodesk Employee)