Populating "Hyperlink" property from shape files.

Populating "Hyperlink" property from shape files.

stefan_helmer
Enthusiast Enthusiast
342 Views
0 Replies
Message 1 of 1

Populating "Hyperlink" property from shape files.

stefan_helmer
Enthusiast
Enthusiast

Hi All,

My task here is to import a pile of points from a shape file in to Autocad.  The SHP has an attribute that is a hyperlink.  My goal is to get that attribute in to the Hyperlink property of each point object as it is brought in to Autocad so that I can later make a PDF with some clickable points.

 

If there is a direct way to do this on import, I'd love to know that, but I haven't been able to do that.  I think instead, I'd like to bring in the points with the URL as an Object Data attribute, and then maybe have a lisp routine go through all the points and populate the Hyperlink property with the value from the OD attibute.

 

I'm not very good with LISP, but I found this post that seems very close to what I need, but not quite:

http://www.cadtutor.net/forum/archive/index.php/t-52639.html

 

;;21st Dec 2010, 01:21 pm
;;create the attribute "HYPERLINK" and use these lisp.
;;A2H puts data from the HYPERLINK attribute as hyperlink to that block.
(defun c:a2h ( / ss ) (vl-load-com)
;; © JM 2010

(if (ssget '((0 . "INSERT") (66 . 1)))
(progn
(vlax-for obj
(setq ss
(vla-get-ActiveSelectionSet
(vla-get-ActiveDocument (vlax-get-acad-object))
)
)
(mapcar
(function
(lambda ( x )
(if (eq "HYPERLINK" (strcase (vla-get-TagString x)))
(vla-Add (vla-get-Hyperlinks obj) (vla-get-Textstring x))
)
)
)
(vlax-invoke obj 'GetAttributes)
)
)
(vla-delete ss)
)
)

(princ)
)

Could anyone comment on this, or maybe suggest a completely different approach?

 

Thanks for your time!!

 

 

0 Likes
343 Views
0 Replies
Replies (0)