PRINT FROM AUTOCAD
- Decide on the desired background view extents in model space (the Model tab). For simplicity, choose even tens or hundreds for your corner coordinates. Note the corner coordinates of that view.
- In a Layout tab, create an mview with the corner coordinates from step 1. Zoom it in model space to the same coordinates, which puts the zoom factor of the viewport at 1
- Decide how many world units you want to print onto each image pixel. For simplicity, you probably will want to choose an even number and keep in mind that about 70 pixels make 1 inch of normal quality on-screen viewing, 150 pixels per inch is suitable for newspaper quality printing, and 300 ppi for magazine quality printing. For example, your view corner coordinates are 628000(x), 856900(y) to 630600(x), 858800(y). By subtracting the x's and the y's, you calculate view size is 2600(x), 1900(y). If you printed 100 units on every pixel, you would get a 26 pixel by 19 pixel image, which would not have near the required resolution. If you printed 10 units per pixel, you would get a 260x190 image, which would look good on-screen only as a 4" image. If you printed 1 unit per pixel, you get a 2600x1900 image, which would plot on-screen as large as 36 inches. You decide to use that even though it is on the big size, since it seems not too much larger than modern screen pixel sizes.
- Open the AutoCAD print dialog and choose the (Publish To Web) JPG (best for photographs) printer (HEC-RAS can't currently use PNG (best for line drawings)). Select the Properties button next to the printer. Select Custom Paper Sizes and Add or Edit a size with your resulting image size from step 3. Example: 2600 width, 1900 height. Close the properties, saving to the PC3 file.
- Select the paper size (image size) you just created. Print a Window using the corner coordinates from step 1. Change or note the name and location of the plotted image file AutoCAD creates. Check the finished plot by viewing it outside AutoCAD from Windows Explorer.
CREATE A WORLD FILE
ESRI created the World File format to provide a way to reference image files to world coordinates. HEC-RAS uses that format.
To create a world file format, you need to know how to create and edit plain text files in Windows Explorer (the files and folders view of Windows). This is easiest if you use ALT+T (Tools menu) > Folder Options > View tab and uncheck the "Hide extensions for known file types" option.
- Use File > New or Right-click New to create a new Text Document file in the same folder with the background image file you plotted from AutoCAD.
- Open the "New Text Document.txt". Inside it, type
- on line 1 the width of a pixel in world units,
- on line two 0 rotation,
- on line 3 0 rotation,
- on line 4 the NEGATIVE height of a pixel in world units,
- on line 5 the x-coordinate of the center of upper left pixel,
- and on line 6 the y-coordinate of the center of upper left pixel. Don't forget to calculate the CENTER coordinates of the upper left pixel.
- Our example file is given below this list. Save and exit the file.
- Change the world file name to match the name of the background image file, but with the extension changed to these three characters: the same first letter, the same last letter, and a "w". For example, map.jpg uses map.jgw, map.tif uses map.tfw, and map.png uses map.pgw.
1
0
0
-1
628000.5
858799.5
ADD BACKGROUND PICTURE
In the HEC-RAS Geometric Data window, follow this procedure from the HEC-RAS help file: Open the Geometric Data editor and create a New Geometry File. Add the background data by clicking on the Add Background Data button. If the image does not come in correctly, select the View, Set Schematic Plot Extents menu item and press the Set to Computed Plot Extents button in the Geometry Extents window. This will zoom out the bounds of the image.If you have any trouble, just leave a comment below.
19 comments:
It worked just well. Thanks for the help...i've been struggling to find a solution to this problem for over 3days
thank you so much for your help..i've been struggling to do this for over a week.
Thank u, man! U really help me with this blog!
Heh. Yeah. It works! I just visited in need for help myself at least 4 years later. Hurrah!
That was easy! Thank you some much, Tom
i got my picture of the river put into HEC-RAS but the picture is way smaller than my reaches. how do i make my picture bigger?
If you followed the instructions, your picture has "real world" scale and coordinates. The typical action after adding your background image would be to move your river reaches to match thalweg lines on your background image or to the approximate locations of rivers on your background image. If you do that and your reach distances between cross sections are proportionally correct, your cross sections should lie at approximately the right locations on your background image.
If you don't want to move your reaches for some good reason (though I can't fathom why), the way you move and scale your background image is to edit the world coordinates file.
Hi Tom -
Thanks for your advice - I did run into a problem.
The background does not appear in the geometry window when I bring it into an existing geometry file of the same coordinates.
When I create a new project, the aerial image I created comes right in - no problem. Then when I import my geometry data into this new file, the aerial image disappears again.. Any clues as to why this happens?
Sorry. This sounds like uncharted territory for me.
Tom, I have also run into a problem. I load the image as suggested, and it shows the correct coordinates, but all I see in the geometric data window is a white screen. I've tried changing the color on the image, and it doesn't do anything. I've tried this with both a USGS map, and an image printed from CAD. Thanks for any suggestions you might have!
1. When you look at the JPG file, it looks fine?
2. Can you paste here your JGW file contents?
Yes, when I open up the .jpg and .tif file, both look fine. JGW is (based on approximate coordinates from CAD)
1
0
0
-1
169403
3014401
TFW coordinate are (for world coordinates) -
2.54282863769913
0.00000000000000
0.00000000000000
-2.54282863769913
189001.27141431885000
917998.59803278185000
I am concerned that you have both a JPG and a TIF file. Which one do you want for your background image?
Either. The TIF wasn't working, which is why I then tried the JPG. I only have 1 loaded at a time.
I guess the jpg would be preferred. Should I be able to see the image in the geometry window? Or a different window? Do I need to save the file first? Any suggestions for what I could try (or why it is not showing up) would be great!
You should be able to see the image.
1. Try View, Set Schematic Plot Extents, Set to Computed Extents in the Geometry Editor.
I've tried that, and it still does not show up. Any other suggestions to try?
I suggest starting a new model with no geometry, and adding the background JPG before you draw the schematic. See if you can get it to work in a new model. If you want, you can send me your JPG file. Go to hawsedc.com and contact me.
Dude, you're lifesaver, thank you so much!!!
Post a Comment