News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Error 339, Resulting shape is too complex

Started by Jennifer, October 24, 2014, 02:40:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

Simple shapes are also not yet without problems.  ;)
Yacine

Jennifer

Quote from: Croc on October 31, 2014, 07:09:32 PM
Utility for subtracting was updated. Available for using.
https://www.dropbox.com/s/j0io053nxob6928/SuperSubtract.vsd?dl=0
I can't get it to work. Here's what I did:

  • Downloaded SuperSubtract.vsd and opened it.
  • I got a Security Warning message saying that "Macros have been disabled" and a button labeled "Enable Content". (Odd message, that. Shouldn't it be "Enable Macros"?)
  • Click on that button. The screen blinks and the warning message goes away, no other message.
  • Add a new page and copy my shape with all the 598 circles.
  • Select the large shape, then Shift-Select the holes.
  • Click on Developer | Macros.
  • ThisDocument.SuperSubtract is highlighted.
  • Click Run.
Nothing happens. The holes are not punched.

I open the VBA IDE (Alt+F11) and find the macro. I set a breakpoint on the Sub statement, then select all (Ctrl+A) and rerun the macro. I get the breakpoint. I step through to the "For Each sh In ActiveWindow.Selection" statement, which loops many times, so I set another breakpoint on the next line and press F5 to continue. It stops on the next line.

When I get to the "For i = 1 To WorkSel.Count" line, I check the value of "WorkSel.Count". It's 599, which is correct (598 circles plus the rectangle).

There are a couple more loops to WorkSel.Count, which I skip past. When it ends, same result. No holes. I also set a breakpoint on the AddHoles sub and it got executed a bunch of times (probably 599).

Am I doing something wrong?
Using Visio 2019, part of Office 365 on Windows 10

Croc

QuoteAm I doing something wrong?
Yes.  :(
Jennifer, I am very, very sorry that you had to spend so much time.
Programmers say - if the user can do something differently than planned programmer, he will definitely do it.
I had to make a detailed description. But my very bad english does not allow to do it.
I made the film with the solution of your problem. It lasts for 3 minutes. The film is in the folder forJennifer - https://www.dropbox.com/sh/5ifc1eykpjw2ywd/AADUU2EHXaV2rhgZLcQa3g0Ya?dl=0 . Look at it.
There also is a file SuperSubtract +++ Stand_1.vsd with the finished result.
If to work on the first page, you can run the macro easier. Just click on the button.

Croc

QuoteNothing happens. The holes are not punched.
Nothing happened, because the circles in your drawing contain EllipticalArcTo. Stupid program does not work with these rows. It loves the ArcTo or Ellipse. Special ellipses where width = height.
Also it understands MoveTo and LineTo.
One would teach her to work with other strings. But it need?!
This program will useful for 4 users 3 times in their lives. And all. The rest will make regular functions of Visio.

Jennifer

Quote from: Croc on November 01, 2014, 10:03:19 AM
QuoteAm I doing something wrong?
Yes.  :(
Jennifer, I am very, very sorry that you had to spend so much time.
Are you kidding? The little bit of time I spent was nothing compared to what you must have spent writing that macro. I'm very grateful for you efforts.

Quote
Programmers say - if the user can do something differently than planned programmer, he will definitely do it.
Over here we say - It's impossible to make software idiot-proof because idiots are so clever.  ;)

Quote
I had to make a detailed description. But my very bad english does not allow to do it.
Your English is a million times better than my Russian.

Quote
I made the film with the solution of your problem. It lasts for 3 minutes. The film is in the folder forJennifer - https://www.dropbox.com/sh/5ifc1eykpjw2ywd/AADUU2EHXaV2rhgZLcQa3g0Ya?dl=0 . Look at it.
There also is a file SuperSubtract +++ Stand_1.vsd with the finished result.
If to work on the first page, you can run the macro easier. Just click on the button.
OK, I watched the video. I tried to follow it using ellipses rather than circles, but I got the same result -- no holes.

I agree with you that spending more time on this is probably not worth it. I'm not sure that it would only be useful for 4 users, 3 times in their lives. I think it would be a useful addition to some add-on collection if someone wanted to spend the time to clean it up and make it bullet proof.

I don't have any more time to spend on it right now. I got around my original problem by just making do without holes. I posted the question because I wondered if there was an easy way that I was not aware of. Apparently not.

I did learn something very valuable from your video. I wasn't aware of the Array Shapes add-on in Visio Extras. That's one that I will definitely use. So thanks for that.

I downloaded the video and the Visio document. I'll study it and your macro when I have more time.

I really, really appreciate all the time and effort you put into this. Thank you very much.

You have a real talent. Maybe you should create an Visio add-on package. I'll volunteer to be a tester.  :D

BTW: How did you make that video?
Using Visio 2019, part of Office 365 on Windows 10

Croc


Croc

QuoteSimple shapes are also not yet without problems.
Yacine, now I do not know the reason. I need to think.

Yacine

Yacine

Croc

Yacine, I found a rough programming error. At 1 in the cycle counter. Macro was updated. (https://www.dropbox.com/s/j0io053nxob6928/SuperSubtract.vsd?dl=0)
Maybe it was the last mistake? All programmers are hoping for this :)
Thanks for your assistance.

Yacine

Works fine! Good Job.
Even with big numbers.
Yacine

vojo

Jennifer....dont take howard so seriously...if his intent was nefarious, he wouldnt put himself in such vulnerable situations (roller skating like a disco queen - yea like women would really like bright pink pants, going to a goth bar with fake tattoes - yea like even if he did score, the fake tattoes would ruin his chances, commenting to Penny "who is looking good now???" when Kripke shows up, etc).

You would be surprised at some of the crazy stupid things guys will try to meet women.   

Jennifer

Quote from: vojo on November 02, 2014, 05:04:16 PM
Jennifer....don't take Howard so seriously...if his intent was nefarious, he wouldn't put himself in such vulnerable situations (roller skating like a disco queen - yea like women would really like bright pink pants, going to a goth bar with fake tattoos - yea like even if he did score, the fake tattoos would ruin his chances, commenting to Penny "who is looking good now???" when Kripke shows up, etc).
I didn't say he was nefarious. I said he was creepy. He does those stupid things because he's about 12-14 emotionally. He still lives with his mother and is obsessed with immature sexuality. He has no social skills, no impulse control, and no ability to channel his urges in appropriate ways. The show tries to make him somewhat sympathetic because of the story of his father leaving him and his mother, but that and worse has happened to thousands, if not millions, of boys who still managed to grow up.

The one I cannot figure out is Bernadette.

But it's a sitcom, so all of the characters are burlesques.

QuoteYou would be surprised at some of the crazy stupid things guys will try to meet women.
Only adolescent guys. And I doubt many people would be surprised.

But we are way off topic here, so we should control our impulses.  :P I'll let you have the last word.
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

There's probably been enough words.

wapperdude
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 427 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1274KB.
Tokens: post-login.
Cache hits: 14: 0.00261s for 26,741 bytes (show)
Cache misses: 4: (show)
Queries used: 17.

[Show Queries]