+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Full Member
    Using
    AutoCAD 2006
    Join Date
    Aug 2012
    Location
    La Coruña. España
    Posts
    54

    Default Read and create an hyperlink

    Registered forum members do not see this ad.

    Hello. I have two questions.
    1 - I need to read an hyperlink associated with a text. The HYPERLINK is an Excel file. I use this:
    Code:
    (setq nombre_ent (car(entsel "\nSelecciona objeto: ")))
      (setq obj_vla (vlax-ename->vla-object nombre_ent))
      (setq prop (vla-get-hyperlinks obj_vla))

    How do I get the file name?

    2 - How do I create an hyperlink to an Excel file associated with a text?
    The file name is: "C: \ Temp \ Ventas_2012.xls"
    Thank you.

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,709

    Default

    Here are some examples:

    Accessing Hyperlinks:
    Code:
    (defun c:test1 ( / en )
        (if (setq en (car (entsel "\nSelect Object to View Hyperlinks: ")))
            (vlax-for hyp (vla-get-hyperlinks (vlax-ename->vla-object en))
                (print (vla-get-url hyp))
            )
        )
        (princ)
    )
    (vl-load-com) (princ)
    Adding Hyperlinks:
    Code:
    (defun c:test2 ( / en fn )
        (if
            (and
                (setq fn (getfiled "Select a File to Link to" "" "" 16))
                (setq en (car (entsel "\nSelect Object to Add Hyperlink: ")))
            )
            (vla-add (vla-get-hyperlinks (vlax-ename->vla-object en)) fn (vl-filename-base fn))
        )
        (princ)
    )
    (vl-load-com) (princ)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Full Member
    Using
    AutoCAD 2006
    Join Date
    Aug 2012
    Location
    La Coruña. España
    Posts
    54

    Default

    Thank you very much, Master. It is an honor!

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,709

    Default

    You're very welcome robierzo, happy to help.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  5. #5
    Full Member
    Using
    AutoCAD 2010
    Join Date
    May 2009
    Posts
    47

    Default

    Thanks Has done

    Hi Lee

    Super Lisp

    I always have a fixed folder from where I'll get the link
    Can you set it too.
    Thank you

    Hallo Lee

    Super Lisp

    Ich habe immer einen fixen Ordner von wo ich den Hyperlink hole
    Kann man das auch einstellen.
    Danke
    Last edited by dober; 7th Sep 2012 at 08:22 am.

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,709

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by dober View Post
    Super Lisp
    Thank you dober.

    Quote Originally Posted by dober View Post
    I always have a fixed folder from where I'll get the link
    Can you set it too.
    Change:
    Code:
    (setq fn (getfiled "Select a File to Link to" "" "" 16))
    To:
    Code:
    (setq fn (getfiled "Select a File to Link to" "C:\\YourFolder\\" "" 16))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. Hyperlink
    By Bob Foley in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 21st Apr 2011, 04:45 pm
  2. Suppress the read-only notice when opening read-only files?
    By DrewS in forum AutoCAD Drawing Management & Output
    Replies: 10
    Last Post: 14th Jan 2009, 10:31 am
  3. Is it possible to make a read-only sysvar a read/write var?
    By whatispunk in forum AutoCAD General
    Replies: 1
    Last Post: 11th Mar 2006, 11:49 am
  4. Hyperlink I need help
    By meron in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 25th Jan 2006, 07:51 pm

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