Public Sub DWGVIEW()
Dim a As Application
Set a = ThisApplication
Dim b As DrawingDocument
Set b = a.ActiveDocument
Dim c As Sheet
Set c = b.ActiveSheet
Dim d As DrawingView
Set d = c.DrawingViews.Item(1)
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
Dim CenterView As Point2d
Dim x As Point2d
Dim y As Point2d
Dim z As Point2d
Set x = oTransGeom.CreatePoint2d(-(d.Width * 10) - 14 / 2, -(d.Height * 10) - 14 / 2)
Set y = oTransGeom.CreatePoint2d(d.Width * 10 + 14, -(d.Height * 10) + 14 / 2)
Set z = oTransGeom.CreatePoint2d(d.Width * 10 + 14, d.Height * 10 + 14)
Set CenterView = oTransGeom.CreatePoint2d(0, 0)
d.Sketches.Add '.SketchLines.AddAsThreePointRectangle d.Width, d.Width, d.Height
Dim s As DrawingSketch
Set s = d.Sketches.Item(1)
s.Edit
Call s.SketchLines.AddAsTwoPointRectangle(x, z)
s.ExitEdit
End Sub
Public Sub DWGVIEW()
Dim a As Application
Set a = ThisApplication
Dim b As DrawingDocument
Set b = a.ActiveDocument
Dim c As Sheet
Set c = b.ActiveSheet
Dim d As DrawingView
Set d = c.DrawingViews.Item(1)
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
Dim CenterView As Point2d
Dim x As Point2d
Dim y As Point2d
Dim z As Point2d
Set x = oTransGeom.CreatePoint2d(-(d.Width * 10) - 14 / 2, -(d.Height * 10) - 14 / 2)
Set y = oTransGeom.CreatePoint2d(d.Width * 10 + 14, -(d.Height * 10) + 14 / 2)
Set z = oTransGeom.CreatePoint2d(d.Width * 10 + 14, d.Height * 10 + 14)
Set CenterView = oTransGeom.CreatePoint2d(0, 0)
d.Sketches.Add '.SketchLines.AddAsThreePointRectangle d.Width, d.Width, d.Height
'd.Sketches.Add '.SketchLines.AddByTwoPoints( x, y )(oTransGeom.CreatePoint2d(0, 0), oTransGeom.CreatePoint2d(10, 0))
Dim s As DrawingSketch
Set s = d.Sketches.Item(1)
s.Edit
Call s.SketchLines.AddAsTwoPointRectangle(x, z)
s.ExitEdit
End Sub