Showing posts with label AutoCAD. Show all posts
Showing posts with label AutoCAD. Show all posts

Tuesday, February 19, 2008

AutoCAD Annoyance: Can't Select Some Text - SOLUTION!

AutoCAD 2008 (as well as 2007 to the best of my knowledge) features an annoying bug where you can select some of the Mtext on the page, but not others. There does not seem to be a rhyme or reason as to which text you can or can't select. It generally occurs in paper space, but I have had it happen in model space. You just can't select some of the words you have written. I have no solution to this issue, but I do have a work-around.

When you can't select some of the things you have written as mtext in autoCAD, simply type the command QSAVE (which is short for quick save). This saves you document and, inexplicably, enables you to select all text again. If this doesn't work for some reason, save your DWG document, close AutoCAD and re-open your DWG. This is a surefire way to 'fix' this bug.

Using Masks in AutoCAD to cover underlying features (hiding transparency)

In most programs, hiding underlying features is easy, but, in AutoCAD’s polygon/polyline based interface it is less easy. This article will outline three methods for whiteing out backgrounds in AutoCAD.

1) Text Masking: If you want text to have a black background (ie. White), enter the mtext properties, select “background mask” and click to select a mask that matches your background color (which may or may not be white). You can also use this command to select a colour of your choice to mask the text. Background masking can also work for other types of features and will be discussed at length in a future article.

2) The ‘wipeout’ command: this works well for an areal feature, like a polygon that surrounds text ie. Text in a box. Type the command wipeout, hit p for polyline, select the box surrounding your text in AutoCAD, then choose not to erase the box (obviously). What this will do is cover all of the features behind the feature you have selected. One draw back to this command, I find, is that when you re-open the document later, a bug often shifts the layer ordering, messing up what you have done. Silly AutoCAD!

3) Finally, when all else fails, a simple hatch can cure your AutoCAD woes. Select the polyline you wish to hide the interior of, type hatch (or h for short), choose solid color, then select the colour that matches your background by default.

Well, these three somewhat annoying to use commands are the only way, that I know of, to grey out background items in AutoCAD 2008. You should now be able to do away with transparencies in all of your CAD .dwg files. Hopefully.

Friday, February 15, 2008

AutoCAD Quirk: Escaping a Viewport in Paper Space

Normally you can just escape a viewport in paperspace by double clicking on the paperspace margin, but what if you were zoomed in too closely when you entered the simulated model space from paper space?

There is a button that exists just for such occasions and it is located with your snapping tools on the bottom toolbar. Unfortunately, a bug often prevents this button from appearing. So, in AutoCAD you need to click the tray settings dropdown in the bottom right hand corner and enable the "Model/Paper Space" button.

Arg, my paper space looks like model space!

Tuesday, February 12, 2008

Matching Object Locations in AutoCAD

Moving and rotating features is easy in AutoCAD, if you do not need to be precise.... However, if you precisely need to match one feature to another spatially. eg. you have an updating drawing that needs to go in the exact same space that the old version does (and youve moved the old version). Or; you may need to line up two different objects. With this guide, it will be a snap (no pun intended)

You can do this with two relatively easy steps:

1) Use the Move commands and set osnap on endpoint. Choose an endpoint on the new object that corresponds exactly with an end point on the other object... If you just want to align the two features and not overlap them, skip this step.

2) Once you have moved one point of the new object to match the old object, you will likely need to rotate the new object to fit in the same constraints. This next portion will tell you what to do at each prompt.
>Use the ROTATE command.
Specify base point:>Select a base point on the object you are moving TOO rather than the object you are moving.
Specify rotation angle or [Reference]>Choose the Reference Sub command "type reference"
Specify the reference angle <0>Select the corresponding point on the new object that you wish to rotate by (eg. the same endpoint)
Specify second point:> Select a point that, when combined with the previous point, specifies the angle that you want the new feature to occupy
Specify the new angle: > Choose a final point that specifies the angle of rotation

I realize that these directions may seem confusing, but experiment if you don't get it right on the first try. This seems to be the only way to do this in AutoCAD. In GIS, this type of a proceedure might be called georeferencing (if we were dealing with rasters), in AutoCAD this sort of 'georeferencing' can be referred to as 'frustrating'.

Friday, February 8, 2008

Dealing with an AutoCAD file that has not been scaled: Improper Scale in a DWG!

Have you ever been handed a drawing done by someone else? Have you ever been handed a drawing done by someone else who doesn't seem to have the faintest clue about layouts, scales, or plotting? Where I work, we get handed DWG files from many different consultants. Each of them is inept or dinosaurish in some way. One difficult problem that I frequently encounter is CAD documents that are not properly scaled or dimensioned and won't print to a standard layout!

Assuming you don't know the size of the paper it was originally printed on,

One way to overcome this is to follow this proceedure:

1) find a feature on the document that has a known length and measure it using the distance tool (di is the short cut)
2) divide this length by the scale
3) this number is to be used when you plot
4) Select plot, plot window (drag a box over the entire drawing), choose a ratio for scale (eg. 1 mm = 10 mm), then
5) Hopefully plotting should work!

Monday, January 21, 2008

Scaling AutoCAD viewports to common Geographical scales

So, you have your AutoCad drawing completed, you have your layout drawn, and view ports of the drawing added. Now that all of this is done, you want the viewports to be scaled to a nice, round scale for your legend.

The way you do this is the Zoom XP command. Type Zoom (shortcut Z) then> XP and enter one of the values listed in the chart below for the corresponding scale:

Zoom XP

Scale

Zoom XP

Scale

0.200 xp

1:5 000

4.000 xp

1:250

0.333 xp

1:3 000

5.000 xp

1:200

0.500 xp

1:2 000

6.667xp

1:150

0.666 xp

1:1 500

10.00 xp

1:100

1.000 xp

1:1 000

20.00 xp

1:50

1.333 xp

1:750

25.00 xp

1:40

1.666 xp

1:600

33.33 xp

1:30

2.000 xp

1:500

40.00 xp

1:25

2.500 xp

1:400

50.00 xp

1:20

3.333 xp

1:300

100.0 xp

1:10

Converting AutoCAD blocks/polygons (DWG) to fonts (TTF)

Theoretically, this should be an easy task. AutoCAD is vector based, true type fonts are vector based, so, where is the conversion tool? Unfortunately, there isn't one.

The only way to convert between the two is to do it somewhat manually. I've looked and even tried to program this myself, it just isnt within my capability. Incidentally, if some enterprising young programmer out there was willing to do this, I would be very appreciative!

So, anyhow, this is my methodology for converting AutoCAD polygons/blocks to fonts (in my case, so they can be used as markers in ArcGIS).

1) Save your CAD file as a BMP or a TIF, or some other uncompressed raster image. I would recommend saving it at a scale that you feel you will use the most as a font (even though fonts are scalable).

2) You need a font creation program. There is currently no way around this. If you have the money, there are several programs you can buy for 50-700 USD. If, like me, you dont have this kind of budget for a piece of software you will not be frequently using, then there is a fairly good free software option out there. It has one major drawback, however....

It's not windows software! Which is a drawback when you are clearly using both ESRI ArcGIS and AutoDesk AutoCAD in a Windows environment.

Anyhow, the software is called Font Forge (Google it, it should be at Sourceforge). To even get this program to work and start making your ArcGIS compatible fonts, you need to install Cygwin, which is an application that simulates a UNIX environment.

Once you have gone though the headache of installing that program - there is a very good guide on their website - you are ready to start converting AutoCAD into a font. From within cygwin type:

$ twm &

$ fontforge -new

Read the fontforge guide on how to create fonts. I would highly recommend the autotrace program - if it will work on your system - it will streamline the conversion process somewhat. Once you have created a new .font be sure to import it into your control panel>font folder. Windows will now have a new font that, hopefully, has characters that resemble your original AutoCAD file.

Be sure to read my upcoming article on using these newly created fonts to create ArcGIS markers.

Friday, January 18, 2008

Simple AutoCAD to ArcGIS 9.2 Guide (.dwg - > .shp)

If you do a lot of work in both ArcGIS and AutoCAD, as i do, you will know the difficulties of converting between the two. Although AutoCAD files can be directly imported into ArcGIS and ArcGIS can export to DWF files (which are directly compatible with AutoCAD), jumping between the two can have extremely annoying hidden difficulties.

This post, as well as this blog, will focus on working in the two environments and making your work mesh together in concert. This post is a guide for to simply add Autodesk Autocad DWG drawings into ArcGIS 9.2. So, without further ado...

As with any ArcGIS document, you need to make sure that you .DWG file is saved in a directory that is no further than two folders from the root drive. In addition, you must make sure that there are no spaces in the folder or filenames. eg. c:\Arc\GIS\cadfile.dwg

Next open and save a ArcMap document in the same folder. There can be spaces in this filename. Add data to the data frame > select the autoCAD document you wish to import. If the CAD is simplistic and is only one layer, you are done! However, since 99% of CAD documents do not fall within this description, you are not done.

The CAD document, by default, combines all the layers, annotation, etc... into one group layer in ArcGIS. You can expand this group layer and see the nonsensical way it displays the 5 layers within it by default - complete with annoying ArcGIS random colours and and strange coordinate/range descriptions. They will fall under categories like annotation, point, polygon, polyline etc... These are the filetypes that ArcGIS is most familiar with, but who wants them in one layer!? And the descriptions of the symbology is equally confusing. eg. continuous 4,62 etc...

Your goal is most likely to seperate the layers back to the point that they used to be when you had them in AutoCAD 2008 (or whatever version you are using). You may want all of the layers or you may want a select few. The process, as of right now, is somewhat confusing. I am currently working on a more streamlined process and will be blogging about it soon. But for now here is the method for extracting autocad layers from ArcGIS:

To do this, we must first right click on the CADD layer within the group layer > properties > drawing layers tab > then click disable all > then click the first of the layers you want to isolate (only one unless you want to combine several layers into one layer).

Close the window > right click again on the layer > go to data > expand it > click export data...
> chose a place to save the file and a file name and voila!

You have a layer that is an ESRI shape file (.shp). You can repeat this conversion process for each of the AutoCAD layers you want made into ESRI ArcGIS layers.

As I said, I am currently writing code to streamline this process and it will be done and posted on these forums soon!

Wednesday, January 16, 2008

AutoCAD Lesson: Matching the style of one feature to other features

If you have an object or objects in AutoCAD that you wish to have the same properties as another object that you have in your drawing, there is a painless way to do it (without manually changing the properties).

1) type the command MA
2) click the input feature (with the properties you wish to transfer)
3) click the feature(s) in CAD that you want to give new properties to

There! Your feature should all have the same colours, line weights, line types, scale and any other property you can image.

AutoCAD lesson: Moving an object from paper space to model space without changing the scale and/or location

You can move an object from paper space to model space (or vice versa) in AutoCAD 2008 by simply copy + paste. But what if the object is scaled and you want to maintain the scale in the conversion? The scale of paper space is 99.9% of the time a different from the scale in model space/your viewport. So, to preserve that relative scale in the conversion you need to do the following:

In AutoCAD…

1) select all the features you wish to convert

2) click the modify drop down > then click change space.

The features you have selected should move from the paper space to your viewport.

Conversely, if you wish to bring a feature from a CAD drawing’s model space back to the paper space, then you need to do the following:

In AutoCAD

1) Double click on the viewport that contains the features you wish to bring back (first make sure the viewport is not locked)

2) Click the features you wish to bring to the paper space

3) click the modify drop down > then click change space.

The features should now be back into your paper space with their scale and location intact.

Converting ArcGIS to Autocad: the easy way

This is a simple methodology for converting ESRI ArcGIS shapefiles to AutoCAD dxf format. This post will be very brief, because this process is relatively simple. There are two methods of doing this that I use depending on the ArcGIS version:

Method 1: For ArcView and ArcEditor
If you are stuck with either of the lesser licences, use this method. If you have ArcInfo (the top licence), skip to method 2.

1) Open ArcCatalogue
2) Select the shapefile you wish to convert.
3) right click on it and select export... then shapefile to DXF...
4) Select an output path (dont worry about decimals for now)

You can repeat this process in ArcGIS the same way and select batch if you wish to do this to multiple shapefiles at once.

Method 2: For those of us with ArcInfo

1) Open ArcCatalogue
2) Select the shapefile you wish to convert.
3) right click on it and select export... then click Export to CAD
4) Then select DWG. You can export directly to a DWG file with ArcInfo. If you dont have ArcInfo use method 1 and cry.

Reading my additional articles on importing ArcGIS into AutoCAD for more information...

Tuesday, January 15, 2008

Converting AutoCAD blocks to ArcGIS markers: Can it be done?

I've been asked this question a number of times: Can AutoCAD blocks be transformed into ESRI ArcGIS markers and saved in an ESRI style document?

The answer is yes, sort of. It depends on the application and how loosely you define the word 'convert'. Another person might use the word re-create instead. Just to clarify, this guide only applied to point features in ArcGIS, you can search my other posts for a guide on how to convert AutoCAD blocks into polygons or lines in Arc.

There are two methods I currently use to convert from CAD blocks to GIS markers (points):

Method # 1: Saving as a .bmp (windows bitmap)
This method is only useful if you do not ever need to scale the marker to a size larger or smaller than how you create it. If you do need to scale it, but only to one or two other sizes, you can just repeat this process for two additional symbols.

To begin, you need to export the file you want from AutoCAD to a bitmap document. There are a variety of ways to do this, you can read about it elsewhere in my blog. Or elsewhere on the internet for that matter.

Once this is done, you can import the marker to your ESRI ARcGIS styles manager. There is a guide to use your styles manager also in this blog. However, the quick solution is to go to TOOLS>STYLES>STYLE MANAGER is ArcGIS. In there, go to the style file that you are using (either your user name, ESRI, or another file you have created - this is recommended). In this ESRI ArcMap style file, you need to select 'marker symbols'>right click on the right pane> new...

Then select picture marker symbol> select the bmp you exported from AutoCAD and voila. You are done. The reason I say not to scale is more of a guideline than a rule. ArcGIS is terrible at scaling images (think MS Paint, but worse). A scaled symbol from a bitmap will look completely wrong. So, as I mentioned earlier, if you want to import a CAD to ArcGIS symbol into bmp, make one for each point size you would like for the marker.

If you DO need to scale your marker, then a much more complicated methodology is required...

Method # 2: Creating an ArcGIS marker from a custom TTF (True Type Font)... SEE PART 2

Monday, January 14, 2008

AutoCAD to ArcGIS Conversion Compatibility Report

This post lists the current conversion capability of different versions of AutoCAD and ArcGIS (ArcView, ArcEditor, ArcInfo). To see how to do this, read our guide: Guide to convert ArcGIS to AutoCAD

The following are the versions of AutoCAD that I am certain will import into ArcGIS (older versions may also work, I just have not experimented:
AutoCAD 2008 (Release 22)
AutoCAD 2007 (Release 21)
AutoCAD 2006 (Release 20)
AutoCAD 2005 (Release 19)
AutoCAD 2004 (Release 18)
AutoCAD 2002 (Release 17)
AutoCAD 2000i(Release 16)
AutoCAD 2000 (Release 15)

The following are the versions of ArcGIS that, for sure, support importing

ArcGIS 9.2 ArcGIS 9.1 ArcGIS 9.0 ArcGIS 8.3 ArcGIS 8.2

See our Guide: how to convert ArcGIS to AutoCAD