Happy #MapInfoMonday,
Today we will look at how you can set the style for new objects when drawing these via the drawing tools in MapInfo Pro.
MapInfo Pro has the concept of a current style. This is the style that MapInfo Pro currently uses when you draw a new spatial object on the map. There is a current style for point, linear, closed, and textual objects. Before drawing a new spatial object, you should consider changing the current style to the style you want for your new object. This is useful if you are drawing many objects using this style. Alternatively, you can change the style of the spatial object after having drawn it.
You can also set a style to be used when drawing a new spatial object for a specific layer/table.
Setting a Style for a New Spatial Object
When you are creating a new spatial object by drawing it using one of the built-in drawing tools in MapInfo Pro, the object will be styled using the current style for this object type.
Before drawing the object, you can change the current style to the style you want to apply to the object.
From the Style dropdown on the Spatial tab, I select Line Style so that I can change the current line style.
In the Line Style dialog, I can now configure the line style I want to use for my new line feature.
Make sure that you haven't selected a record before accessing the Line Style dialog. If you do, you might end up changing the style of the selected feature if it has been selected from the editable layer.
And the polyline I now draw along Pebber Lane will use this line style.
You can also select one or more objects from the editable layer and change the style of these objects via the same control as you set the current style. Note that if the selected objects don't have the exact same style, you may see the word "Mixed" in some of the style elements in the Line Style dialog. Below you can see that the objects don't have the same Width.
Change the style to your desired style and hit OK. The selected style will now get applied to the objects.
If you know that the objects in a layer all should be created with the same style, you can set this for the layer and let MapInfo Pro handle this for you. This makes it easier to switch between inserting objects into different layers as you won't have to worry about the style.
Right-click on the editable layer and select Layer Properties from the context menu. It is important that the layer is editable. You can also access the Layer Properties dialog by double-clicking on the layer.
In the Layer Properties dialog, you can now click on the Styles for New Object... button. This button is only accessible if the layer is editable.
From the Insert Style dialog, you can now set the style for the objects you draw in this layer. The style types shown depend on the object types in the layer. You will therefore have to at least insert one object into the table and save the changes before accessing this dialog.
When you click on OK in this dialog, the chosen styles will get saved to the metadata section of the tab file.
And when you now draw new objects into this table/layer, the current style will be ignored and the style set in the Insert Style dialog for the layer will be used instead.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------