• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Distinguished Contributor
    vince1327
    Posts: 117
    Registered: ‎11-02-2011

    Hyperlinks in attribute values and tables

    151 Views, 8 Replies
    05-15-2012 01:10 PM

    Hey guys,

     

    I've been going through older posts with not too much luck. Using C# (VS2010, Acad2012) i've created a block, imported it, given it the required attibute tags and values, and then created an array out of this block for a total of "x" identical blocks for our purposes. As these blocks are desigend to represent real-world products, is there any way that one of my attribute values can reflect a hyperlink to the manufacturers datasheet?

     

    So essentially

     

    Product Info http://www.google.ca/testproduct.pdf

     

     

    Also, one of my functions lists all of the blocks in the current drawing and tallys them up and drops them into a table where it reports the block name, details, and quantity. I would also like this block name to be a hyperlink as well...is this doable?

     

    Cheers

    Vince

     

    *** Edted for spelling and code

     

    AttributeDefinition attDef15 = new AttributeDefinition(new Point3d(0d, 0d, 0d), productinfo, "Web Link", "", db.Textstyle);
                        attDef12.Invisible = true;

     

    Please use plain text.
    ADN Support Specialist
    Posts: 211
    Registered: ‎03-26-2007

    Re: Hyperlinks in attribute values and tables

    05-15-2012 07:04 PM in reply to: vince1327

    Hi,

     

    You could add a hyperlink to each block reference. The same that you can achieve in the user interface using the HYPERLINK command. With that you can assign a URL to any entity (inc. a block reference) so that if the user hovers above the entity then information with the URL will come up, and if the user presses Ctrl+Click, then the browser comes up with the given URL.

     

    Actually, what you asked should also be possible, i.e. to set an attribute reference's value to a URL, by including a field type called hypertext, e.g. like

    %<\AcVar \href "http://www.autodesk.com##www.autodesk.com#0">%

     

    There, again, the user could just click on the attribute text and get to the given website.

     

    I hope this helps.

     

    Adam Nagy

    Autodesk Developer Network



    Adam Nagy
    Developer Technical Services
    Autodesk Developer Network
    Please use plain text.
    Distinguished Contributor
    vince1327
    Posts: 117
    Registered: ‎11-02-2011

    Re: Hyperlinks in attribute values and tables

    05-16-2012 05:20 AM in reply to: adam.nagy

    Great thanks adam. I've been trying however no luck though, is my hyperlink a string value?

     

    for example:

     

    string url = "%<\AcVar \href "http://www.autodesk.com##www.autodesk.com#0">%"

     

    or is there another way to do this. The first set of quotes encompassing the link tends to throw things off.

     

    Cheers

    Vince

    Please use plain text.
    Moderator
    Alexander.Rivilis
    Posts: 1,168
    Registered: ‎04-09-2008

    Re: Hyperlinks in attribute values and tables

    05-16-2012 09:30 PM in reply to: vince1327

    vince1327 wrote:

    Great thanks adam. I've been trying however no luck though, is my hyperlink a string value?

     

    for example:

     

    string url = "%<\AcVar \href "http://www.autodesk.com##www.autodesk.com#0">%"

     

    or is there another way to do this. The first set of quotes encompassing the link tends to throw things off.

     

    Cheers

    Vince


    Maybe like this:

    string url = "%<\\AcVar \\href \"http://www.autodesk.com##www.autodesk.com#0\">%";

     



    Пожалуйста не забывайте про Утвердить в качестве решения!Утвердить в качестве решения и Give Kudos!Баллы
    Please remember to Accept Solution!Accept as Solution and Give Kudos!Kudos

    Please use plain text.
    Distinguished Contributor
    vince1327
    Posts: 117
    Registered: ‎11-02-2011

    Re: Hyperlinks in attribute values and tables

    05-17-2012 05:16 AM in reply to: Alexander.Rivilis

    Thanks Alexander. When i do this, the URL shows up in my properties window but is not clickable...is this normal?

     

    Cheers

    Vince

    Please use plain text.
    Moderator
    Alexander.Rivilis
    Posts: 1,168
    Registered: ‎04-09-2008

    Re: Hyperlinks in attribute values and tables

    05-17-2012 05:29 AM in reply to: vince1327

    What about Ctrl+Left Mouse Button click on attribute in drawing?


    Пожалуйста не забывайте про Утвердить в качестве решения!Утвердить в качестве решения и Give Kudos!Баллы
    Please remember to Accept Solution!Accept as Solution and Give Kudos!Kudos

    Please use plain text.
    Distinguished Contributor
    vince1327
    Posts: 117
    Registered: ‎11-02-2011

    Re: Hyperlinks in attribute values and tables

    05-17-2012 05:33 AM in reply to: Alexander.Rivilis

    That doesn't seem to be working...It seems as though the hyperlink isn't being treated any differently than any other attribute. I can click it, select it, etc....but it doens't behave as a hyperlink, just as a standard attribute. 

    Please use plain text.
    Valued Mentor
    Posts: 297
    Registered: ‎03-31-2005

    Re: Hyperlinks in attribute values and tables

    05-17-2012 09:48 AM in reply to: vince1327

    Try the attached.  It needs to be inserted into some drawing.

    Please use plain text.
    Distinguished Contributor
    vince1327
    Posts: 117
    Registered: ‎11-02-2011

    Re: Hyperlinks in attribute values and tables

    05-17-2012 09:57 AM in reply to: fieldguy

    Thanks fieldguy...so that does work...but i think i'm just explaining this badly...What i'm trying to do is get the attribute value that shows up in the property window to be clickable. I know how to create hyperlinks in the drawing itself, but is it possible to make an attribute value a hyperlink? So that way if i click a filter for instance, the model number, size, etc, all pop up as attributes in the properties window, and then i have a hyperlink there that links directly to the manufacturers datasheet

     

    Cheers

    Vince

    Please use plain text.