Send polyline layer name information to the object data exactly field

Send polyline layer name information to the object data exactly field

Barzdil
Advocate Advocate
1,610 Views
8 Replies
Message 1 of 9

Send polyline layer name information to the object data exactly field

Barzdil
Advocate
Advocate

           Hello to all, I'm new here and want to ask, maybe someone knows how to solve this problem without specially designed new large programming? I'm using Autocad civil 2016.
           I attached a sample of how should look like polylines in different layers, and where has to "come" layer name information in the object data.
          The information must "travel" as follows:
the name of each polylines layer = the value in the field named "CODE" in the object data table.
          For example:
   polyline, who's layer name is "1", has to have an attached object data table, in which is a field called "CODE" and the value of this field has to be "1" ;
   another polyline, who's layer name is for example "2", has to have an attached object data table, in which is a field called "CODE" and the value of this field has to be "2" .
   and so on.......
          The main difficulty of the task is that I have to fill oject data tables like this sometimes to 50 and sometimes to 100 polylines (which are in different layers), and they are completely "empty" in object data fields. So the question is how to do it in the quickest way. Maybe there is some kind of lisp already created, or maybe some MAP function command can solve this task.
          Thank you for your cooperation in advance.

0 Likes
Accepted solutions (1)
1,611 Views
8 Replies
Replies (8)
Message 2 of 9

CADaSchtroumpf
Advisor
Advisor

Hi,

See this post

Message 3 of 9

parkr4st
Advisor
Advisor

The only question I need clarified is do you want one table for all the lines or one table for each line?

 

The command MAPEXPORT with Select attributes set as in the image will put the needed data into on table for all lines as in the .sdf file.

 

Selecting one line and MAPEXPORT can make a  table with data for only that line.

 

Dave

Message 4 of 9

Barzdil
Advocate
Advocate

           Hello CADaStroumph, thanks a lot for Your help. It works for me. I just want to ask one more think. Is there a fairly "simple" way, for myself to change-add to LISP "transfert_OD" information, to which I could add more OD tables, because sometimes I have to use one or two OD tables in my drawing, and sometimes I need about 20 different OD tables. Because I'm not familiar with LISP, so the question is how to change LISP, that I would not be asked by program to tag objects manually, but I could change LISP in this way, that specific layers would come to specific OD tables. Let's say, for example, is there a way to be possible to write-change LISP, that layers "1" "2" 3" would come in OD table "A" automatically, and the layers "85" "86" "87" in the OD table "B" automatically. If You could show me the way, where exactly and how to upgrade-add information to LISP to do these things, I would be very grateful. Or maybe somewhere I could find, maybe You could recommend some LISP literature to find out how to change-add this information in simple way enough. Thanks o lot.

0 Likes
Message 5 of 9

Barzdil
Advocate
Advocate

        Hello Dave, thanks for information. As I just wrote to 

0 Likes
Message 6 of 9

parkr4st
Advisor
Advisor

Look at the attached sdf file.  all the data for all the towns can be put in the one table and you can query what you need for any town(s).  you should be able to structure OD one OD table similar and work with cad objects from that.

 

dave

0 Likes
Message 7 of 9

CADaSchtroumpf
Advisor
Advisor
Accepted solution

It is difficult for me because I miss the time and it requires a more complex code.
However, I tried to improve the lisp 'transfer_OD' so that it is easier to use without changing the source code.

BE CAREFUL, if the type of value is not the same and you choose to convert them (example real -> string),
it is the SOURCE table field that will be converted, and depending on the capabilities of the function (ade_odmodifyfield) see the help, to correlate the two types of data. NOTE THIS!

If you immediately restart the transfer_od command, the transfers of the news fields you select will be applied to the previous selection. That's all I can offer you ...

0 Likes
Message 8 of 9

Barzdil
Advocate
Advocate

          Good day. Thank you for your suggestion. Somehow, mapexport mapimport works with me only when exporting in .MIF format. Neither SDF nor SHP works with me, I mean does not fill in the OD table 😞 😞

0 Likes
Message 9 of 9

Barzdil
Advocate
Advocate

       Hello. In any case, your way is very much to be considered, it's only necessary to adapt it to the specifics of each user. Thank you very much for your help.

0 Likes