may I take your order?1 Jul, 2003 By: Bill Fane
It was a clear, crisp Friday afternoon. Captain LearnCurve and his gorgeous wife played hooky, sneaking up to Whistler for a pleasant day of skiing. Before the drive back to town, they stopped in the village for a coffee, where their children and grandchildren greeted them with "Surprise! Happy birthday! We've rented a couple of condo units, and everyone is staying over for a weekend of skiing!" And so Grandpa LearnCurve spent his 60th birthday taking the double black diamond runs at Whistler.
When he returned home on Monday, he opened an e-mail from reader Bill Stewart, who asked: "Can I fill an area on a map and have that fill color be translucent so that I can see the mapping through the color?"
There is a simple solution to this problem that can be done as far back as AutoCAD Release 14. It's based on the Draworder command. In fact, the solution has applications beyond the problem at hand. Read on to find out how you can use Draworder to its full advantage.
WHO'S ON TOP?
Let's begin with a bit of background information. Like most CAD software, AutoCAD is a chronological program. This means that objects
Figure 1. I applied the hatching after I drew the lines.
In figure 1, I drew a simple black rectangle and the two lines, and then added the red hatch pattern. To emphasize the problem, I set the lineweights a bit wider. Notice how the ends of the hatch lines sit on top of the rectangle and cut across the two black lines. This is not only distracting on screen, but is often how it plots on a color printer.
BUT WAIT-IT GETS WORSE
Now let's edit the hatch pattern and turn it into a solid-filled version. Oops! Half the frame lineweight disappears, as does one entire line and a portion of the other, as shown in figure 2. The younger solid-filled hatch covers them. The real problem is that the drawing plots this way-the covered objects disappear behind the solid-filled hatching. Luckily, there is a clever fix.
GET THEE BEHIND ME
First, let's go back to the standard hatch pattern in figure 1. Select Tools | Display Order | Send To Back to start the Draworder
Figure 3. Using the Draworder button on the Modify II toolbar, I moved the hatching in figure 1 behind the rest of the image.
Select the hatching, then press <Enter>. Magic! The hatching is now behind everything else and plots accordingly. Figure 3 shows the results.
You can use the same process on the solid-filled hatching in figure 2 to produce figure 4.
AUTOCAD, WE HAVE A PROBLEM
Uh-oh! If we try to plot figure 4 on a monochrome printer, we end up with a black blob. Once again the line and line segment vanish under the solid-filled hatch, even though the hatch is on the bottom. The problem is that black on black is still black. I could have inserted a screen shot here, but I think you get the picture.
Once again, there is a simple solution. (Rule number 1 is to never come up with a problem unless you already have the solution.) First, choose a color for your solid-filled hatching and use it only for this purpose. Although my example appears red, AutoCAD color #1, it's actually color #10. You can change the hatch object properties to apply the desired color, but a better approach is to put all solid hatching, filled with the color of your choice, on a unique layer.
Now start the Plot command. On the Plot Device tab of the Plot dialog box, select a Plot Style Table (pen assignments) from the scroll list. Although I draw in color, I plot to a laser printer, so I use the monochrome color table.
Now click on Edit. When the dialog box in figure 5 comes up, click on the color you chose for the filled area (red #10 in my example).
Figure 5. After selecting a color and assigning it specifically to solid hatching, I saved it in the Plot dialog box.
In the Properties window, set Screening to 20%. Click on Save and then Close. You may want to select Save As to create a new style rather than write over the standard one. This operation needs to be done only once, because all future plots that use this style table will plot color red #10 as a 20% screen.
TWO WRONGS MIGHT MAKE A RIGHT
Figure 6. With a little bit of tinkering, I made hatching appear to be a translucent layer on top of the objects beneath.
Note that the Draworder command does more than just move an object or objects to the back of the stack. You can also bring one or more to the front, or place a set of objects above or below another. Note that if you move more than one object, their relative orders within the selection set are maintained.
Another point to keep in mind is that the order is set when you run the command. If you move something to the front and then draw over it, the new item becomes the front item. This also occurs when you alter the boundary of an associative hatch region. The hatch is recreated and moves back to the top.
You can still use this shading method if you use Named Plot Styles instead of the default color style (pen assignment) method. You can create a specific "20% shade" style and apply it to specific objects, independently of their color. You must create the original
Figure 7. To stop the raster image from blocking the screened hatching, I used a Dots hatch pattern on the area of interest and then placed it in front of the raster image.
When I sent all this off to Bill Stewart, he wrote back: "Thanks, but it doesn't work for what I'm doing. I want to apply a translucent shading over part of a scanned raster image imported into AutoCAD. The problem is that the raster image appears to be a solid object, so it blocks the screened hatching."
No problem. Simply hatch the desired area with a Dots hatch pattern and put it in front of the raster image. A bit of playing with the hatch scale and lineweight produces the desired effect (figure 7).
AND NOW FOR SOMETHING COMPLETELY DIFFERENT
If you are a scuba diver and do underwater photography, you need access to Adobe Photoshop. Water filters out reds and yellows, so your pictures come out with a decidedly blue-green tint (figure 8). Simply open the picture in Adobe Photoshop, then select Image | Adjustments | Auto Levels or press
Figure 8. Water tends to filter out reds and yellows, giving underwater photography a wan look.
Figure 9. After a little help from Adobe Photoshop, doesnt the image in figure 8 look much better?
In her easy-to-follow, friendly style, long-time Cadalyst contributing editor Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD Video Tips. Subscribe to the free Cadalyst Video Picks newsletter, and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!