.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hyperlinks in attribute values and tables

8 REPLIES 8
Reply
Message 1 of 9
vince1327
1492 Views, 8 Replies

Hyperlinks in attribute values and tables

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;

 

8 REPLIES 8
Message 2 of 9
adam.nagy
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
Autodesk Platform Services
Message 3 of 9
vince1327
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

Message 4 of 9


@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\">%";

 


Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 9

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

 

Cheers

Vince

Message 6 of 9

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

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 7 of 9

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. 

Message 8 of 9
fieldguy
in reply to: vince1327

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

Message 9 of 9
vince1327
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost