Solved

Using AutoCAD Drawung in ArcGIS.

Posted on 2004-10-04
10
1,677 Views
Last Modified: 2008-01-09
I have an autocad 2000 dwg file.
The drawing is a site plan of the site with approximate size of 500' X 500'
When I am trying to add this file as layer in arcmap it is giving a warning message saying

Warning, inconsistent extent.

One or more of the added layers has an extent that is not consistent with the associated spatial reference information.
Reprojecting the data in such a layer may lead to un expected behaviour. Use arccatalog to confirm the spatial reference is correct and adjust if necessary.

How do I correct the extents.

What is the correct procedure to display the CAD drawing in ARCMAP.

Thanks,
Siva.
0
Comment
Question by:spgaddipati
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 2

Expert Comment

by:CWise
Comment Utility
If you go into ArcCatalog, select the dwg file you are working with, then right click your mouse and choose the properties option.  Select the "Spatial Reference" tab.  Select the "Edit" button then go down to the select button and choose the spatial reference (Coordinate System).  Most likely yours is currently unknown.  Try to set this to the cooridnate system you created the data in.  
You may also want to look at what your .mxd file is set to.  It should not cause a problem, but it will prompt you if your data sets are in different coordiante systems.  It will always try to project the new data based on the coordinate system the first layer you brought in.  
If you go to (inside of ArcMap) View, Data frame properties, the coordinate system tab will show you if one has been set for this mxd.

Here is a brief link to something I found concerning the error you received:

http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=20307
0
 

Author Comment

by:spgaddipati
Comment Utility
Thanks for your advise.
I have a question.
There is no coordinate system in defined in the drawing which is created in autocad 2000.
How can we define a co-ordinate system in Autocad? Also, the lower most corner of the drawing is at 0,0.  Do we need to change this so that it will match per the coordinate system.

Thanks,
Siva.
0
 
LVL 2

Expert Comment

by:CWise
Comment Utility
It has been along time since I have had to mess with AutoCad so I won't even try to mess with that one.  As long as you set it in ArcCatalog the way I mapped out you should be fine.  If you look at the extents tab after you select you coordinate system you will see that the origin is 0,0.  You should be fine at that point.
0
 

Author Comment

by:spgaddipati
Comment Utility
Hi,

Do I need to change the X/Y domain settinggs also.
MinX, MInY, MaxX, MaxY, and precission.

Under the Edit button
There are values for CAD Dataset extents. How do i change thse. Do I need to change these too?
The values are set as follows.

XMin: 0                     XMax: 4398.41171
YMin:-107.62015        YMax: 3315.36581
ZMin: -2.130815         ZMax: 0

These are to big comapred to my drawing which is from 0,0 to about 500,500 (top most corner) feet in autocad.
I think because of this the drawing is showing too big in the map. I am unable to see entire longisland map if I add this drawing to the map. Both longisland layer and cad drawing are set to same projection.

Please advise. Thanks in advance for the help.

Siva.


0
 
LVL 2

Expert Comment

by:CWise
Comment Utility
Did you try bringing your AutoCad layer in first into a blank MXD?

Here is a very good (short) document on the steps involved in setting the spatial reference for a dataset.  the only issue I can forsee when dealing with CAD data is that it never acts as good as it does if your ESRI's propritary format.  If the steps in this document do not work I would recommend pushing the CAD file to a personal geodatabase using ArcToolbox or Catalog.    

http://charlotte.utdallas.edu/mgis/classfiles/gisc6383/SpatialReferenceGeodatabase.pdf


Hope this helps.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Expert Comment

by:kissgisit
Comment Utility
If your AutoCad drawing starts at 0,0 it has a local coordinate system.  You care going to have to georeferance(Transform) it in ArcMap.  There is no projection to set. You might be able to increase the XY in AutoCad.( I am not an AutoCAd guy so i have no idea if that can be done.)  
0
 
LVL 3

Accepted Solution

by:
bsncs02 earned 125 total points
Comment Utility
Hi CWise,

There are two ways you can accomplish this task.

First (and easiest) is to use the AddData tool to locate and add the CAD file. You will notice that ArcMap converts the CAD file into PolyLines, Polygons, Annotation and Point feature layers.
Then use the CadTransformation tool to transform the CAD file by scaling and shifting it into position.
You can do a search on http://arcobjectsonline.esri.com/  for "CAD Transformation Toolbar".
You have to register the dll on your client machine.

Here is a description of the CAD Transformation Toolbar.

Description:

When CAD files are added to ArcMap they are not necessarily in the same coordinate space as the rest of the data being used. To solve this problem the Transformation tab on the Properties dialog of the layer can be used to add transformation information. The code in this sample provides tools to accomplish the same thing as the Transformation tab in a more automated fashion. Tools for repositioning the CAD file include: fit to display, rotate, scale, shift, and add links. Rubbersheeting or warping of the CAD file is not currently possible, so only two links can be added for repositioning the file. Once the desired transformation has been achieved, the results can be applied to the other CAD layers in the map or saved out to a world file.
Options on the toolbar include:

Fit to Display - Moves the CAD file into the current map extent
Flip Horizontal - flips the image on a horizontal plane (since you can only have two registration points, the results aren't great)
Flip Vertical - flips the image on a vertical plane (since you can only have two registration points, the results aren't great)
Flip Vertical - flips the image on a vertical plane (since you can only have two registration points, the results aren't great)
Rotate Left - rotates the file 90 degrees to the left.
Rotate Right - rotates the file 90 degrees to the right.
Delete Control Points - remove any links that may have been added with the Link Tool (does not reset the transformation, though)
Reset Transformations - removes any transformation that may have been set for the file.
Apply to All - Apply the current transformation to all other CAD files in the map (be careful with this one).
Save World File - Writes out the current transformation to a *.wld file based on the name and path of the file being transformed. The next time you add this CAD file to the map, the world file will be used automatically.
Rotate Tool - Interactively rotates the file. Pressing "a" when this tool is active allows you to type in a relative angle. Rotation is based on the centroid of the current extent of the file unless a link has been added (in which case the To point of the link is used as the rotation anchor).
Shift Tool - Interactively pans the file.
Scale Tool - Interactively scales the file. Pressing "s" or "f" when this tool is active allows you to type in a scale factor to use. Scaling is based on the centroid of the current extent of the file unless a link has been added (in which case the To point of the link is used as the scale anchor).
Link Tool - Allows the user to interactively add links for transforming the file. The first link will move the file based on the from and to points that are specified. Adding a second link will cause the file to be scaled and rotated so that the from and to points of both links match.

How to use:
Register the TransCadExt extension class under the ESRI Mx Extensions category using Categories.exe (browse for the Component Category Manager topic in the Developers Help if you need more information on registering an extension).
Browse and select the file TransCadBarPrj.dll using the 'Add From File' button on the customization dialog. This will add a new toolbar and a set of tools to ArcMap.
Turn on the CAD Transformation toolbar.
The name of the first CAD file in the map will display in the combo box on the toolbar. If you don't have a CAD file in your map then you will need to add one. Change the name of the selected CAD file as necessary. The file selected in the combo box is the one that will be transformed.
In most cases you will need to being the transformation be repositioning the CAD file within the extents of your other data. To do this zoom/pan to an appropriate area and select the "Fit to Display" option from the CAD Transformation pulldown.
Apply some of the other buttons on the toolbar to reposition your CAD file accordingly.

Application: ArcMap

Requires: CAD layer

Difficulty: Advanced


Second, and a bit more complicated you could project the coordinate layers to the four feature layers loaded by the AddData tool when you loaded the CAD file in a macro or dll.
This code comes directly from http://arcobjectsonline.esri.com/
Search for "Alter SpatialReference"

Sub AlterSpatialReference()

  ' Start by getting a handle on the current FocusMap
  Dim pMxDoc As IMxDocument
  Set pMxDoc = Application.Document

  Dim pMap As IMap
  Set pMap = pMxDoc.FocusMap

  'Assume that europeEquidistant is added last and that it is at the top of the map.
  Dim pLayer As IFeatureLayer
  Set pLayer = pMap.Layer(0)

  'This is how we get the current spatial reference for a layer
  Dim pGeoDataset As IGeoDataset
  Dim pSpatialReference As ISpatialReference
  Set pGeoDataset = pLayer 'QI for the geodatset from the layer
  Set pSpatialReference = pGeoDataset.SpatialReference
  ' Note that ArcMap sets the SR as "Unknown"
  MsgBox pLayer.Name + " SpatialReference is " + pSpatialReference.Name

  If (pSpatialReference.Name = "Unknown") Then
    ' Get the FeatureClass from the Layer
    Dim pFeatureClass As IFeatureClass
    Set pFeatureClass = pLayer.FeatureClass
    ' QI for the Geodataset from the FeatureClass
    Set pGeoDataset = pFeatureClass
    ' QI for GeoDatasetSchemaEdit from the Geodataset
    Dim pGeoDatasetEdit As IGeoDatasetSchemaEdit
    Set pGeoDatasetEdit = pGeoDataset
    ' Test if we can alter the spatialreference, if we can
    ' then we create a factory and use that to create
    ' a projected coordinate system.
    If (pGeoDatasetEdit.CanAlterSpatialReference = True) Then
      Dim pSpatRefFact As ISpatialReferenceFactory2
      Set pSpatRefFact = New SpatialReferenceEnvironment
      ' Use a SpatialReferenceFactory to create the Projected Coordinate System.
      ' Here we are using a Factory Code for the Two Point Equidistant coordinate system.
      Dim pProjCoordSys As IProjectedCoordinateSystem
      Set pProjCoordSys = pSpatRefFact.CreateProjectedCoordinateSystem(esriSRProjCS_World_TwoPointEquidistant)
      ' Now alter the layers spatial reference
      pGeoDatasetEdit.AlterSpatialReference pProjCoordSys

      ' Now get the updated SpatialReference and its name
      Set pSpatialReference = pGeoDataset.SpatialReference
      MsgBox pLayer.Name + " SpatialReference is " + pSpatialReference.Name
      ' and force a full refresh
      pMxDoc.ActiveView.Refresh
    End If
  End If
End Sub

Hope this helps.

Ashley Lee
Systems Engineer
Mesa Solutions Inc.
alee@mesahq.com



0
 
LVL 3

Expert Comment

by:bsncs02
Comment Utility
spgaddipati,

Did you ever get this resolved?
0
 
LVL 3

Expert Comment

by:bsncs02
Comment Utility
stone5150,

Can we close this question? Apparently spgaddipati solved it his or her self.
0
 
LVL 3

Expert Comment

by:bsncs02
Comment Utility
stone5150,

Can we get any points for our efforts?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Google Maps 3 426
which gps device to buy 7 608
Finding the Center of Gravity MS SQL Query 10 796
"RANGE_INTERPOLATED" using google 3 1,731
I feel like more and more people want to know how to programmatically convert addresses into geospatial locations. So in this article, I will show you how you can do it with Bing Maps. I'm going to use PowerShell, which is a nice scripting language,…
Introduction This article is designed to assist GIS (Geographic Information System) and GPS (Global Positioning System) developers using ESRI ArcGIS and other spatial information management systems.   For the uninitiated the concept of projectio…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now