AutoCAD Map and Topobase – FDO and WYSIWYG

One of the more difficult aspects of using Feature Data Objects (FDO) is the fact that all of the styles in the Display Manager are What You See is What You Get (WYSIWYG).  This is especially difficult to get used to when switching from a pure DWG system where you have the privilege of working with .CTB or .STB files when plotting.

One of the first problems with this is how to handle black and white sheets compared to color ones. For example, to create a sheet that plots in black and white, you would set the color of all the map layers to black.

Then when working in model space with a black background, you will find yourself unable to see any features stylized in black. If you were to change your background to gray, and had entities colored with the same gray, then they would disappear as well. This can lead to a lot of confusion.

There are a couple of solutions to this problem. One solution is to set the model space background to black and paper space to white (the classic AutoCAD settings). This means that for any drawing you are planning to plot in black and white, you would do all of your work in paper space. However, paper space is not always the easiest medium for everyone to draft in. If users are not comfortable with this, then maybe training is the way to approach this.

Alternatively, we can use OPTIONS to change the color of the background.

  1. Type OPtions in the command line
  2. On the Display tab.  Click Colors.
  3. Under Context, select 2D model space.
  4. For the Interface, select Uniform background.
  5. For the Color, select Black or White
  6. Remember to change the crosshair’s color too.

If you need a quicker way, you can use the command line to quickly change the background color between black and white. There are few lisp files around online that are good solutions.  You can download a C# .NET dll (for AutoCAD 2010 on Windows XP) to switch the background and crosshairs here. Load it using the NETLOAD command. To execute the command, type CHANGEBACKGROUND at the command line (CHANGEB then tab to autocomplete). If you need to modify it or for a different release of AutoCAD then you will need to recompile.

Here is a look at the code:

[sourcecode language=”csharp”]
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
// You must use COM to access the AutoCAD Preferences
// http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-43d3.htm,topicNumber=d0e8745
using Autodesk.AutoCAD.Interop;

namespace Autodesk.Custom
{
public class ChangeBackground
{
[CommandMethod("CHANGEBACKGROUND")]
public void ExecuteChangeBackground()
{
// Need the AutoCAD application (for Com)
IAcadApplication acadApp = (IAcadApplication) System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application");
// Use the com object to get the preferences object
AcadPreferences acPrefComObj = (AcadPreferences)acadApp.Preferences;

// White 16777215 = FFF in Hex
// Black 0

if (acPrefComObj.Display.GraphicsWinModelBackgrndColor == 0)
{
acPrefComObj.Display.GraphicsWinModelBackgrndColor = 16777215;
acPrefComObj.Display.ModelCrosshairColor = 0;
}
else
{
acPrefComObj.Display.GraphicsWinModelBackgrndColor = 0;
acPrefComObj.Display.ModelCrosshairColor = 16777215;
}

return;
}
}
}
[/sourcecode]

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *