VBA Plotting several planes from the same ModelSpace using Window Plotting.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
My name is Alvaro, I have been reading in this forum for a month now, this is the first time I write a post. I've looked through previous topics and despite I have found similar topics I haven't been able to solve my problem.
I need to plot several planes from the same model space.
I am able to do this using: commands, for, and a coordinate sheet that I wrote in excel. However this method doesn’t allow me to automatically name each file with its corresponding name.
I think there is a way to use VBA so I can automatically name the files, I have made some progress but I am struggling to set the printer and of course to set the file name.
If you could please tell me how to set the printer and how to set the file name using VBA in the window plotting mode. I think I will be able to manage to write the remaining code.
This is the part of the code I would like to rewrite in VBA in order to be able to name each file in each iteration of the for.
For i = 0 To c
'Lower Left Corner p0(0) = ThisWorkbook.Sheets("Coordinates").Cells(7, 3 + 5 * i): p0(1) = ThisWorkbook.Sheets("Coordinates").Cells(7, 4 + 5 * i)
'Right top corner
p1(0) = ThisWorkbook.Sheets("Coordinates").Cells(7, 5 + 5 * i): p1(1) = ThisWorkbook.Sheets("Coordinates").Cells(7, 6 + 5 * i)
'Plot window by command.
AutoCAD.Application.ActiveDocument.SendCommand "_-PLOT" & vbCr & "Si" & vbCr & vbCr & "PDFCreator" & vbCr & "A4" & vbCr & vbCr & "Horizontal" & vbCr & vbCr & "Ventana" & vbCr & p0(0) & "," & p0(1) & vbCr & p1(0) & "," & p1(1) & vbCr & vbCr & vbCr & vbCr & vbCr & "PDFCreator" & vbCr & vbCr & vbCr & vbCr Next i
Thanks, Alvaro.