+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Full Member
    Computer Details
    Alaskachick's Computer Details
    Operating System:
    Windows XP, 32-bit
    Computer:
    Dell Precision M6400
    Using
    AutoCAD 2010
    Join Date
    Jul 2009
    Location
    Alaska
    Posts
    41

    Default Hyperlinks in Block Attributes?

    Registered forum members do not see this ad.

    I have a block. In it's attributes is a tag called "website". The block attribute value is a url or http:// that leads you to a picture. The block is repeated throughout the drawing with different values for each website tag that should take you to a different picture for each block occurrence.

    Currently, the text appears as dumb text, not as a hyperlink. I understand manually attaching a hyperlink to an drawing object. This is different in that I want autocad to automatically recognize that the block attribute text is a link and allow the user to click on the text in the properties window and the picture open.

    Does autocad recognize text as links like word or excel does? For example: if you type anything in a word document that starts with http://... word will recognize it as a link and give it link functionality. I need autocad to do this.

    It could be that this link functionality can only be used with object data and not with block attributes. That would limit me to only using civil 3D, but I can live with that.

    Any ideas?
    I draw with Electronic Crayons.

  2. #2
    Senior Member edwinprakoso's Avatar
    Computer Details
    edwinprakoso's Computer Details
    Operating System:
    Windows 7 Home Premium
    Computer:
    Sony Vaio T11
    RAM:
    6 GB
    Graphics:
    Intel HD4000
    Using
    AutoCAD 2013
    Join Date
    Nov 2009
    Location
    Jakarta, Indonesia
    Posts
    275

    Default

    AutoCAD will not recognize the text as url automatically. You need to use field to make a text a hyperlink. The same thing you need to use in block attributes.
    You can edit the url later in block attributes, but as I said, AutoCAD doesn't convert text automatically to hyperlink.
    Edwin Prakoso
    cad-notes.com

    The work doesn't matter if it's not built

  3. #3
    Full Member
    Computer Details
    Alaskachick's Computer Details
    Operating System:
    Windows XP, 32-bit
    Computer:
    Dell Precision M6400
    Using
    AutoCAD 2010
    Join Date
    Jul 2009
    Location
    Alaska
    Posts
    41

    Default

    Quote Originally Posted by edwinprakoso View Post
    AutoCAD doesn't convert text automatically to hyperlink.
    Which begs the question, "Why not?" The automatic link function of word, excel and other programs is not a new tool. It seems AutoCAD could easily incorporate it. Maybe I need to figure out a lisp for that...
    I draw with Electronic Crayons.

  4. #4
    Full Member
    Computer Details
    Alaskachick's Computer Details
    Operating System:
    Windows XP, 32-bit
    Computer:
    Dell Precision M6400
    Using
    AutoCAD 2010
    Join Date
    Jul 2009
    Location
    Alaska
    Posts
    41

    Default

    I followed your advice and tried to make a block attribute value a hyperlink in block editor. It looks good in the block editor but when I regen and go to that block attribute in properties there is no hyperlink functionality. I have tried ctrl-click and rt click...all to no avail. Also, it does not apply the hyperlink to all occurrences of the block in the drawing.

    Shouldn't I be able to set a block attribute's value in the block editor to hyperlink and then every instance of that block will have a hyperlink in the value for that attribute no matter what the text?

    Thanks for the help.
    I draw with Electronic Crayons.

  5. #5
    Full Member
    Using
    Electrical 2011
    Join Date
    Dec 2010
    Posts
    53

    Default

    Registered forum members do not see this ad.

    create the attribute "HYPERLINK" and use these lisp.
    A2H puts data from the HYPERLINK attribute as hyperlink to that block.
    Code:
    (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)
    )

Similar Threads

  1. Convert Block w/ Attributes to Block
    By 3rdElle in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 16th Jul 2010, 01:32 pm
  2. block in block insert attributes
    By johny4901 in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 10th Jun 2010, 08:37 pm
  3. Block Attribute answers ability to change block Physical Attributes??
    By Kaidoz in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 19th Mar 2008, 10:25 pm
  4. Getting Attributes for one block reference w/many block inserts?
    By muck in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 17th Oct 2006, 03:38 am
  5. creating block attributes without a block name
    By geordieboy in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 19th Feb 2006, 03:49 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts