Main Menu

Recent posts

#91
General Visio / Re: Accept dropped shapes beha...
Last post by Yacine - April 06, 2024, 04:14:51 PM
It's nice seeing you code.
I can unfortunately not jump on this train.
Unlike Python, our IT guys think that Powershell is dangerous. So it is completely blocked on the computer where I have Visio.
By the way, cudos for this choice. Powershell is much more cryptic than Python.
#92
General Visio / Re: Accept dropped shapes beha...
Last post by wapperdude - April 06, 2024, 03:22:25 PM
Here's the PowerShell script.  It's been tested on a couple of different Visio files.  Also, ran it on Windows PowerShell ISE and PowerShell 7.

By reconstructing the original file on a per page basis, the new file is free of the issue here.    However, I do see some potential problems, e.g., inter-page link formulae may (will) be broken.  Also, doc stencil is not copied. 

Things to note:
1)  Path to original file to be copied is hard coded.
2)  The code will pause when complete...with message.  This allows you to do SaveAS for new Visio file.  No other steps needed.  Go back to the active PowerShell window and hit <Enter>.  The script will close the Visio application, clearing memory.
3)  The new Visio document will have a blank 1st page.  Delete it if you want.

Import-Module Visio
$NewDoc = New-VisioDocument

$origDoc = Open-VisioDocument "C:\Users\wappe\OneDrive\Documents\Visio\Forum\GroupPlaceBehavior.vsdx"
$visApp = Get-VisioApplication

foreach($pG in $origDoc.Pages) {
    $visApp.ActiveWindow.Page = $pG
    Copy-VisioPage -ToDocument $newDoc
}

write-host "Save new Visio file.  Then hit <Enter> to contine"
Pause
Close-VisioApplication
#93
General Visio / Re: Accept dropped shapes beha...
Last post by wapperdude - April 06, 2024, 02:42:03 PM
Because I love to program and write code ... 👀 🤔😜😲 ... I do have a PowerShell script file that will copy pages from 1 file to a new file.  But, not at my PC.  Will post in an hour or so.
#94
General Visio / Re: Accept dropped shapes beha...
Last post by Yacine - April 06, 2024, 08:27:09 AM
Your broken file explanation is good enough for me.
Knowing that I can just copy my shapes in a new document is fine.
Thank you Wayne
#95
Shapes & Templates / Re: Master inside a Master
Last post by Surrogate - April 06, 2024, 01:41:24 AM
Quote from: Dazling on April 06, 2024, 01:20:20 AMIs there a way to do this?
IMHO No way!

When shape placed inside the master, it loses its connection (or inheritance) with its master shape.
#96
Shapes & Templates / Master inside a Master
Last post by Dazling - April 06, 2024, 01:20:20 AM
Hello All,

I have two master shapes, one is the layout(PLC controller shape) of sorts which we will call master A in a stencil, then another master(B), which will be used to display the Inputs and Outputs of the PLC controller in the same stencil. Is there a way to do this? Currently, I only have the master and many repeated groups of shapes to represent the Inputs/Outputs, if I decide to make a change to anything, I have to repeat the change hundreds of times, I was hoping that I could somehow only edit Master B and all the changes get pushed down.

Thank You.

#97
General Visio / Re: Accept dropped shapes beha...
Last post by wapperdude - April 06, 2024, 01:06:11 AM
Quote from: Yacine on April 05, 2024, 10:51:38 PMWhere is that stored? How can I edit it?

AFAIK it is built-in, nothing to edit, nothing stored.  Something is broken in your current file, don't know how to fix it.  Sharpen your axe.  Not knowing how big your file is, perhaps a bit of code to copy contents on a per page basis, and paste into new, blank file???   Sounds like a PowerShell script file.
#98
General Visio / Re: Accept dropped shapes beha...
Last post by wapperdude - April 05, 2024, 11:44:52 PM
Hmmm.  My interpretation is that what you're experiencing is not normal.  Would seem to be an issue with your file.  To make my point, I created a new stencil with all of your shapes, plus the smart shape, as is.  I saved this stencil.  Next, I opened up a new Visio document.  First, I dropped the smart shape.  Then, I drag and dropped a variety of the other shapes.  There was no far reaching capture by the smart shape.  This phenomena only happens in your file. That is to say, normally, for a container to capture, the shape must, at minimum, touch the container. Your file has abnormal behavior.   
#99
General Visio / Re: Accept dropped shapes beha...
Last post by Yacine - April 05, 2024, 10:51:38 PM
Yes, same result on my side.
And this re-enforces me in asking, what are the boundaries of the drop range? Where is that stored? How can I edit it?

(Since I need to edit my drawing automatically - without the hack of creating a new drawing)
#100
General Visio / Re: Accept dropped shapes beha...
Last post by wapperdude - April 05, 2024, 10:18:23 PM
Add new page.  Did copy / paste.  Behavior replicates. 

Created new Visio doc, did copy / paste, behavior is gone.