Skip to content

Having trouble placing swim-lane containers on page and around all shapes #76

Description

@bfay65

The code below places the logical container correctly:
image
but when I change that to a swimlane it seems to only center on the last shape and ignore all the others:
image
I'm assuming swimlanes and phases are different animals since they seem to respond differently to this code compared to the other containers. Is there a way to place the swimlanes first...then add the remaining containers? I can't figure out how to do that with the Bot, since:
1. I don't see an example of laying out swimlanes and phases by themselves
2. I don't see an example of laying content out into an existing container

Here's the code that works with the logical, but when I switch to SwimLane, it get's off-kilter:
New-VisioApplication

New-VisioDocument C:\temp\TestVisio3.vsdx 
Register-VisioStencil -Name Containers -Path "C:\PS\VisioBot3000-master\Examples\MyContainers.vssx"
Register-VisioStencil -Name Servers -Path "C:\Program Files (x86)\Microsoft Office\root\Office16\Visio Content\1033\SERVER_U.vssx"
Register-VisioShape -Name WebServer -From Servers -MasterName 'Web Server'
Register-VisioContainer -Name Location -From Containers -MasterName 'Location'
Register-VisioContainer -Name Domain -From Containers -MasterName 'Domain'
Register-VisioContainer -Name Logical -From Containers -MasterName 'Logical'
Register-VisioContainer -Name Swimlane -From Containers -MasterName 'Swimlane'
Register-VisioShape -Name DBServer -From Servers -MasterName 'Database Server'

New-VisioContainer -shape (Get-VisioShape Logical) -label MyFarm -contents {
#New-VisioContainer -shape (Get-VisioShape Swimlane) -label MyFarm -contents {
    New-VisioContainer -shape (get-visioshape Domain) -label MyDomain_1 -contents {
       Set-NextShapePosition -x 1.5 -y 8
           New-VisioShape -master WebServer -label PrimaryServer    
           New-VisioShape -master WebServer -label PrimaryServer_2 
           New-VisioShape -master DBServer -label SQL01            
    }
    New-VisioContainer -shape (Get-VisioShape Location) -label DRSite -contents {
        New-VisioContainer -shape (Get-VisioShape Domain) -label MyDomain_2 -contents {
            New-VisioShape -master WebServer -label BackupServer   
            New-VisioShape -master WebServer -label BackupServer_2 
        }
    }
    New-VisioConnector -From MyDomain_1 -To MyDomain_2 -Label SQL -Color Red -Arrow
}   

Thanks Mike!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions