Open mythrandir52 opened 5 years ago
i added as a test
$stencil_comp = Open-VisioDocument "Computers and Monitors.vss" get-visiomaster -Name * $stencil_comp
and it came back with a list of the objects.
i get nothing back from
$grp = Open-VisioDocument "actdir_u.vstx" get-visiomaster -Name * $grp
Try changing ...
get-visiomaster -Name * -document $stencil_comp
However when trying to place it...
PS C:\WINDOWS\system32> $shapes = New-VisioShape -Master $g -Points 2.2,6.8 New-VisioShape : Cannot bind parameter 'Points'. Cannot convert the "2,2" value of type "System.Double" to type "VisioAutomation.Geometry.Point". At line:1 char:45
+ CategoryInfo : InvalidArgument: (:) [New-VisioShape], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VisioPowerShell.Commands.VisioShape.NewVisioShape
Tried various variations with the same lack of luck..
$shapes = New-VisioShape -Master $g -Points @(2.2,6.8)
or more elaborate
$point1 = New-Object VisioAutomation.Geometry.Point 2.0, 6.0 $point2 = New-Object VisioAutomation.Geometry.Point 2.0, 8.0 $points = @($point1,$point2)
$shapes = New-VisioShape -Masters $pc_master -Points $points
Sorry for the late response @guldmann0211. Will take a look very, very soon.
i am having an issue creating a shape from the "Active Directory US" template. It can seem to find the shape listed. so the object is coming back as null. I know i am doing something probably simple wrong. Can someone help please. Is there an easy way to masters for a given visio doc.
The code open visio, create the page and then loads the active direct template but i can seem to grab the group or other objects from the shape template.
Mycode: ` Import-Module Visio
$app= New-VisioApplication $doc = New-VisioDocument
$grp = Open-VisioDocument "actdir_u.vstx"
$g = get-visiomaster -Name "Group" $grp
$shapes = New-VisioShape -Master $g -Points 2.2,6.8 `