Quantcast
Channel: VisioAutomation
Viewing all articles
Browse latest Browse all 742

Commented Unassigned: Get-VisioCustomProperty broken (1.1.12) [26324]

$
0
0
Hi saveenr,

Did the latest patch break previously working functionality? In the latest version (1.1.12), I’m getting the following error that didn’t happen in any previous versions, hundreds of times always related to Get-VisioCustomProperty:

```
ERROR: Get-VisioCustomProperty : 2
visioPOC.ps1 (91): ERROR: At Line: 91 char: 16
ERROR: + $shapedata = Get-VisioCustomProperty -Shapes $_
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : NotSpecified: (:) [Get-VisioCustomProperty], AutomationException
ERROR: + FullyQualifiedErrorId : VisioAutomation.AutomationException,VisioPS.Commands.Get_VisioCustomProperty
ERROR:
ERROR: Cannot index into a null array.
```

The involved function follows:

```
function ProcessTextBoxes()
{
$shapes = Get-VisioShape -Flags Page
$shapes | % { if ($_.NameU -like "Text box*") {
$shapedata = Get-VisioCustomProperty -Shapes $_
$props_for_shape1 = $shapedata[$_]
foreach ($propname in $props_for_shape1.Keys)
{
$custompropcells = $props_for_shape1[ $propname ]
$propname = $custompropcells.Value.Formula
$prop = $propname.ToString().Replace('"', '')
WriteVariableElement -Name $prop -Value $_.Text
}
} #%
}
}
```

Comments: I did make some core changes to how VisioPS works with shapesheets work internally but don't think I changed anything with regard to custom properties. If it's possible could you attach/send your Visio document?

Viewing all articles
Browse latest Browse all 742

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>