03-14-2024
08:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-14-2024
08:29 PM
t to separate the views you would do so in the For Loop of Drawing Views.
You can either call a sub routine and offer the view as an argument or you can filter the view object within the loop but in this case all of the routine needs to be within this loop. A sub routine might be a cleaner approach.
See example here, it isn't finished but you should get the structure.
Sub Main
Dim oDrawing As DrawingDocument = ThisApplication.ActiveDocument
For Each oView As DrawingView In oDrawing.ActiveSheet.DrawingViews
If oView.Name = "view1" Then
'update the view1 ipart partmember to Cell A1, pass the excelvalue for partmember into the sub routine as argument
partMember = 1
ProcessView(drawView,partMember)
ElseIf View.Name = "view2" Then
'update the view1 ipart partmember to Cell B1, pass the excelvalue for partmember into the sub routine as argument
partMember = 2
ProcessView(drawView,partMember)
ElseIf View.Name = "view3" Then
'update the view1 ipart partmember to Cell C1, pass the excelvalue for partmember into the sub routine as argument
partMember = 3
ProcessView(drawView,partMember)
End IF
Next
End Sub
Sub ProcessView(drawView As DrawingView,partMember As String)
'Do something with the view object
MessageBox.Show(partMember, "partMember")
MessageBox.Show(drawView.Name,"Drawing View Name")
End Sub
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan
Or if this helped you, please, click (like)
Regards
Alan