Page 101 - 6735
P. 101
Public Sub main() 'процедура для тестування
GenerateDrawing та UpdateDrawing
'створити об'єкти
Dim view1 As New DrawingView
Dim view2 As New DrawingView
Dim sheet1 As New DrawingSheet
Dim sheet2 As New DrawingSheet
Dim data As New DrawingData
Set swApp = Application.SldWorks
macroPath = UCase(swApp.GetCurrentMacroPathFolder) 'шлях
до каталогу з макросом
Debug.Print macroPath
'присвоїти атрибутам значення
view1.Name = "Drawing View1"
view2.Name = "Drawing View2"
view1.ReferenceModelPath = macroPath & "\part1.SLDPRT"
view2.ReferenceModelPath = macroPath & "\part1.SLDPRT"
view1.Configuration = "По умолчанию"
view2.Configuration = "По умолчанию"
view1.ModelViewName = 0
view2.ModelViewName = 3
sheet1.Name = "Sheet0"
sheet2.Name = "Sheet1"
view1.PositionX = 0.15
view1.PositionY = 0.19
view2.PositionX = 0.3
view2.PositionY = 0.19
sheet1.views.Add view1 'додати види в листи
sheet1.views.Add view2
data.Sheets.Add sheet1 'додати листи в data
data.Sheets.Add sheet2
'Set dv = findView("Sheet0", "Drawing View1", data) ' тест
функції пошуку
101