Closed bfay65 closed 4 years ago
The code I ran:
PS C:\PS\VisioBot3000-master>
stop-process -Name VISIO -ea SilentlyContinue remove-item c:\temp\testvisio5.vsdx -ea SilentlyContinue import-module VisioBot3000 -Force
Diagram C:\temp\TestVisio3.vsdx
Stencil Containers -From C:\temp\MyContainers.vssx Stencil Servers -From SERVER_U.vssx Shape WebServer -From Servers -MasterName 'Web Server' Container Location -From Containers -MasterName 'Location' Container Domain -From Containers -MasterName 'Domain' Container Logical -From Containers -MasterName 'Logical' Connector SQL -Color Red -arrow
Set-NextShapePosition -x 3.5 -y 7 Logical MyFarm { Location MyCity { Domain MyDomain { WebServer PrimaryServer WebServer HotSpare
}
}
Location DRSite {
Domain MyDomain -name SiteB_MyDomain {
Set-RelativePositionDirection Vertical
WebServer BackupServer
}
}
} SQL -From PrimaryServer -To BackupServer Hyperlink $BackupServer -link http://google.com
Complete-Diagram
I've seen this before, but can't reproduce it with the current repo.
Thanks for such a quick reply! Pardon me if I'm not doing something right. Am new to both power-shell and github: I clicked download on this page: https://github.com/MikeShepard/VisioBot3000, It says Latest commit: cc70594 on Jul 2, 2018. Is that not the latest? Sorry, but I reeeeeallly need to get this to work somehow in order to use VisioBot3000...Any thoughts?
Today I did this same operation (below) on a completely different machine in PS ISE Name : Windows PowerShell ISE Host Version : 5.1.18362.145
To install...I ran: CD "C:\PS\VisioBot3000-master" Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted $RootFolder = "C:\PS\VisioBot3000-master" CD $RootFolder
Install-Module -Name VisioBot3000
Lastly ran the code with no errors:
stop-process -Name VISIO -ea SilentlyContinue remove-item c:\temp\testvisio3.vsdx -ea SilentlyContinue import-module VisioBot3000 -Force
Diagram C:\temp\TestVisio1.vsdx
Stencil Containers -From C:\temp\MyContainers.vssx Stencil Servers -From SERVER_U.vssx Shape WebServer -From Servers -MasterName 'Web Server' Container Location -From Containers -MasterName 'Location' Container Domain -From Containers -MasterName 'Domain' Container Logical -From Containers -MasterName 'Logical' Connector SQL -Color Red -arrow
Set-NextShapePosition -x 3.5 -y 7 Logical MyFarm { Location MyCity { Domain MyDomain { WebServer PrimaryServer WebServer HotSpare
}
}
Location DRSite {
Domain MyDomain -name SiteB_MyDomain {
Set-RelativePositionDirection Vertical
WebServer BackupServer
}
}
} SQL -From PrimaryServer -To BackupServer Hyperlink $BackupServer -link http://google.com
Complete-Diagram
#########################
Thanks Mike!
I also wonder if it could be related to my Visio version...1911 Office 365 Plan 2. Is that the same version you used to try reproducing this?
Thanks
Figured something out...Second and 3rs server in list of children are is container, so it's skipping the first...and I did see one of your more recent changes was about skipping something. Haven't had time to look at code again yet: New-VisioContainer -shape (Get-VisioShape Location) -label DRSite -contents { New-VisioContainer -shape (Get-VisioShape Domain) -label MyDomain -contents { New-VisioShape -master WebServer -label BackupServer -x 5 -y 8 New-VisioShape -master WebServer -label BackupServer_2 -x 6 -y 8 New-VisioShape -master WebServer -label BackupServer_2 -x 7 -y 8 } }
I just removed the Skip 1 like you had done (I believe in your last commit) and all works great now!:
Am trying to understand how I did NOT have that change. As I said, I clicked download on this page: https://github.com/MikeShepard/VisioBot3000, which says "Latest commit: cc70594 on Jul 2, 2018".
So was this (above) NOT actually the latest code? Is there a better place from which to grab the latest and be sure? Learning here and want to be sure I understand.
Thanks so much!
I'm as confused as you are. I just downloaded the code via the download link and the zip has the correct code (without the skip). I cloned the repo locally when you opened the issue and it also didn't have the skip.
Not sure how you got an old commit, but that's what it sounds like.
FWIW, at least you've got things working now. If you have questions about using VisioBot let me know.
Thanks so much Mike! I don't believe I've had this great/prompt/helpful of a response from anyone in other sites/blogs etc...so I really appreciate experiencing this process more like a real conversation with a pro who really cares and is passionate about their art-form (rather than waiting for days...weeks for someone to get back with me with a not-so-helpful answer). Am thrilled to have this working! Have been more of a .Net C# programmer until recently - thus some ignorance re: Power-Shell/Visio.
...and since you kindly mentioned asking more VisioBot questions...(be careful what you ask for) (;
NOTE: Please lmk if this should begin a different venue/new dialog for this topic below - is somewhat related/gives the reason behind why I asked the above questions in the first place:
I've been working on a PowerShell project to pull shape data from hundreds of original ("Non-Visualizer", Visio, Cross-functional) diagrams into a Visualizer template, but have since discovered Visualizer limitations:
Based on my own research - I've come to the following (potentially flawed) conclusions about Visio and its Visualizer capabilities:
It baffles me that the devs haven't taken this tech (Visualizer) to the next level...it's sooo close to being something people can use for some more complex processes. Yet it seems they've left out some obvious/blaring capabilities.
So, I set out to create my own 'Visio-lizer' using com objects in Powershell. A bit of a learning curve. As I progressed, I discovered even more annoying things about Visio along the way (part of this frustration perhaps coming from my own ignorance of the nuances and vastness of Visio - a love/hate relationship for me, actually). I kept thinking there had to be others who have tried this - searching the net without much luck. I had even found one of your articles at one point but couldn't get a sample to work (my bad for not sticking with it). Then moved on at the time. Weeks went by as I learned how to extract objects from the original diags (am still struggling a bit to get the relationships between each, types of shapes etc. but am now close).
Then FINALLY last week; though getting closer to building the new diags. to my own specs from the old data with COM objects, I was still struggling with containing objects appropriately. I searched again for examples - stumbled upon your code here - you know the rest.
I wrote this novella above for 2 reasons:
Thanks for indulging me!
And FYI - Absolutely no expectations on response to the last comment/ramble. More food for thought (and fishing for more knowledge) than anything.
Happy New Year!
Hi! Thanks for all your great blogs! Am learning so much from this.
Perhaps I'm doing something wrong but downloaded your latest VisioBot3000 code and ran the sample at: https://github.com/MikeShepard/VisioBot3000/blob/master/Examples/VisioDSL3.ps1
1 of 2 shapes under container is not surrounded by or connected to the container (image attached).
Thanks!