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

Hey, how about this:

 

Dim oDoc As Document = ThisApplication.ActiveDocument
If oDoc.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
For Each oSheet As Sheet In oDoc.Sheets
     If oSheet.DrawingViews.Count = 0 Then Continue For
     For Each oView As DrawingView In oSheet.DrawingViews
          Dim oModel As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
          If oModel.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Continue For
          Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
          oOptions.Add("SheetMetalFoldedModel", False)
          Dim oPoint As Point2D = oView.Position
          Dim oViewStyle As DrawingViewStyleEnum = oView.ViewStyle
          Dim oScale As Double = oView.Scale
          Dim oOri As ViewOrientationTypeEnum = ViewOrientationTypeEnum.kDefaultViewOrientation
          oSheet.DrawingViews.AddBaseView(oModel, oPoint, oScale, oOri, oViewStyle, , , oOptions)
          oView.Delete()
     Next
Next

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods