u = 0
For Each Ramka In Draw.ModelSpace
if Ramka.ObjectName = "AcDbBlockReference" then
If Ramka.name = "A0_книж" Or Ramka.name = "A2_книж" Then
If Ramka.name = "A0_книж" Then
point_ar = array(841.0, 1189.0)
AF = "ISO без полей A0 (841.00 x 1189.00 мм)"
End If
If Ramka.name = "A2_книж" Then
point_ar = array(420.0, 594.0)
AF = "ISO без полей A2 (420.00 x 594.00 мм)"
End If
u = u + 1
' dim point2_ar(2)
' point_ar = array(Cdbl(841.0), Cdbl(1189.0))
point1 = ThisApplication.Utility.ArrayToVariant(Ramka.InsertionPoint)
' msgbox point1(0) + point_ar(0)
' point2_ar(0) = point1(0) + point_ar(0)
' point2_ar(1) = point1(1) + point_ar(1)
' point2 = point2_ar
'
' w = point2(0) - point1(0)
' h = point2(1) - point1(1)
' AF = "ISO без полей A0 (841.00 x 1189.00 мм)"
Plotter = "DWG To PDF.pc3"
'
ReDim Preserve point1(2)
ReDim Preserve point2(2)
' point1 = ThisApplication.Utility.VariantToArray(point1)
' point2 = ThisApplication.Utility.VariantToArray(point2)
'' If (Draw.ActiveSpace = acModelSpace) Then
' Dim vp
'' Dim vp_tochka(0 To 2) As Double
'' Dim vp_tochka(3)
' Set vp = Draw.ActiveViewport
'' vp_tochka(0) = 0
'' vp_tochka(1) = 0
'' vp_tochka(2) = 0
'' vp.Target = vp_tochka
' vp.Target = ThisApplication.Utility.VariantToArray(array(Cdbl(5000), Cdbl(5000), Cdbl(5000)))
'' vp.Target = ThisApplication.Utility.VariantToArray(vp_tochka)
' Draw.ActiveViewport = vp
' Draw.Regen acAllViewports '1
''End If
Set olayt = Draw.ActiveLayout
olayt.ConfigName = Plotter
olayt.SetWindowToPlot ThisApplication.Utility.VariantToArray(array(Cdbl(point1(0)), Cdbl(point1(1)))), ThisApplication.Utility.VariantToArray(array(Cdbl(point1(0)+point_ar(0)), Cdbl(point1(1)+point_ar(1))))
msgbox point1(0) & " - " & point1(1)
msgbox point1(0) + point_ar(0)
msgbox point1(1) + point_ar(1)
olayt.PlotType = acWindow
olayt.CenterPlot = True
olayt.PlotRotation = ac0degrees
olayt.StandardScale = 0
olayt.RefreshPlotDeviceInfo
Retval = ThisApplication.Utility.ArrayToVariant(olayt.GetCanonicalMediaNames())
' olayt.CanonicalMediaName = "ISO_full_bleed_A0_(841.00_x_1189.00_MM)"
For Each r In Retval
' MsgBox olayt.GetLocaleMediaName(r)
If (olayt.GetLocaleMediaName(r) = AF) Then
olayt.CanonicalMediaName = r
MsgBox r
' AF_r = r
Exit For
End If
Next
Draw.Plot.PlotToFile "C:\Users\damir\Desktop\1-1-1\" + CStr(u) + ".pdf" '(Replace(Draw.FullName, "dwg", "pdf")
End If
end if
Next