Guarded object within a group still grows

Started by maclarkson, September 11, 2019, 02:47:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

My computer just went belly up...think an SSD drive failed.

I believe all I did was make a working copy of your vsdx file.  Added the code into This Document.  Then ran the code..  There were 3 main shapes on the left side that failed.  They were grouped...don't know if that was something I did during code debug or if they came that way.  All other shapes passed fine.

Don't be shy when code doesn't work...just let us know.  Sorry you had to spend long time on this.

I'll update if I can get my computer to boot.
Visio 2019 Pro

vojo

Sorry to hear that!!

Being a storage guy, I have seen a lot of issues SSDs, but they were all FW design issues.  I have never seen an actual SSD wear out.  The only thing I can think of is that if the PC is powered off for 30 days or so, it will lose data (SLC is more like a year, but QLC is more like few days).  Also, if the drive is older, its more likely to wear out because of write leveling (moving data around in the FLASH - there is a virtual LBA <=> physical LBA mapping that is always updated - in order to find FLASH cells with some writes still available)

Windows usually have a backup boot sector if primary fails - a good BIOS will automatically try the backup if primary fails, I take it the issue is access to ANY of the SSDs LBAs...not just regions of the SSD.  The FW quality varies by vendor (Samsung is so good, they don't answer any calls from developers trying to build a solution around them).

FWIW, there are SMART tools that can interrogate the SSD to check its view of status (if drive thinks its actually worn out, etc)
Of course, have to ask the perpetual question:  "no recent FW updates?"

Lastly, put linux on a USB key, get system up with that, then poke around the drive to see if readable at all.
If so, ghost the drive to another drive.

Hope it works out for you.

wapperdude

The PC has 3 dad's.  One, a Seagate, is the oldest, working fine.  The other two are relatively young.  The C-drive is fine.  The D-drive, is 1TB, and is the problem.  Windows went into auto repair on the drive and locked up.  Because it thinks the drive has corrupt file system, I can't get past this point.

Computer is my main computer, so never off for more than 24 hours.  Somewhere, I have an image and bootable USB thumb drive.  As this just happened, haven't had much time to sort things out.  All else fails, I'll yank the drive.

Thanks for suggestions I'll take a look at those.
Visio 2019 Pro

maclarkson


maclarkson

Hi guys,

I attached a latest copy of the visio diagram. Its looking good. I managed to create a toggle button on the Vision1 Shape where if you click the Container Off or on it will change the shape into a container. Issue is that I will have to now do this for everything. Is there any way of using your code Wapper to run through the rest of the shapes and add the shapesheet changes automatically so that they all have the button?

wapperdude

First, the last two posts came thru without attachments.

Yes.  Code can do that.

My PC is still not useable at the moment, but getting close.

Might I ask why the shift to containers?
Visio 2019 Pro

Yacine

#21
@Wapperdude and Maclarkson,
Guys, I should not have posted such an inconsiderate answer. I did not thoroughly read the question, nor the answers to it.
I just saw a similarity to a problem a handled in the past and posted my link out of pure vanity.
With this post I didn't do justice to both the questioner and the responder. I apologize for that ... especially to my buddy Wayne ;) .
Yacine

wapperdude

@Yacine:  Whoa!  No apologies needed to me.  Your tool works and is well thought out.  It is an appropriate option.  Yeah, you mentioned some bugs, but the tool is still quite useful.  I apologize because I keep forgetting about referring it.

Adding the ability to show hide subshapes would be a nice feature...especially if one of the subshapes is another group. 

Sorry if I came across as a nattling Nellie of negativity.  I think grumpy comes with age and frustration with remodelling contractors...5-6 month project now celebrating 1 year and still not finished.



Visio 2019 Pro

wapperdude

#23
PC is back!

Here's OP original file post with code added...but not run.  The code has been tested on this file, runs fine, main shape and icon shape become grouped, icon size fixed, and location fixed.  No need to select anything.  Just run code.  All shapes are process
Visio 2019 Pro

maclarkson

Sorry about that (No Attachment) but wow I just ran your Code !!! I wished I could code like that. How do you learn to code like that?

Here is the attachment. its return of your template. but with some changes I made to the vision shape. You'll see that on the right click menu you can toggle the action of changing the shape into a container or turning it off. If you can teach me the code to run an add section, add row and add update to row. life will be so amazing coz I'll be able to apply global changes so fast.

I am eventually going to connect this up to a database and when finished I will show you what the out come is.

Maybe others will be able to use it.


wapperdude

Learning to code....hmmmm. 

I'm not aware of a good, comprehensive text for Visio dedicated to topic vba.   In my case, before  I retired, I had a major coding effort using Excel and VBA.  That helped some. 

For Visio, it comes from (a) looking at what other people are doing, (b) googling..."Visio vba ... " + whatever, example:  "Visio, vba drop shape on page", (c) storing pieces of code for future reference, (d) listening to experienced coders...Yacine has pushed me to be much better than I was.  (e) the free software kit SDK, has many examples. 

And finally, try things.  Start small.  Couple hints...
1)  Have both the drawing and vba Windows open side by side
2)  in the code window, click anywhere inside a subframe, then use F8 to step thru the macro to execute code line-by-line.  You can see what happens in the drawing window
3)  use the macro recorder.  It adds a lot of extra stuff you don't need at front & end that you can thru away.  You'll quickly sort that out when comparing to other code examples.
4) Add comments to your code.  Tomorrow, a month from know, you forget what and why, comments are your explanatory notes.

Some good sites to check out:
Visio Guys blog site has articles that explain things very well.: 
John Goldsmith:  https://visualsignals.typepad.co.uk/vislog/2007/10/just-for-starte.html 
                      and http://visio.mvps.org/VBA/default.html
David Parker:  https://blog.bvisual.net

...and so many others.
Visio 2019 Pro

wapperdude

#26
See attached for latest implementation.  The code loops thru all shapes and everything as before, but now iterates thru each icon grouped shape and adds necessary shapesheet entries to each icon subshape and to the Main shape to mechanize Show/Hide of icon.  Right click Main shape and there's a toggle entry to show/hide the Icon.  Note, this is for regular grouped shape not a container shape.

Also, there are 4 shapes in the original file, see heavy border, that were already grouped.  The code assumes Main shape is just a simple shape with no grouping.

Visio 2019 Pro

maclarkson

The SDK, is this where you would recommend to develop addins, such as one that could filter or search for rows from linked data. and allow me to create new connected objects from it.

I looked at your code to change the line far out thats totally awesome.

whats strSpaicialRelation and vsoReturnedCode I could not figure out what these were?

wapperdude

Visio 2019 Pro

maclarkson

Do you reckon you'd have the skill to create a plugin? one that allows you to filter on your linked data, or one that allows you to add objects to a page and as you do it it automatically saves the objects in a database as a new row?