Jump to content

Points coordinates and hyperlink from table


notister

Recommended Posts

Hi,

I have a table with three columns: X, Y, LINK

I'd like to populate a point layer from this table with points located at X and Y coordinates and the hyperlink automatically filled from LINK column (this is a path to a external file different for any point).

Table is in MSaccess but I can convert it in other formats or ascii text file.

is that possible maybe with scripts or other tools?

thank you very much in advance

 

Mario

Link to comment
Share on other sites

You can automatically import points with coordinates into Civil 3D. There is no way to natively do it in vanilla AutoCad as far as I am aware although there is probably a lisp script available to accomplish it.

Link to comment
Share on other sites

Hi,

I have a table with three columns: X, Y, LINK

I'd like to populate a point layer from this table with points located at X and Y coordinates and the hyperlink automatically filled from LINK column (this is a path to a external file different for any point).

Table is in MSaccess but I can convert it in other formats or ascii text file.

is that possible maybe with scripts or other tools?

thank you very much in advance

 

Mario

 

In a rudimentary way, this will work....

The opening "lst" variable is just a sample of data.

You'll have to get some more code to read the CSV data and convert to a lisp lists (there should be plenty of examples out there, probably even here) - or I suppose you may even be able to get your data in the format below with some fancy word processor/excel automation...?

Anyway....the (foreach) is the guts that creates the points and adds the hyperlink.

If you have thousands or tens of thousands or more, then it would make sense to rewrite this with more efficient code -- this is just a quickie...

Tested in an empty, clean drawing, v2011.

 

(setq lst (list
    (list 1.0 1.0 "http://www.google.com")
    (list 5.0 6.0 "http://www.cadtutor.net")
    (list 3.5 4.2 "http://www.yahoo.com")
  )
)
(foreach k lst
 (setq x (nth 0 k)
y (nth 1 k)
h (nth 2 k)
 )
 (vl-cmdf "._point" (list x y 0.0))
 (command "._-hyperlink" "_I" "_O" "_L" "" h "" "")
)  

Link to comment
Share on other sites

rkmcswain,

this is what I was looking for. I've thousands of points but I can write a little routine that converts database records in lisp list.

 

thank you very much

 

Mario

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...