where is link
- - - Updated - - -
Code:
Sub PlotMultipleAreas()
Dim i As Integer
Dim Dwg As AcadDocument
Dim SS As AcadSelectionSet
Dim acObj As AcadObject
Dim acBl As AcadBlockReference
Dim acLwP As AcadPolyline
Dim ObjectNames As String
Dim pt1 As Variant, pt2 As Variant
Set Dwg = ActiveDocument
Dim t As String: t = Now
Set SS = Dwg.SelectionSets.Add(t)
Dwg.ActiveSpace = acModelSpace
With SS
.Clear
.SelectOnScreen
End With
If SS.Count = 0 Then GoTo QuitSub
ObjectNames = "AcDbBlockReference"
For Each acObj In SS
If InStr(1, ObjectNames, acObj.ObjectName) = 0 Then GoTo NextObject
acObj.GetBoundingBox pt1, pt2
pt1 = ThisDrawing.Utility.TranslateCoordinates(pt1, acWorld, acDisplayDCS, False)
pt2 = ThisDrawing.Utility.TranslateCoordinates(pt2, acWorld, acDisplayDCS, False)
ReDim Preserve pt1(1)
ReDim Preserve pt2(1)
With Dwg.ModelSpace.Layout
.PlotType = acWindow
.CenterPlot = True
.SetWindowToPlot pt1, pt2
.GetWindowToPlot pt1, pt2
End With
i = i + 1
On Error Resume Next
Dwg.Plot.PlotToFile "C:\Users\wawang-pc\Documents\0\" & Chr(i) ' my dwg in so many block but only one show in folder
NextObject:
Next acObj
QuitSub:
Set SS = Nothing
Set Dwg = Nothing
End Sub
- - - Updated - - -
where is link that is blank cell