Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: MKE_Howard

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) :thumbs_up:.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)