Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: JuneTheSecond on June 09, 2010, 08:18:20 AM

Title: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 09, 2010, 08:18:20 AM
Because Yacine's solution to the "Can't fill simple CAD shape" is very cool,
I've completely copied his steps into a macro.
This macro simply follows his steps, but never automates the steps.
But you can really fill the shape that is uploaded at the thread,
if you have the patience to follow the long sequence of dialogs,
pressing Yes button or No button.
The essence of Yacine's solution is a set of "Trim and Join".
And I am sorry I did not checked whether this macro can fill any other CAD shape.
Detailed description is written on the drawing.
URL of "Can't fill simple CAD shape" is
http://visguy.com/vgforum/index.php?topic=1812.0

Title: Re: Fill Color Imported CAD Shape
Post by: Yacine on June 09, 2010, 05:57:27 PM
Thank you for the flowers Sensei.
Your solution is much cooler. 8) Very cool and helpful.

However, since you feel challenged by the issue, I thought I could give some more input.
If you watch the shapesheet of the original shape you will notice some oddities:
- moveto rows following each other
- moveto rows at the end of a geometry section

Would it help to just remove these oddities and do the normal operations afterward - trim, join and fill ?
Title: Re: Fill Color Imported CAD Shape
Post by: Yacine on June 09, 2010, 07:13:46 PM
@David,
can you send us more CAD "crap", so we can analyse it and "may be" work out a better solution?
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 10, 2010, 07:33:32 AM
As far as Master.2, all oddies are removed when you trim the dropped shape.
All trimed fragments seems automatically converted to normal shapes.  
Really nice power of "Trim"! ;) ;) ;) ;)
Title: Re: Fill Color Imported CAD Shape
Post by: Yacine on June 10, 2010, 09:23:39 PM
I guess I was not clear enough, sorry.
I wanted to say, that if the odd lines, were removed by macro prior to any trimming, may we would not need additional steps.

Now, I tried it, by removing manually the odd rows ... and it did not work.

2nd approach: would a macro that unifies all the geometry sections, be able to setup a propper shape?
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 11, 2010, 01:10:48 AM
The reason of two stages is that this is just my first study.
It may be possible to remove first stage  to delete simple lines or integrate two stages  into one.
Simple step might reduce users' job. :) :) :)
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 11, 2010, 01:44:20 AM
I tried to make more simple macro, but failed.
The ide was to duplicate the dropped down shape directly,
and trim the overlayed 2 shapes.
You can delete all odd lines directly.
But when you join once or twice all fragments into one,
some parts deleted unexpectedly.  ??? ??? ???
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 15, 2010, 06:43:45 AM
Here is another macro after study about "Fragments and Union" at
http://visguy.com/vgforum/index.php?topic=1812.msg8270;topicseen#msg8270
How would you like this macro?
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 18, 2010, 08:31:15 AM
Above macro has problems.
1. The fragments inside the curves are often corrupted.
2. The holes in the shape are filled.

To solve 1, you need repeat "Join and Fragment" to each pair of touching fragment in multiple times hopefully more than 2 or 3 times or more.
To solve 2, you need to delete all fragments in the holes before final "Union" .

Next macro is such one that takes in these steps.
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 18, 2010, 08:33:53 AM
Additional images with explanation.
Title: Re: Fill Color Imported CAD Shape
Post by: JuneTheSecond on June 18, 2010, 08:41:03 AM
If shape is simple and has no hole, operation on this macro are simple and easy.
If shape is more complicated and have holes, you need to be more carefull.
Very offten you need to increase the number of repeat of "Join and Fragment" with spin button on the dialog.