Back Yard Patio (small)
This should perhaps be posted to the development side. But I put in a patio in the back yard today and wanted to share some of what I learned.
Sub DrawVisio()
Dim oVisio As New Visio.Application
Dim oDoc As Visio.Document
Dim oPage As Visio.Page
Set oDoc = oVisio.Documents.Add("basic.vst")
Set oPage = oDoc.Pages.Add
'Set oPage = oDoc.Pages.Add
    Dim UndoScopeID2 As Long
    UndoScopeID2 = oVisio.BeginUndoScope("Page Setup")
    oVisio.ActivePage.Background = False
    oVisio.ActivePage.BackPage = ""
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageWidth).FormulaU = "8 ft 6 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageHeight).FormulaU = "11 ft"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageDrawingScale).FormulaU = "1 ft"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPage, visPageDrawScaleType).FormulaU = "3"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOLineToNodeX).FormulaU = "0 ft 1.5 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOLineToNodeY).FormulaU = "0 ft 1.5 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOBlockSizeX).FormulaU = "0 ft 3 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOBlockSizeY).FormulaU = "0 ft 3 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOAvenueSizeX).FormulaU = "0 ft 4.5 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOAvenueSizeY).FormulaU = "0 ft 4.5 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOLineToLineX).FormulaU = "0 ft 1.5 in"
    oVisio.ActivePage.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOLineToLineY).FormulaU = "0 ft 1.5 in"
    oVisio.EndUndoScope UndoScopeID2, True
' 132 doc points = 11 ft => all units in inches
Dim iRow As Integer
Dim x As Double
For iRow = 1 To 7
    x = Cells(iRow, 1).Value * 12
    oPage.DrawLine x, 0#, x, Cells(iRow, 2).Value * 12
Next iRow
Set oDoc = Nothing ' minimal garbage collection
End Sub
So by taking measurements (with my laser), I was able to populate a spreadsheet which drew the lines I needed. I connected these lines with some splines and then was able to get the layout I wanted.
Picture coming.
Be the first to write a comment.