Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: Jennifer on October 24, 2014, 02:40:16 PM

Title: Error 339, Resulting shape is too complex
Post by: Jennifer on October 24, 2014, 02:40:16 PM
I am trying to create a shape that is a rectangle with rounded corners with lots of holes cut into it. The rectangle is 14 x 12 and the holes (circles) are in a 26 x 23 grid, so 138 holes in all. When I select the rectangle and the grid of holes and click on the Subtract operation, I get a progress popup that counts up to almost 600, then the error message saying that the shape is too complex.

Is there some way I can make this work? I could reduce the number of holes, but I'd rather not.

Why is it counting up to 600. There are only 139 shapes, 138 circles and one rectangle?

Correction: 26x23 = 598 (not 138). Not sure what I was thinking.  :o
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 24, 2014, 05:27:30 PM
I upgraded to Visio 2010 in the hope that it would work better -- apparently not. I get the same Error 339. I tried doing it row by row. I wold select the rectangle and then one or two rows of circles and then click Subtract. This worked until I had completed 7 rows, then I got the Error 339.

Is there no way to create a shape with a lot of little holes in it?
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 24, 2014, 06:31:10 PM
Hi Jennifer...

Looks like you found a limitation in Visio.  I was able to confirm the error.  The work around would be to fragment your large rectangle into 3 smaller rectangles.  Each smaller rectangle would have 1/3 of the total circles.  Then do your combine operation on each rectangle and it's pack of circles.  No, you cannot use the union operation to combine the rectangles. 

Visio doesn't actually create a rectangle with holes.  It creates a complex shape of multiple geometry sections:  the rectangle plus  holes then does, essentially, a logical subtract of the fill patterns.

Wapperdude
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 24, 2014, 08:20:48 PM
Quote from: wapperdude on October 24, 2014, 06:31:10 PM
Hi Jennifer...

Looks like you found a limitation in Visio.  I was able to confirm the error. 
Rats

Quote
The work around would be to fragment your large rectangle into 3 smaller rectangles.  Each smaller rectangle would have 1/3 of the total circles.  Then do your combine operation on each rectangle and it's pack of circles.  No, you cannot use the union operation to combine the rectangles. 
This is a real pain. The rectangle has rounded corners. So this means that I will have to create two half rounded rectangles for the top and bottom. (sigh)

Quote
Visio doesn't actually create a rectangle with holes.  It creates a complex shape of multiple geometry sections:  the rectangle plus  holes then does, essentially, a logical subtract of the fill patterns.

Wapperdude
OK, but if Visio can create the same final shape as a result of the complicated procedure above, it seems like it ought to be able do it directly. (grumble, grumble)
Title: Re: Error 339, Resulting shape is too complex
Post by: JuneTheSecond on October 25, 2014, 10:24:16 AM
How would you like to add many Geometry Sections to one shape sheet with VBA program?
But I am sorry I don't remember how much geometry sections can be added to one shape sheet.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 25, 2014, 10:37:57 AM
Quote from: JuneTheSecond on October 25, 2014, 10:24:16 AM
How would you like to add many Geometry Sections to one shape sheet with VBA program?
But I am sorry I don't remember how much geometry sections can be added to one shape sheet.
Sure, anything that works. But why would it be possible to add more shapes using VBA than using the Subtract operation?
Title: Re: Error 339, Resulting shape is too complex
Post by: JuneTheSecond on October 25, 2014, 10:55:05 AM
I am imaging a shape that has many holes.
Am I miss understanding?
Anyway the operation like Subtract, Join or Compose makes one shape from many shapes you select.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 25, 2014, 11:33:20 AM
Yes. I've attached the Visio (2010) document with the shape I am trying to create.
Title: Re: Error 339, Resulting shape is too complex
Post by: Paul Herber on October 25, 2014, 12:01:36 PM
There are (as far as I can tell) built-in limits with geometry sections.
First the technical side: geometry sections are stored internally with indices visSectionFirstComponent to visSectionLastComponent. These take the values 0x0A and 0xEF (or in decimal, 10 and 239.

So it looks like there can be only 230 geometry sections within one shape. It could be this limit that is being reached with the subtract operation.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 25, 2014, 12:32:40 PM
Quote from: Paul Herber on October 25, 2014, 12:01:36 PM
There are (as far as I can tell) built-in limits with geometry sections.
First the technical side: geometry sections are stored internally with indices visSectionFirstComponent to visSectionLastComponent. These take the values 0x0A and 0xEF (or in decimal, 10 and 239.

So it looks like there can be only 230 geometry sections within one shape. It could be this limit that is being reached with the subtract operation.
The "230" fits the data. I have 23 rows of circles with 26 circles in each row. I was able to subtract 8 rows (208 circles) plus 21 circles from row 9. And 208+21 = 229, so with the large rectangle, that's 230 shapes.

It seems to me that there ought to be a way to create a shape with a large number of holes. But I'm finished with this project and probably won't run into this problem again.

Thanks for the help.
Title: Re: Error 339, Resulting shape is too complex
Post by: JuneTheSecond on October 26, 2014, 12:52:41 AM
Visio Guy has written important note on Facebook in September 22.
"Pushing the ShapeSheet to its limits: 15,000 Geometry rows!"
at https://www.facebook.com/visguyfb

Here is still possibility.

Figure and drawaing below have only 4 holes,
but it may be possible to add  15000/5 = 3000 holes.
This drawing has only 2 Geometry sections, one for large rectangle,  one for holes.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 26, 2014, 01:13:36 AM
Quote from: JuneTheSecond on October 26, 2014, 12:52:41 AM
Figure and drawaing below have only 4 holes,
but it may be possible to add  15000/5 = 3000 holes.
This drawing has only 2 Geometry sections, one for large rectangle,  one for holes.
OK, but how was it done? I downloaded the file, but I don't understand the shapesheet stuff.

I tried making a Union of the holes before doing the Subtract, but I got the same error 339.
Title: Re: Error 339, Resulting shape is too complex
Post by: JuneTheSecond on October 26, 2014, 03:30:23 AM
Here is a video how I was making holes on a shape.
http://youtu.be/UhItBlBC_LI

I was editing shape sheet directly.

Further working is very hard.
Any programing may be necessary.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 26, 2014, 04:36:41 AM
Quote from: JuneTheSecond on October 26, 2014, 03:30:23 AM
Here is a video how I was making holes on a shape.
http://youtu.be/UhItBlBC_LI

I was editing shape sheet directly.

Further working is very hard.
Any programing may be necessary.
That is very cool. That's way too advanced for me. I don't think I am anywhere nearly smart enough to learn to do that. My hat's off to you.

Thanks for the effort.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 26, 2014, 06:52:13 AM
@Junichi, pretty clever. Chapeau!

Next step could be to write a new fragment routine.
Something like:
from here there are 2 possibilities
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 26, 2014, 07:52:25 AM
Quotebut it may be possible to add  15000/5 = 3000 holes.
Round holes are drilling easier. You can make 5000 round holes.
Much more holes!  ;)
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 26, 2014, 05:26:31 PM
@croc:  not sure I understand what you mean.  Tried round holes using normal shape operations (combine or subtract) and ran into the limit, as explained by Paul.

@Junichi:  agree with Yacine, very clever.  Looks like it would get around the limitation.  But, this process is very tedious to implement, especially for many, many holes.  Needs some code to automatically add the holes.  (I'm not suggesting that such code be written, as Jennifer has indicated that the need has come and gone.) 

Circular holes require fewer line entries, but must use two lines, elipticalarcto, to make a complete circle.  That is, a total of 3 lines per circle when the moveto line is included.  (Using the ellipse row type only allows a single line entry per geometry function.) 

Wapperdude
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 26, 2014, 06:46:03 PM
so why dont you make a smaller rectangle with say 20 holes....do the subtract / union / whatever...then us the resulting shape say 10
times....they either subtract/union/whatever....or....just group them and make group first in format.

FWIW....using the group method, I have not seen limitations on complex shapes (complex as in "not enough memory to
copy / paste into powerpoint"...have to use bitmap for that....so not talking about trival shapes).
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 26, 2014, 08:32:33 PM
A small example...
Macro "ttt" in file "Holes.vsd" draws 1000 holes. Number of holes depend on constants MaxHigh = 10 and MaxWidth = 100.
There are some problems with transparency. I still do not understand what the problem is.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 26, 2014, 08:38:10 PM
Quote@croc:  not sure I understand what you mean.
wapperdude, I just wanted to say that for the circle requires fewer rows than for the square (3 instead of 5). Nothing important.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 26, 2014, 09:07:48 PM
Fair enough. I withdraw my appreciation from Junichi and give it to you.
You were first ;) .
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 27, 2014, 04:25:38 AM
@Yacine:  Wait!  What ???  You can't do that.  :o  That means I'd have to withdraw my agreeing with you.   ;D  Oh bother Christopher Robin.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 27, 2014, 04:49:52 AM
But I drew a bad holes  :(
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 27, 2014, 04:08:22 PM
The process of drilling the bad holes looks like this (step by step). (Animated GIF).
But I picked the correct drill. In one section Geometry should placed only one row of holes. Then they are displayed without debris.
Example is placed in new file Holes.vsd.
Macro AllLinesOneSection puts all the holes in one section. The result looks bad.
Macro OneLineOneSection makes a lot of sections Geometry. One section for each line of holes. The result is significantly better.
Macros can be run one after the other, since the previous result is discarded.
Title: Re: Error 339, Resulting shape is too complex
Post by: JuneTheSecond on October 28, 2014, 05:10:08 AM
I think you can avoid this problem by adding 2 lines of Moveto to return to certain point.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 28, 2014, 04:10:03 PM
Yes!!
Flash of inspiration of grand master?!
Two spells for fixing bug of  Microsoft  ;)
More. For each row of holes is needed 2 spells.
The picture shows the sequence of their usage.
----
I put the latest version Holes.vsd in the dropbox. https://www.dropbox.com/s/bpk8xsaudp7418i/Holes.vsd?dl=0
Older versions will try to remove from the topic.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 29, 2014, 04:00:05 PM
Sorry. I was wrong.
It was found that even small deviations from the line are also violate the image. Figure shows this.
Rule "for each row of holes is needed 2 spells" is a mistake.
More accurate is another rule: If "Geometry" section has some MoveTo (some holes), then end of section need have a snap back through all MoveTo. Otherwise, there may be problems with filling.
"Geometry" section must be constructed as follows:
MoveTo 1, LineTo, LineTo...
  MoveTo 2, LineTo, LineTo...
    MoveTo 3, LineTo, LineTo...
    MoveTo 3
  MoveTo 2
MoveTo 1

This construction works properly in one section and in several sections.
The file with the program in DropBox was updated.
---
This behavior should not be considered as a bug in Visio. The Problem has the normal solution. The only bad thing that I have not seen this in the documents.
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 29, 2014, 06:17:00 PM
I dont know guys....
I think you would be better using a combination of smaller subsets (say 100 holes) and groups (say 10 subsets in group)

Below has 4000+ circles...all shapes (circles==>column==>10 col==> etc etc etc = group)....did it in 5 min
Certainly trivial to wrap a rectangle around column of 30....do the union/join/whatever....then use that 10==>100==>1000 times

Looks like you guys are spending more time debating/debugging this thing than it would take to muscle.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 29, 2014, 07:06:21 PM
Quote from: vojo on October 29, 2014, 06:17:00 PM
I dont know guys....
I think you would be better using a combination of smaller subsets (say 100 holes) and groups (say 10 subsets in group)

Below has 4000+ circles...all shapes (circles==>column==>10 col==> etc etc etc = group)....did it in 5 min
Certainly trivial to wrap a rectangle around column of 30....do the union/join/whatever....then use that 10==>100==>1000 times
In your combo shape, are the "holes" really holes? That is, if I put another shape behind the combo shape, will it show through the holes? That's what I am trying to accomplish. I tried downloading your image and then importing it into Visio. The holes were opaque.

I've attached a sample document showing what I tried to do and where I ran into the 339 error.

QuoteLooks like you guys are spending more time debating/debugging this thing than it would take to muscle.
Hey, what's the fun of doing something the practical way, when there is an obsessive-compulsive way to do it?  ::)

Never let the practical be the enemy of the excessive.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 29, 2014, 07:08:59 PM
@Vojo,
That's a pure academic problem.
It makes no sence to debate about the purpose (specially as Jennifer has already written, that she solved the problem for herself).
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 29, 2014, 07:27:02 PM
oh ok...

4000 actual bona fide holes (note the yellow, red, blue behind it)
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 29, 2014, 07:37:52 PM
Jennifer, this is what you want?
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 29, 2014, 07:41:00 PM
Quote from: vojo on October 29, 2014, 07:27:02 PM
oh ok...

4000 actual bona fide holes (note the yellow, red, blue behind it)
Cool. So what's the procedure? Do you break the problem down into pieces that involve fewer than 230 elements, then just group them to make the larger shape? If so, in my case, since I have rounded corners, I need to slice the large shape into three pieces so I have a top, a middle (which I can replicate) and a bottom.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 29, 2014, 07:42:39 PM
Quote from: Croc on October 29, 2014, 07:37:52 PM
This is what you want?
Exactly. How did you do it?
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 29, 2014, 07:49:03 PM
With macro in file Holes.vsd in the dropbox. https://www.dropbox.com/s/bpk8xsaudp7418i/Holes.vsd?dl=0
You need only to correct it a bit.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 29, 2014, 08:19:25 PM
Quote from: Croc on October 29, 2014, 07:49:03 PM
With macro in file Holes.vsd in the dropbox. https://www.dropbox.com/s/bpk8xsaudp7418i/Holes.vsd?dl=0
You need only to correct it a bit.
Спасибо (Did I get that right?)

I'll need some time to figure out what you did.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 30, 2014, 04:54:24 AM
Hi Jennifer, you said you found already a solution, so I did not submit my idea earlier.
Here's a trivial yet effective way for solving your problem.
Use a fill pattern.
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 30, 2014, 05:16:32 AM
Sweet!  First Prize.   :D

That is really simple and elegant.  Just edit and size one square with circular cutout.  Scale the fill pattern.  Done.

Wapperdude

Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 30, 2014, 05:04:48 PM
JuneTheSecond, we are not the first now :(
But Idea was so beautiful...
Is it possible do like this using fillpattern...
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 30, 2014, 05:30:37 PM
Yacine wrote:
QuoteNext step could be to write a new fragment routine.
Something like:
•chose the primary shape
•then select all the shapes that need to be deducted from the base
from here there are 2 possibilities...
There is alpha version. With restrictions. (The circle can be only special - ArcTo+ArcTo.)
SuperSubtract.vsd in https://www.dropbox.com/s/j0io053nxob6928/SuperSubtract.vsd?dl=0
Select all as needed and SuperSubtract.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 30, 2014, 06:42:13 PM
1) Croc, you did a nice job. (Хорошая работа)
You need however to set the geometry.NoFill to true to see the holes

2) Complex shapes? Of course.
In the VSD I had to remove Mona Lisa she is too fat for upload. (several hundred geometry rows)
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 30, 2014, 07:41:43 PM
Hmmmm.   Probably owe everyone an apology...sorry.

@Croc, JuneTheSecond:  solutions do a nice job of directly attacking the problem.   

It's nice to see the variety of approaches.

Wapperdude
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 30, 2014, 07:56:11 PM
I joked!!!
Probably poorly? Sorry.
The solution with fill pattern is nice shot. I like it.
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 30, 2014, 08:54:32 PM
I understood your humor  :) , I just felt my comment wasn't the best   ::) . 

Wapperdude
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 30, 2014, 09:26:02 PM
@Wayne,
in my opinion we "regulars" provide so much help, that we got the right to make the one or the other joke.
It's not only legitime, I think even that it provides a "relaxed" atmosphere.
I at least enjoy it. Stay as you are.

And YES, I'm #1!  ;D ;D ;D
(well, till next upload from Croc or Junichi  :( )

@Junichi and Croc,
I'd feel very sorry if you interrupt your work because of my solution.
I did really enjoy your work and look forward to see more.

Cheers,
Yacine
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 30, 2014, 11:02:12 PM
so...since we all are having fun....this what this knuckle dragging mouth breather did  ;-)

1.  Laid out a column of 20 holes...fill = empty
2.  Placed a rectangle behind them
3.  Use shape operations (I think it was union)
4.  copied resulting shape numerous times and grouped
5   scaled down the group as necessary in order to fit the sheet
6.  copied group numerous times and grouped

then added red/blue/yellow rectangles and placed behind final group

Time duration = < 10 min

I only did this because, as a general rule, I try to stay away from VBA for security reasons.
(not all users will or are able to enable macros).

Us troglodytes applaud the cloud people's more sophisticated efforts ;-)    Yes obscure Star Trek original reference
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on October 31, 2014, 01:14:48 AM
Original Star Trek, 1969.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 31, 2014, 07:09:56 AM
Quote from: wapperdude on October 31, 2014, 01:14:48 AM
Original Star Trek, 1969.

You guys might find the sitcom "Big Bang Theory" entertaining.  ;)
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 31, 2014, 07:14:20 AM
I want to thank everyone who contributed to this thread. It was almost amazing as Madison Bumgarner in Game 7 of the World Series.  :)

I don't understand most of what you were discussing and I don't have time to study it right now, but I've saved most of it so I can come back to it if I need it again.

Again, thanks for and entertaining and inspiring thread. You guys are very talented.

A big hug to one and all. This is one of the best forums ever.
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 31, 2014, 01:29:16 PM
Jennifer  RE Star Trek:  "ya think"

So you might find this amusing:  In college, in Engineering...my class has 250 students...20 women.
When ever a woman was in one of our classes, we would see the real world physical phenomena of a Black Hole
No matter where she sat, all the guys would sit as close to her as possible...room could have 100 chairs and 20 students for the class
All 20 students would be around her leaving the rest of the chairs empty

hence "the black hole effect"
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 31, 2014, 01:31:00 PM
"black hole effect" as in the intense gravitational field exerted by the women on all the surrounding men...aka guys pulled into a tight
"orbit" around her chair.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 31, 2014, 01:37:02 PM
Quote from: vojo on October 31, 2014, 01:29:16 PM
Jennifer  RE Star Trek:  "ya think"

So you might find this amusing:  In college, in Engineering...my class has 250 students...20 women.
When ever a woman was in one of our classes, we would see the real world physical phenomena of a Black Hole
No matter where she sat, all the guys would sit as close to her as possible...room could have 100 chairs and 20 students for the class
All 20 students would be around her leaving the rest of the chairs empty
When I was an undergrad, it was much more lopsided than that -- but that was probably before you were born. Most engineering classes had no women at all.

Quotehence "the black hole effect"
Er, uh, ... Hmmmm...
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 31, 2014, 01:39:09 PM
Quote from: vojo on October 31, 2014, 01:31:00 PM
"black hole effect" as in the intense gravitational field exerted by the women on all the surrounding men...aka guys pulled into a tight
"orbit" around her chair.
Aha! I'm glad you clarified that...'cause there were other less flattering interpretations  :-X
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on October 31, 2014, 02:18:13 PM
Wow....well... Penn State Electrical Engineering class of 1984
Sorry for any confusion on intent...even at the time, being a real nerdfest, I dont recall any disparaging connotation ever remarked.
It was always about how the nerds wanted to be near the rare woman in the class.   Sort of like Howard always scheming to meet women
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on October 31, 2014, 02:47:13 PM
Quote from: vojo on October 31, 2014, 02:18:13 PM
Wow....well... Penn State Electrical Engineering class of 1984
OK, so maybe you were born, but still in grade school.  ;)
QuoteSorry for any confusion on intent...even at the time, being a real nerdfest, I don't recall any disparaging connotation ever remarked.
It was always about how the nerds wanted to be near the rare woman in the class.
Yes, I was joking. Anyway, nerds are my favorite people. They are quirky, but basically decent and honest.
QuoteSort of like Howard always scheming to meet women
They are all scheming, but he's the creepy one. That's the one part of that show that I really don't like.
Title: Re: Error 339, Resulting shape is too complex
Post by: 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
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 31, 2014, 07:52:38 PM
There are still those ugly artifacts.
Fillings go to random points.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 31, 2014, 08:07:21 PM
With simple shape should work fine.
Can you put an example?
I want to be limited only to simple shape. Rectangle, circle, triangle.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 31, 2014, 09:18:33 PM
.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on October 31, 2014, 09:31:03 PM
Thank you!
---
A freeform tool is too difficult. It is not drawn itself and corrupts all around.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on October 31, 2014, 10:12:10 PM
Simple shapes are also not yet without problems.  ;)
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on November 01, 2014, 12:40:58 AM
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:
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?
Title: Re: Error 339, Resulting shape is too complex
Post by: 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.
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.
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on November 01, 2014, 10:30:53 AM
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.
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on November 01, 2014, 03:27:02 PM
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?
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on November 01, 2014, 06:28:32 PM
I made this video using UVScreenCamera. http://www.uvsoftium.ru/
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on November 01, 2014, 06:35:48 PM
QuoteSimple shapes are also not yet without problems.
Yacine, now I do not know the reason. I need to think.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on November 01, 2014, 06:51:07 PM
Thinking is good.  ;D
Title: Re: Error 339, Resulting shape is too complex
Post by: Croc on November 01, 2014, 07:54:32 PM
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.
Title: Re: Error 339, Resulting shape is too complex
Post by: Yacine on November 01, 2014, 08:18:39 PM
Works fine! Good Job.
Even with big numbers.
Title: Re: Error 339, Resulting shape is too complex
Post by: vojo on November 02, 2014, 05:04:16 PM
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.   
Title: Re: Error 339, Resulting shape is too complex
Post by: Jennifer on November 03, 2014, 04:15:50 AM
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.
Title: Re: Error 339, Resulting shape is too complex
Post by: wapperdude on November 03, 2014, 04:35:02 AM
There's probably been enough words.

wapperdude