Help appreciated as always!
Dim sheet1 As Layout = myLM.CreateLayout("Sheet1").GetObject(OpenMode.For
Dim vport As Viewport = trans.GetObject(sheet1.GetViewports(1), OpenMode.ForWrite)
This works for getting the viewport where sheet1 is the name of my layout. I was then able to access the viewport methods.
I am confused about a problem with my viewport scale. When I set the scale to half inch:
vport.StandardScale = StandardScaleType.Scale1To2inchAnd1ft
it removes the annotation found within my viewport. If I then manually click the scale after the drawing is loaded, the annotation appears. Seems buggy but perhaps I need to refresh something to get the annotation to automatically reappear.
thanks for sharing that, it did help a lot.
using the transaction to get the viewport(1) has made all the difference, probably because there's two showing up from the parent layout's .getviewports.count method, which complicates matters when trying to retrieve the one viewport via the layout's blocktablerecord.