svorgodne Posted August 31, 2011 Share Posted August 31, 2011 Can anybody please explain me what are the seturl and geturl "commands", "system variables", "autolisp function" or whatever they may be and how can I use them in Autolisp? If possible. Thanks a lot in advance Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 31, 2011 Share Posted August 31, 2011 I'm glad you asked this question, as I can really use these. Here's what I found (so far): ... SETURL Two handy functions when working with URLs and lisp are seturl and geturl. (SETURL ename "URL string") The SETURL function expects two variables: the entity name and the URL string. Example: (seturl (car (entsel)) "http:/www.autodesk.com") This example prompts the user to select an object. Once the object is selected' date=' the URL string is attached to that object.[/size'] GETURL The counterpart to seturl is geturl. (GETURL ename) The GETURL function expects one variable -- the entity name. GETURL returns the URL string from an entity. If no URL string is found, it returns nil. Example: (geturl (car (entsel))) This example prompts the user to select an object. Once the object is selected, the URL string is displayed back to the user. If there is no URL string associated with the selected object, nothing happens. ... linky (scroll down) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 31, 2011 Share Posted August 31, 2011 These are merely the Vanilla AutoLISP equivalents of adding hyperlinks to the Hyperlinks Collection of an Object, except that you cannot add a Description or NamedLocation using these functions like you can with the Hyperlinks Collection. Note also that the VL Hyperlinks collection is equivalent to, in Vanilla AutoLISP, xData (App: "PE_URL") appended to the entity - so this could be added using entmod. Example, compare the entity DXF data (maybe using this) after using each of these functions: (defun c:test1 ( / e ) (if (setq e (car (entsel "\nSelect Object to Add Hyperlink to: "))) (seturl e "http://www.google.co.uk") ) (princ) ) (defun c:test2 ( / e ) (if (setq e (car (entsel "\nSelect Object to Add Hyperlink to: "))) (vla-add (vla-get-hyperlinks (vlax-ename->vla-object e)) "http://www.google.co.uk") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 31, 2011 Share Posted August 31, 2011 Certainly; there's just something 'nice' about having simple, SET* & GET* functions. ... For example. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 31, 2011 Share Posted August 31, 2011 Certainly; there's just something 'nice' about having simple, less functional, undocumented, SET* & GET* functions. Fixed that for you. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 31, 2011 Share Posted August 31, 2011 Wow... thanks?? Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 31, 2011 Share Posted August 31, 2011 Quote Link to comment Share on other sites More sharing options...
svorgodne Posted August 31, 2011 Author Share Posted August 31, 2011 Thanks a lot to both of you, it was really difficult to find an answer, nor in AutoCAD help nor the internet. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 31, 2011 Share Posted August 31, 2011 I don't know why Autodesk perpetuates functionality of LISP functions that they ultimately UN-document. These functions WERE documented at one time... That's how I found the above information on my first Google search (top three results). If they (Autodesk) have replaced these functions with newer 'more capable' functions, or simply made available the Hyperlinks Collection, so be it. Svorgodne posed a specific inquiry, and I was able to (I hope?) answer their question, and learned something new myself along the way. I'm not asking anyone to use these functions, nor did I claim that they were comparable to the VL functionality. As a matter of fact, I boldly called them 'nice'. That's it. If someone has an issue with the failings of these functions, write a letter to Autodesk. Just saying. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.