You are here:

AutoCAD/Assigning ID to Polylines in AutoCAD

Advertisement


Question
QUESTION: Mr Scott,

Good morning, I am Purushotham working with Fugro Peninsular (Fugro group). I have a problem in assigning the ID or any property to Polyline features in AutoCAD.

To be precise we are doing mapping of pipelines for oil and gas industry (within refinery). I have pipeline drawing but it doesn't have any properties, each pipeline no is placed as an text on top of the line.

But i have the other attributes for these pipelines in external database. Now the issue is i want to link this external database to this pipelines (polyline features) automatically in autocad.

To do this i need to have the some common field in drawing as well as in external database (Access).

Now how do i assign this pipeline id to this polylines (which should be inherited to line not as separate text on top of it).

Your suggestions and solutions are greatly appreciated.

Regards
Purushotham
00-974-5864573

ANSWER: Entity handles are unique identifiers generated by autocad that don't change between sessions, etc. they are a hexadecimal number and can be used for what you want. you'll probably need to write some sort of routine to link them, if you want to store that handle in the database. it's not an easy process, and would require some programming.

There is a way to link entities to database rows built-in to autocad, where you can link an entity to a row in the database that would not require any programming. Look for 'database links' in autocad help for several articles on this.

---------- FOLLOW-UP ----------

QUESTION: Mr. Scott

Thanks for the mail and answer, i went through the autocad online help about the database links, now i am familiar with linking the external database to the objects in autocad drawing.

Now i am able to link the external database to the points which are block referance automatically, without any programming.

But my problem is i am unable to link the line features to external database automatically, i can do it manually by looking each id in autocad (which is placed as text on each line) with the database.

But if i can give this unique id with line property i can automate this linking of external database with lines in autocad drawing.

Please advice me how can i assign or inherite some property (uin this case pipeline id which is unique for each pipeline inturn line feature) in autocad drawing.

Your quick response is highly appreciated.

Answer
Not possible with built-in autocad, this would require a lisp routine to do, and if the text in line is a separate entity it would not be possible to automate it 100% because I assume you want to associate the link to the line and not the text. if you want to associate it to the label text then it would be easier. however, still would require some programming. I've done something like this before for a city agency that was working with manholes, sewer lines, etc. it was a complex project that cost them about $2000, and there were certain assumptions that could be made (layers) that made the process easier to automate for them. they were also using autocad map that had some features we took advantage of. so there is no easy free answer here.

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scott Cook

Expertise

I`ve been using AutoCAD since 1987 and programming AutoLISP nearly as long. I can answer questions about programming AutoCAD (except ARX) and production enhancement techniques. I cannot answer questions about AutoCAD crashes or DWG corruption. AutoCAD PROGRAMMING (menus, lisp) related questions only!

Experience

Since 1987. Author of Plot2000 software for for AutoCAD, http://www.plot2000.com. PROGRAMMING QUESTIONS ONLY PLEASE. Questions that are NOT related to programming or AutoCAD customization (menus and lisp only please) are outside the scope of my volunteer services and will NOT BE ANSWERED.

©2012 About.com, a part of The New York Times Company. All rights reserved.