MapImport to block Attributes and limit decimal places.

MapImport to block Attributes and limit decimal places.

rodney.morrisseyNXQ5H
Explorer Explorer
875 Views
10 Replies
Message 1 of 11

MapImport to block Attributes and limit decimal places.

rodney.morrisseyNXQ5H
Explorer
Explorer

I use the MapImport command to import Shapefiles into AutoCAD Map 3D.  For the points I have mapped the data entries to Attributes within the block so they display within my drawings.

The Attributes populate successfully however anything that is a number from the Shapefile populates with 15 decimal places.  This doesn’t change or appear to be controlled by the unit/precision settings of the drawings.

 

Is there a way to set the numbers to one decimal place when importing the shapefile?

0 Likes
Accepted solutions (1)
876 Views
10 Replies
Replies (10)
Message 2 of 11

parkr4st
Advisor
Advisor

open the data table of the .shp and add the calculaton       Trunc (your field to 1 Decimal place here , 1 ) 

Export the table to .sdf file and mapimport the .sdf using the trucated data field instead of the original area data field

0 Likes
Message 3 of 11

rodney.morrisseyNXQ5H
Explorer
Explorer

Thanks.  So if I understand correctly you need to alter the data source in either AutoCAD or GIS.  There is no easy way to format the block attribute.

0 Likes
Message 4 of 11

parkr4st
Advisor
Advisor

Not sure if you "need to" but preplanning of the future use of data saves alot of time and hassles.  in this case you want one place to right of the decimal, there are two options, ROUND or TRUNCATE to one decimal place.  ROUND will down and up around the 0.5, i.e. 0.41 will round to 0, 5.69 to 5.7, but Truncate to 0.4 or 5.6.  depends on what is wanted for display.

 

It easier IMHO to prepare the data in the FDO file as to be used in display regardless of the use of a FDO file or imported to autocad objects with object data so all that has to done is a simple labeling of objects in the map.

 

if the FDO data can be used in the map, the decimal places can be set in the label style.

0 Likes
Message 5 of 11

ChicagoLooper
Mentor
Mentor

@rodney.morrisseyNXQ5H 

<<…I have mapped the data entries to Attributes within the block so they display within my drawings.…>>

What do the ‘mapped data entries represent? Can you be more specific? 

Chicagolooper

EESignature

0 Likes
Message 6 of 11

rodney.morrisseyNXQ5H
Explorer
Explorer
Thanks. New to using data in CAD but will give it a go,
0 Likes
Message 7 of 11

rodney.morrisseyNXQ5H
Explorer
Explorer
Multiple data fields. The data that are text labels are fine. The issues comes with numbers that are distances and are formatted to one decimal places in my GPS Trimble data. However when the numbers are exported from Trimble as shp files they export with 15 decimal places, which I can't alter back in Trimble.
0 Likes
Message 8 of 11

ChicagoLooper
Mentor
Mentor

Hi @rodney.morrisseyNXQ5H 

 

Based on your explanation, the MAPIMPORT command in Map 3D is doing exactly as instructed, it’s using the shapefile’s data to populate AutoCAD’s block attributes.

 

If Trimble’s default precision is 15 decimal places during export-to-shapefile, then your newly created shapefile will adopt 15-place precision too. Then when you perform MAPIMPORT to add your blocks, the same 15-place precision will carry over again. 

 

If it were me and wanted to ‘see’ numbers then I’d look at other ways to give me that info. 

Trimbles are wireless and can communicate with satellites. Shapefiles are geospatial and data rich, they’re smart. AutoCAD blocks are dumb and in the grand scheme they’re archaic. 

I don’t know what your end deliverable is and I don’t know your workflow either, but somewhere, somehow, there’s a more efficient, higher level way to do what you’re trying to achieve. 

 

Chicagolooper

EESignature

Message 9 of 11

O_Eckmann
Mentor
Mentor
Accepted solution

Hi,

 

Remember that Attributs are character even if you store numeric data, so they can't be managed by units settings.

 

Once your data are imported, select all of your blocks, and run ATTOUT command to export all attributs to TXT file (tab separate)

Drag&drop TXT file to Excel, remove columns which doesn't have to be modified (except first column which must stay without any modification), and specify number of digit you want on your numeric data. Save your txt File and use ATTIN to import bak TXT rounded value to attributs.

 

Olivier

Olivier Eckmann

EESignature

Message 10 of 11

ChicagoLooper
Mentor
Mentor

@rodney.morrisseyNXQ5H 

<<…with numbers that are distances and are formatted to one decimal places….>>

 

Aww, c’mon. Really?

 

Help the Forum so the Forum can help YOU.

 

What are those distances and why are they relevant? Explain, provide screenshots, or make a video. Illustrate or explain what you’re trying to achieve. The forum is free education, not espionage, and I doubt you’re CIA. 

 

The process works best when you explain your end goal and the Forum designs a workflow so you can get there. It’s not so good when you say I-wanna-use-blocks-and-only-blocks-cuz-that’s-wut-I-already-started-using-and-don’t-wanna-use-any-other-way. 

Chicagolooper

EESignature

Message 11 of 11

rodney.morrisseyNXQ5H
Explorer
Explorer
Using ATTOUT and ATTIN is a quick simple way to reformat the data and will work perfectly.
I didn't know these commands existed but while certainly be remembering them for the future.

Thank-you.
0 Likes