AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Date field to object field

15 REPLIES 15
Reply
Message 1 of 16
majid.hamed-hobi
1031 Views, 15 Replies

Date field to object field

date field

Hi everyone

 

I read your answers in AutoCAD community, it was very smart.

 

I hope to get your help to solve this issue.

 

I want to make a field for date in table with command Adedefdata.

I have just 4 choccies, Integer, Real, characters, and point.

is there a way to add date to this table please?

also, the number of each field for example character not exceed more than 38 letters.


 

 

 

thanks in advance

Majid

Tags (1)
15 REPLIES 15
Message 2 of 16

ADEDEFDATA is not a "plain AutoCAD" command (to my knowledge). Are you using a "vertical" product?

 

Can you simply insert a field directly in the table cell, which points to the system date property (or one of the other date properties), using your preferred format?:

dmfrazier_0-1664545268139.png

 

Message 3 of 16

Thanks 

But I am mean the field with the command ADEDEFDATA that I can make a tabel. after that I will attach these field with my drawing. I use AutoCad 3D map. see attachment

 

thanks again

Message 4 of 16
user181
in reply to: majid.hamed-hobi

Why can't you use the character option?  Are you looking for it to update each day?  You can't get it to update but when you attach the data to an object you can enter the current date before you select the objects. It won't change the value of existing objects. Or are you trying to do something else?

EESignature


Message 5 of 16

Thanks for your replay.

We have specifications and parameters that must be followed. 
Because this data will be joined with other data. (from GIS systems for exampel). In order not to conflict and unify this data in one way with other programs.

regards

Message 6 of 16
user181
in reply to: majid.hamed-hobi

I don't understand why you can't use the characters option and type the date in whatever form you want to appear. 

EESignature


Message 7 of 16

Because these data will join with other data from other programs, so that this field must be with the date style only.

I think you know if I chose the charecters style or real; that mean these data will reject by another field with date style that with it created.

 

regards

Message 8 of 16

Hi,

 

If I remember well, object data has been developped in 1998 (for MAP V2) and have never been updated.

Only 4 data type exist. No possibility to update or add new type.

In 1998 object data were created to store data to exchange with SHP (field name limited to 10 caracter).

It has been a little extended to store topology information, but never extend or update since 25 years.

 

What you could do, is to store only an integer field (ID of an object), and connect this ID to external database (Access, SQLite, SQL server, Oracle...) which could implement more data type and more control on values.

 

Olivier

Olivier Eckmann

EESignature

Message 9 of 16
parkr4st
in reply to: O_Eckmann

Two options come to mind.  

MAPEXPORT the data to a SDF file with OD to attributes and use the date function in the data table calculations to attach the date.  Save the layer to a new SDF file and MAPIMPORT back to cad objects with attached OD if that is what is to worked with

Create a SDF file and draft the objects and fill the data table for each object with a date field in the table.

That file can be MAPIMPORTed to cad objects with attached OD.

Message 10 of 16
majid.hamed-hobi
in reply to: parkr4st

not work also

Message 11 of 16

Hello @majid.hamed-hobi 

Sorry but you can't do that. Based on your description, you are trying to insert a FIELD into an Object Data Table' and that's not possible.

 

Using object data (OD) makes plain vanilla AutoCAD objects smart. Object data is commonly attached to points, lines and polygons to make them smart because the OD attached to them can be used populate a shapefile's database file (dbf) if and when they are exported to shapefile (MAPEXPORT).

 

OD is also found attached to AutoCAD entities that have already been imported (MAPIMPORT) from ESRI shapefiles. This occurs during the MapImport procedure when the Data Attributes in the shapefile is read, captured and turned into OD.

 

<<A shapefile's database can make object data and object data can populate a database.>>

 

Data, whether AutoCAD object data or shapefile data attributes, can be queried. Smart AutoCAD entities may have one or more Tables attached to them. AutoCAD OD is written and stored in an OD Table whereas shapefiles have their data stored in a dbf.

 

To make OD, you need to make an OD table first. When the Table is attached to your drawn objects, you make those objects smart. You insert data into a new or existing table. The data in a table can be string, integer, point or real, also known as characters, whole number, coordinates and decimals, respectively. 

1. Object data table.1. Object data table.

 

 

You can insert an AutoCAD Field in AutoCAD entities such as mtext, blocks and tables, but you can't insert a Field into an Object Data Table.

2. AutoCAD field.2. AutoCAD field.

 

An AutoCAD field, such as DATE, is dynamic. To update the DATE field you can use the command Regen All, or REA, and you'll see the date field become current. Both Object Data and shapefile data attributes are static so if they need to be changed  you have to do it manually.   

Chicagolooper
Message 12 of 16

Thanks for your answer, I still search to add more than four types (Character, Integer, real and points) like date to be five types or more.

the insert field date like text is easy to do that, my problem with OD field to insert DATE field.

Now I have long way but is long way by connect autocad with QGIS to modified the field or add some field.

But I am still amazed that AutoCAD is unable to meet these requirements of users.

 

thank you again

majidhamedhobi_0-1665047515002.png

 

Message 13 of 16

@majid.hamed-hobi 

 

AutoCAD does not permit you to insert a field as object data.

 

You can insert a field in mtext.

You can insert a field in a Table.

You can insert a field into a block attribute. 

 

If you want to insert a DATE as object data then it must be an integer, such as 20221006. Or real, such as 2022.1006. Or string, such as 6oct2022.

 

Object Data cannot be a field.

 

Chicagolooper
Message 14 of 16

I've also been waiting for Autocad to look into this issue for a number of years.

 

My team would love to export directly to shapefiles.

 

But the lack of options around object data fields means it's not possible to setup the fields in line with the required GIS specifications.

For instance I need to set the length of text fields, length and precision of number fields and set a date field.

 

I've just updated to autocad 2023 and still no more field options. Could autodesk look into this please?

Message 15 of 16

hI @jessica.lynch 

You can use AutoCAD to do all that but Map3D has its own way of doing it. BTW, I agree that the process to manage the data might not be as straightforward as it should be, but it's still doable. 

 

The KEY is to know (a) how to 'attach' the data to the geometry and (b) how to format the attributes according to your specs. Once the attributes are properly attached and formatted, the export-to-shapefile procedure can harvest the OD and populate the database file (dbf).

 

There are various ways to generate the dbf and even though some of them are not as efficient as we'd like them to be, you still maintain all the benefits of drawing the linework (shp) using the Map3D Toolset and that alone makes up for the inefficiencies. 

 

Can you share an actual example of your features and the attributes you wish to format?

 

Chicagolooper
Message 16 of 16
braudpat
in reply to: majid.hamed-hobi

Hello @majid.hamed-hobi 

 

1) When I need a date into an Object Data field, I am using INTEGER field ...

 

2) And I hope that the user will use YYYYMMDD format ! ... So for today : 20230605

So it is easy to test the date and test before / after ...

 

The Health, Bye, Patrice

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


AutoCAD Beta