What are Object Classes?

Have you wonder what the Object Class item was in the Map Explorer Tab on the Map Task Pane? Why is there a “Undefined Classes” listed when its expanded? Maybe you heard of this thing called Object Class but wonder why you should use it, after all you use object data and keep all your feature data/information there. So WHY use it? When object classes first came out in Map 6 I took a look at it and said “I don’t need it, I use lisp and vba to create all my new features.” Yes if I need to add a new utility pole on my map I had a command called pole that inserted a pole where I wanted but also created and attached OD to it including default values for the “Date” field and the X-Y location from my coordinate system. If I wanted a new transformer on the map I used my custom command named “TRAN” to do the same thing for the transformer block adding the attributes as it inserted it. Just about all of the mapping I did was with using custom commands putting the proper block on the correct layer scaled to the correct scale and etc. keeping the standards for the maps up to date.

But what if you are not a programmer, do not know lisp or any of the other programming? That’s where the Object Classes come into play.(With some added benefits). Object classes makes it easy to create the features and follow your standards on layer, color, scale and most of any other standard you have and create the data you want to attach to the features. You can also classify existing features with a few clicks. Classified objects are also a lot easier when it comes time to export those features out or when you decide to port everything over to a geospatial data base.

So what’s the added benefit I wrote about above? Have you ever tried to do a search for a value in an object data table? Say you have OD attached to some water meters in you map and one field is for the meter number. How do you locate that one meter with the number of 1234? Well you can attach and query that map then mark the meter with a circle and save back or remember the X-Y coordinate then try zooming to them in the map after you detach it. In other words it was a bit of a PITA to do. With object classes you can use the quick search function in AutoCAD.

Have I convinced you to use them and want to know how? Well there are three toolkits that consist of the files needed on the Autodesk subscription site you can download and try. One for Electric, one for Water and one for Wastewater. Each comes with a readme file telling you how to load them and where to place the files. If you need some help or want to create you own let me know, just leave a comment and I’ll write up some “How-do” on creating them and using them.

Create a 3D Surface from a SHP File. (with survey extension)

Do you have the need to create a surface from a ESRI contour file, and that shape file is just 2D with the elevation as an attribute? The new released Survey Extension For Map3D will do it. It is as easy as 1, 2, 3.

Step 1. Use the data connect to connect to the shape file.

Connect_Shape

Note: all you need is to connect to it there is no need to add it to the map.

Step 2. Use the “Mapcreatesurface” command to open the Create Surface dialog.

Create_Icon

The Create surface tool is on the Input and Inquiry toolbar. if not just type the command at the command line.

Select_Connection

In the Create Surface Dialog, select “Connection” for the source and select the shp connection you made in the data connect.

Set_Z

Step 3. Provide a name and location for the Raster TIFF that will be created. Then select the field that contains the Elevation value in the attribute table.

Now press the OK button.

Now the results after setting a style to the surface feature layer and placing the original contours above it in the draw order.

Finished

OK if you count all the mouse clicks it may be more than 3 steps but, its quicker than firing up ArcInfo and using the tools to create the surface there then  connect to it.

To those that may want to question the accurately of this compared to ESRI software, well I took the same shp file in ArcMAP created a TIN from it and converted that into a Raster.  I then added that to this dwg and compared them in both 2D and 3D views. To me I didn’t see any difference between the two.

You Asked, Autodesk Provided.

After the Civil tools were deleted from Map3D in the 2006 version and up, users have been complaining. There was no way to create a surface from points or use LandXML files. Well guess what? They are back or soon will be for subscription members. A release date of June 29th is set, but don’t hold the Murph to that date that’s the date I was told they will be available to members on the Subscription site.
Now these are NOT the same tools that were in Map 2005/2006 version and there is no separate menu for them as the default but if you want you can use the CUI to create one. They are being called the Map3D 2009 Surveying Tools and consist of a few extra tools to allow users to bring in survey points into MAP and create a raster surface, YES a raster 3D surface, a DTM raster with a format of TIFF.  It works with the FDO raster providers and there is an export to LandXML command if you need to share the surface to other GIS/CAD users that can use LandXML.
There is also a couple of COGO commands added to this survey tool, A BB (Bearing Bearing) and a DD (Distance,Distance) transparent commands that allow you to add a few points using either two bearings from know locations or a point from two known distances. 
I had the pleasure to try out the Survey tools the last few nights and so far they are better than nothing but, I’ll leave my comments for another post.  In the coming days I’ll post some examples of what they can do and how to use them.

Label Those Lot Lines

Do you ever have the need to label lot lines in Map3D? Civil3D users have the parcel labels but with just Map3D it was always the old text command. Try using the map annotation block features instead. Here’s how you can create a annotation template that makes it a little easier. First the lot or parcel lines need to be lines or single element plines. So if you need to use the drawing cleanup tool first to break those polygons or closed plines into single element plines.
We start with creating an annotation template then use the property value “Length” for the value for our length tag. But we need to add a few extras to make it look right. First thing we don’t want all the labels to be 8 decimal places long, two is the standard most places, and second we need to add the FT (single quote) mark at the end.

length_tag

So to accomplish this the value should look like this
(STRCAT (RTOS .LENGTH 2 2) “‘ ” )
The RTOS converts the real (Length) value to a string value with the first 2 being the units type as Decimal and the second 2 as the precision. The STRCAT and the “‘ ” (double quote, single quote, double quote) then takes that length value and adds the single quote mark at the end. If you work in Meters you can replace the single quote with Meters, just make sure you keep it inside the double quotes. For the text options use your text style you need and for the height use the value that will meets your standards. Keep the rotation at 0 but set the justification at Middle Center. Use you own standards on the object properties for layer,, color and lineweight. 
When you click OK and are asked for” Specify middle-center of text: ” go with 0, “your text height” this places the tag at it’s proper location with the justification at middle center.
Now for the bearings part of the annotation. Start a new annotation tag and for the value we use the angle property of the line but convert it to a string.

Bearing_tag

We do this because the angle property returns the angle in Radians not in degrees. So the value will be (ANGTOS .ANGLE 4 3).
The ANGTOS converts the radian value to a string and the 4 tells it what angle type to use in this case Surveyors and the 3 is the precision, taking it all the way down to seconds. Set the text options the same as for the length tag and the object options to your standards. This time when you are asked “Specify middle-center of text:” use 0, - “your text height”, to place it below the length tag.
Save your template and use the annotation tools in Map3D to label your lot lines. When you insert the annotation blocks is when you need to set the rotation value so use the expression .ANGLE to set it. Doing it here makes for cleaner labels and keeps the two lines aligned.

Rotation

 

Now for a couple of disclaimers: The annotation angle will be in the direction that the line was created. Most surveys start at the POB and go around in one continuous path. The labels need to follow that rule, that’s the way I was taught years ago and that’s the way I taught for years. However if your drawing is from a source that doesn’t follow that rule or you used the drawing cleanup tools the line may not be drawn in the proper order and will need to be adjusted. Another thing is the text may be upside down or on some of them the length is on the inside with the bearing on the outside while others are vise-versa. By setting grips enable for blocks and using the two tags instead of a multiline attribute tag allows you to move and adjust the placement as needed.

Labels

The Finished project.

Default is gone, Almost.

A couple ‘bugs” that showed up in R2008 when importing an ESRI shape file have been fixed in R2009. Did you notice that in 2008 when you imported a shape file that the default layer and Object Date Tables were prefixed with “Default_”? Well the layer name no longer has that “bug” but the OD table name still prefixes it with “Default_”

Here’s what it looked like in 2007:

2007_defaults 

Then in 2008 we got this:

default

Now in 2009 we get this:

2009_default

The Layer name is back to 2007 style but the OD table still has the bug.

 

The other “bug” introduced  in 2008 with the map import was the color properties of the objects after they were imported. If you had a predefined layer with a color assigned to it and used that as the drawing layer for the import your objects did go to the correct layer but did not take on the color of that layer. 

Colors

This image (above) shows the plines are on layer Street and the color for that layer is Red, but the polyline has a color of White.

Now in 2009.

2009_colors

As you see it’s back to the pre 2008 version and the polylines take on the ByLayer for the color.

So now we need the development team to get the object data table name back to where is was and forget all about those “Default_”names messing up peoples scripts and queries.  

Express Yourself with the NEW Expression Builder

Those that upgrade to  MAP3D 2009 will now be able to use an expression in a friendlier environment thanks to the new expression builder.  Anyone that tried to create a complex label for a feature data set knows how hard it was to do in the 2007 or 2008 versions. You were limited to just a few options and you need to make sure the syntax was just right , even when the validate tool reported an error there may not of been an error.

First off depending on what the expression is for as to what the dialog will display.  You can use the create/modify expression not only to create a label but also to create a filter to query your data.

dialog_labels

The expression dialog to create a label.

dialog_filters

The expression dialog to filter your data.

Although the two dialogs look the same at first there are a few extra tools  in the filter dialog. The three “Getting Started with……”controls in both dialogs are useful for those that are just starting out creating expressions and will insert the correct code or syntax for those, for the advance users you can turn them off or just start entering your expression by clicking in the dialog box and typing away. So what options or tools are available now, lets take a look.  The screen shots below are from a SDF connection so the property menu will vary of you data.

Property Operators Math

text date Location Geometric Conversion Values

So there you can see there’s a lot of tools to let you create an expression that you can now use, from converting a number value to a text to rounding the number and even doing a mathematical operation like add one value to another and drop the precision of the sum to 2 decimal places all in one expression.  The validate option will not only tell you if an error is present in the expression but also moves your cursor to the error in the expression allowing you to edit with out trying to figure out the error message.

Another nice feature it the ability to  save the expression to be used again.

save_load

The  save option creates a xml format file with the extension of fdg. The saved expression then can be loaded and used again with your data at another time.

So there you are a look at the new expression builder in AutoCAD MAP 3D 2009.  As time goes on I’ll post a few tips on how to use it.

Map 3D 2009 is on the Way.

So what’s new in AutoCAD Map 3D? I’m sure everyone has read or seen the blogs posting or news release on what’s new in AutoCAD 2009 but for the MAP 3D users what is new? Well there’s a couple new features that I think will make users happy. The first I’ll write about is the split and merge feature. For those that use the FDO, data connect, or what ever you want to call it these tools allow you to split a feature into two or more features and merge two or more features into one feature. An example would be a large parcel gets subdivided and you need to create th new parcels. The split feature can do it. Or say you have a group of small parcels that gets brought up by some bigger corporation and you need to merge all those small parcels into one big parcel, the merge feature can do it.

menu

The commands are on the Modify menu in the Geospatial workspace by default, but you can also use the command line to call them up.parcel

Here is a large parcel polygon that we need to split into two separate parcels. Select the feature to split then either use exiting lines or draw a new line to use as the cutting line.

 Split

The great thing about this tool is you can use the standard AutoCAD editing and creating tools to draw the dividing line with accuracy. No more guessing where the property line is at.

table

Once you create the dividing line the data table will add the new record(s) depending on the rules you set for the split.

The Merge features works similar, select the features and the data table deletes the old records and adds a new one based on the rules you set for the merge.

Here are some screen shots of the merge tool merging 3 parcels into one.

Before_M

Notice the parcel address of 901, 933 and 991 and after the merge.

merge After_M

The rules I set for the merge allow me to use the attributes from the first parcel selected for the merged parcel.

So where and how do I set the rules for the split and merge features? One way is in the Options on the data table for the feature layer, select the Set Split and Merge Rules.

SetRules

This opens up the palette to set all the rules you need for the schema that goes with that feature layer.

SetRules2

So what else is new? Well one change is the automatic check out of a feature. What this does is checks out a feature when you select it. There’s no need to select a feature and then right click to select “Check out feature”. This is enabled as default but you can turn it off from the Edit menu in the Geospatial workspace.

Checkouts 

Another new feature is the “New” Expression editor. If you ever tried to create an expression in prior versions you will like this. I’ll post about that later, so stop back again in a few days.

Scale those AutoCAD Objects Based on Data Attached

Do you need to display some of your objects (blocks or points) based on the Object Data or database link values assigned to them? You know you can always do the attach the drawing and perform an alter-properties query on it method, but there is another way that may be shorter and easier if you do not like doing those queries.

By using the Display Manager, creating a new map, then set up a style using symbols, this method works with out using the FDO or data connect so you can use it on standard AutoCAD entities. Here is an example using simple a simple block called Existing_Hyd with OD attached.

clip_image002

Notice the OD field named PSI, that’s the field that we will use to scale the blocks. The values in my drawing for this field are 1000, 1500, 2000, & 2500. This is the water pressure at each of the hydrants in my map.

The first thing we do is create a new Map in the display manager (a map not a new dwg).

clip_image003

Click on the Data Icon and select New Map. Then change the name from New Map 1 to what ever you want. Next we add our drawing objects to this map.

clip_image005

Click the Data icon again and select “Add Drawing Data” then Drawing Layers. Select the layer the blocks or points are on.

clip_image007

It helps if the blocks or points you need to scale are on their own layer.

The blocks will now display in the map along with a map layer displayed in the display manager, but we need to set up a style. Right click on the new map layer and select “Add Style” “Symbol”

clip_image009

We now have a new element in the display manager named “Symbol style” and the blocks in the map took on a new look. This is normal and uses the default symbol of a square with an X in the middle of it as the symbol for the blocks.

clip_image011

To change this back to our block we right click on the “element” (Symbol Style) and go to the properties palette to make a few edits.

clip_image013

First rename the Style Name to reflect what the style is for, and then under the “Style Traits” select the block to use for the symbol. Note if you are using points and you want to use a block for the symbol the blocks must in defined in the current drawing.

The next item to edit is the “Scale” property for the symbol.

clip_image015

Use the Expression Chooser to select the Object Data field that you want to use to scale the blocks by.

Now the problem might be that the OD value is to way to large to use as a scale factor. Take my sample for instance. I want to use the PSI values to use, but those vales are up in the thousands, which makes the blocks WAY TOO BIG for my map. This is where the old legacy map shines verses the FDO ways and expression used there. With this method I can use a lisp expression to change the scale values right here in the property palette. The lisp expression I used is an arithmetic function that divides the OD value by 100 or by any number you desire.

clip_image017

There is a number of arithmetic functions listed in the help files under the expression evaluator that you can use if there you need to scale, rotate, or assign lineweight for the objects based on the data attached to objects just remember to include the opening and closing parentheses ( ) in the property value.

Feature Labels to Text

Do you need to turn the feature labels into text so that you can resize or move them around a little better than the display manager does? Right now there is very little control on how feature labels are placed in a map when you use the data connect to display feature data. The one method that I have been to use is create the labels using a simple font (Ariel) then set the size in Map Units instead of the default Display units. Then use the map export to dwg command to create a standard AutoCAD dwg file.

How ever this command does not always work for everyone. I have seen threads on it in the discussion groups and in forums where users are not able to get this method to work. So I decided to test it using a couple different workstations using different versions of Map 3D. Know what? It does not work all the time on all workstations. The one that it does work with, is my Dell M90 laptop with Map3D 2008 running XP. Why I have no idea, I even try using many different fonts, different display scales, different themes, and setting as many AutoCAD variables and options that I know. I set a couple default dwt files with text styles in many different ways and still can not get it to work on my HP desktop workstation running Vista with different versions of Map 3D.   Why it works 99% of the time on one computer and not on another I have no idea.

The team at Autodesk are aware of the problem and trying to figure it out too. Seems they get the same results as I do when testing it on different workstations. This is one issue that I have been in contact with a few members of the Map 3D team for the past few weeks trying to figure it out. So all I can say is bear with us and hope the bugs are figured out in time for the 2009 version and/or a hot fix for 2008.

Bring a CSV file into MAP 3D with data.

Have you ever received a text file of points with the locations and other data that goes with those points? Say you receive a GPS file of some hydrants that list the location as lat/lon and data about the hydrants. But the file is in a text format instead of a shp or dxf format. You can use the “Multiple” command with the point command to bring the points in but what about all those attributes that go with those hydrants?

“SIMPLE” Open the file in Excel and use the data connect for an ODBC connection. Here is how you can do this.

We start off with a text file either a CSV (comma separated) or tab delimited plain text. Depending on how it’s formatted as to how you open it in Excel, for my example I have a CSV file like so.

clip_image002

Notice the first line has the definition of each column or the label for each and the text is separated by commas. If you do not have the labels or definitions in the file that’s fine you can add them after we open it in Excel. Start by opening up the file in Excel, open Excel and go to file open and browse to the file. Excel should open the file just fine.

clip_image004

If you do not have the first row with a label or the description of the column you can add insert a blank row and enter them now. The next thing we need to do is create a named table range of the data. We do this by selecting all the data we need then from the menu Insert > Name > Define.

clip_image006
A dialog will open allowing you to create a name for the range. Give the range a name, it will default to what value is in cell A1, I find that is not very descriptive and causes a few problems down the line.

clip_image008

A few hints on creating the named table range, the help in AutoCAD Map 3D says you can press Ctrl-A to select the data cells but I found this to be a problem at times. First you are selecting EVERYTHING even empty cells from empty columns and rows. If there is an empty cell in the first row you may not be able to select the X-Y columns when you connect to the data in Map. So select the left top cells then scroll to the bottom of you data and shift-select the bottom right cell you need. If there is more data in the file than what you need then just select the data you need.

Next save the Excel spreadsheet as a Microsoft Excel 97/2003 & 5 Workbook with the xls file extension and close it.

clip_image010

The next step is creating an ODBC Data Source for the Excel file we just saved. Depending on your operating system as to how to get to the ODBC Data Source Administrator but with most of them you can get to it from the Windows Control Panel > Administrator tools.

clip_image012

Create a new Data Source by clicking on the “Add..” button in the dialog.

clip_image014

Select the Microsoft Excel Driver (*.xls), then click on finish. Provide a name for the data source, select the correct version then select the workbook to use by click on the “Select Workbook” button and browse to the Excel file you saved in the first step.

clip_image016

OK out of the dialog boxes and close the Administrator tools and any other dialog boxes that may still be open.

Open up AutoCAD Map3D and use the data connect to open the data connect palette. Select the Add ODBC Connection provider, then click on the file button and select the DSN name you created. Then click the connect button.

clip_image018

The login dialog box will appear, unless you placed restriction on the Excel file just click on “Login” with a blank user’s name and password. Back in the Data Connect palette you should now have the Excel file listed with the named table range you created as the FDO Schema. You can now select the named columns to use for the X & Y (& Z) insertion for the points. You do this by clicking in the blank space under each column. (You can drag the X & Y columns to make them wider if you need to.

clip_image020

After you click under the X column a drop down list box appears to allow you to select the column to use for the X & Y coordinates.

clip_image022

Select the columns that contain the X and Y coordinates in your Excel file. Then click on the “Add to Map” button.

Now you should have some points in your drawing with all the attributes that is in the text file.

clip_image024

Now if you need to use the points in another map or drawing export the ODBC layer to an SDF format file and you can archive the original text and Excel file, you don’t need them any longer.

Next Page »


Archives

Readers Locations