It all becomes transparent…..

Happy New Year!!! So here is my first post of 2008 – I did intend to post a few times over the festive period but got caught up in mince pies and sherry……But better late than never.

When AutoCAD Map 2007 was released with its new FDO (Feature Data Object) engine I found the transparency functionality and thought – ‘excellent see-through data!’. There was a catch however, although it’s great for polygons, I have never been able to make raster data transparent – until now!!

Through some useful posts from the community on the AutoCAD Map discussion forum; and through some trial error, I can now make my raster images transparent. This is how to do it……..

Step 1 – Add the raster image to the DWG through FDO

Open the ‘Data Connect’ menu found on the ‘Display Manager’. Once in the editor, select ‘Add Raster Image or Surface Connection’, navigate to the file you wish to connect to and then tick the box and hit ‘Add to Map’.This will add your raster image connection to your DWG.

Before Insertion

 

After insertion

As you can see from the screen captures above, the image displays in the correct location as AutoCAD Map understands its associated ‘World File’. However it has been placed in front of the stadium design CAD data, hiding it.

Using the Display Manager I am able to manage the draw order of my data in Model Space and could force the image behind the CAD data. In future posts I will explain the tips for doing this. In this example however I want to make the image transparent.

Step 2 – Save a ‘Layer file’ for the image

A Layer file is an XML based file that you can export from AutoCAD Map for any FDO connection you have made in the Display Manager. Within the file it will save all the styling information and it also records the location of the data source e.g. Location on disk of the Raster Image file. Once the file has been created you can add saved Layer files into any AutoCAD Map DWG to re-use them – making it very easy to connect and style the data.

To create a Layer file for the raster image that has been connected simply right mouse click the layer on the Display Manager and select ‘Save Layer’

It will prompt you for a name and location to save the Layer file. 

Step 3 – Edit the Layer file to enable the transparency.

To make the image transparent you need to add a extra line to the Layer file. In Windows Explorer, navigate to the Layer file that has just been saved and open it in Notepad.

This is the data contained within a Layer file.

To add the transparency setting, find the line that defines the ‘FeatureName’. Its usually about 22 lines down in the file. 

It looks like this: 

FeatureName: <FeatureName>rasters:MyRasterImage</FeatureName>

Underneath this section on a new line add the following…..

<Opacity>0.6</Opacity>

0.5 being the degree of transparency – 0.1 is very transparent, 0.9 is not very transparent.

This is how your file should look:

Before Edit

  

After Edit

Once you are happy, save the notepad file.

Step 4 – Add the Layer file to AutoCAD Map DWG.

Now you have added the transparency in the Layer file you can add the Layer file to your DWG.

Turn off any other Raster Imagery in your DWG. From the Data button on the Display Manager select ‘Load Layer’ and point to your Layer file.

This will add the Raster Image to the Display Manager in the same way as doing a Data Connect would do, except this time the transparency should be activated.

You now can see the Stadium CAD data below the image.

Check back for more soon!

Advertisements

2 Responses to It all becomes transparent…..

  1. map3d says:

    Nice tip, one thing is make sure when you edit the layer file in notepad is to make sure you edit only the section in the article and when you save the file it stays as a layer file and not with a txt or xml file extendsion. BUT the great thing about this is you do mess up just delete the layer file and start over, the layer file does not have anything to do with the raster image but only the way MAP3D displays it.

  2. greigrichardson says:

    Thanks map3d thats a good point! Another good thing about layer files is they can be passed between Map 3d users so long as they all can see the original path to the data – in this case the path to the Raster File.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s