Author Topic: Error 339, Resulting shape is too complex  (Read 37274 times)

0 Members and 1 Guest are viewing this topic.

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Error 339, Resulting shape is too complex
« on: October 24, 2014, 09:40:16 AM »
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
« Last Edit: October 25, 2014, 07:27:16 AM by Jennifer »
Using Visio 2019 Pro on Windows 10

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #1 on: October 24, 2014, 12: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?
Using Visio 2019 Pro on Windows 10

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3800
  • Ideas Visio-lized into solutions
Re: Error 339, Resulting shape is too complex
« Reply #2 on: October 24, 2014, 01: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
Visio 2019 Pro

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #3 on: October 24, 2014, 03:20:48 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)
Using Visio 2019 Pro on Windows 10

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Error 339, Resulting shape is too complex
« Reply #4 on: October 25, 2014, 05: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.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #5 on: October 25, 2014, 05:37:57 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?
Using Visio 2019 Pro on Windows 10

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Error 339, Resulting shape is too complex
« Reply #6 on: October 25, 2014, 05: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.
« Last Edit: October 25, 2014, 06:02:21 AM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #7 on: October 25, 2014, 06:33:20 AM »
Yes. I've attached the Visio (2010) document with the shape I am trying to create.
Using Visio 2019 Pro on Windows 10

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2892
    • Paul Herber's website
Re: Error 339, Resulting shape is too complex
« Reply #8 on: October 25, 2014, 07:01:36 AM »
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.
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #9 on: October 25, 2014, 07:32:40 AM »
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.
Using Visio 2019 Pro on Windows 10

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Error 339, Resulting shape is too complex
« Reply #10 on: October 25, 2014, 07:52:41 PM »
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.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #11 on: October 25, 2014, 08:13:36 PM »
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.
Using Visio 2019 Pro on Windows 10

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: Error 339, Resulting shape is too complex
« Reply #12 on: October 25, 2014, 10:30:23 PM »
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.
« Last Edit: October 25, 2014, 11:23:33 PM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Jennifer

  • Sr. Member
  • ****
  • Posts: 399
Re: Error 339, Resulting shape is too complex
« Reply #13 on: October 25, 2014, 11:36:41 PM »
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.
Using Visio 2019 Pro on Windows 10

Yacine

  • Hero Member
  • *****
  • Posts: 2698
Re: Error 339, Resulting shape is too complex
« Reply #14 on: October 26, 2014, 01:52:13 AM »
@Junichi, pretty clever. Chapeau!

Next 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
  • 1) fragment the base with shapes from the selection one by one, then merge the geometry sections
  • 2) copy the geometry section of the shapes of the selection into the base shape.
« Last Edit: October 26, 2014, 02:10:36 AM by Yacine »
Yacine