Community
Hi All
I created viewports in various layouts and zoom window locked it.
All the stuff is visible before saving, after saving when I reopen it, all the viewports are not available and I need to do it manually.@norman
acadDoc.ActiveSpace = 0
ViewPinsertionPoint(0) = 504.5
ViewPinsertionPoint(1) = 420.5
ViewPinsertionPoint(2) = 0
newViewport = "newViewport" & i
Set newViewport = acadDoc.PaperSpace.AddPViewport(ViewPinsertionPoint, 979, 811)
acadApp.ZoomExtents
newViewport.Display (True)
acadDoc.MSpace = True
UpperLeft(0) = ThisWorkbook.Worksheets("Execute").Range("cf" & i - 7).Value ' X-coordinate of lower-left corner
UpperLeft(1) = ThisWorkbook.Worksheets("Execute").Range("cg" & i - 7).Value
UpperLeft(2) = 0
LowerRight(0) = ThisWorkbook.Worksheets("Execute").Range("ch" & i - 7).Value
LowerRight(1) = ThisWorkbook.Worksheets("Execute").Range("ci" & i - 7).Value
LowerRight(2) = 0
acadDoc.Application.ZoomWindow UpperLeft, LowerRight
acadDoc.MSpace = False
newViewport.DisplayLocked = True
In the code you show, you never saved the dwg.
activeDoc.Save()
Thanks Ed, Above is just part of the code hence . I am saving the drawing, in fact I have saved the drawing manually also and everything is fine before closing but when I reopen it all viewports are not available.
Then can you post a complete code sample that we can test?
Can't find what you're looking for? Ask the community or share your knowledge.