Dj_T_Rex2002 Posted April 6, 2018 Posted April 6, 2018 Hi, I wanted to see if someone could help me out? I am trying to find a lisp that can help me insert a hyperlink "name" to an object. I am not using it to actual set a hyperlink but to assign a name to the object. Example ... I have TONS of grid lines. So what I do is I type Hyperlink>Select Object (in this case I select the line)> then assign the "Text to Display" and "Type the file or Web page name" as C10 ... I use this so I don't have to keep zooming in and out or without creating extra layers. When zoomed in really close to the drawing I can just hoover over the line and it'll tell me the name ... so I would just like to type HTXT and for it to prompt me to "Assign Name" and then "Select the Object" or Select Object first then Assign Name. Thanks in advanced Quote
Hippe013 Posted April 6, 2018 Posted April 6, 2018 (defun c:htxt ( / ss obj hlinks str) (setq ss (ssget ":s")) (if ss (progn (setq obj (vlax-ename->vla-object (ssname ss 0))) (setq hlinks (vlax-get-property obj 'Hyperlinks)) (setq str (getstring "\nEnter Hyperlink: ")) (vla-add hlinks str) ) ) (princ) ) Quote
Hippe013 Posted April 6, 2018 Posted April 6, 2018 I will patiently wait for the request of a lisp to remove all hyperlinks in a drawing. :D Quote
hanhphuc Posted April 6, 2018 Posted April 6, 2018 I will patiently wait for the request of a lisp to remove all hyperlinks in a drawing. :D test (defun c:xurl (/ en) (if (setq en (car (entsel "\nSelect entity.. "))) (vlax-for x (vla-get-hyperlinks (vlax-ename->vla-object en)) (vla-delete x)) ) (princ) ) Quote
Dj_T_Rex2002 Posted April 9, 2018 Author Posted April 9, 2018 ROFL sounds like a good idea haha Quote
Dj_T_Rex2002 Posted April 9, 2018 Author Posted April 9, 2018 This is what I needed, thanks so much Quote
GLORY Posted August 19, 2022 Posted August 19, 2022 (edited) Hello guys, Is there any possible way to link a batch of images to text or mtext content? (eg. content of the text or mtext is same as the filename of a certain image). I am thinking for a lisp the will select all the text or mtext in a certain layer and hyperlink the content to the corresponding filename of the image file in a certain folder. Thank you. Edited August 19, 2022 by GLORY Quote
BIGAL Posted August 23, 2022 Posted August 23, 2022 I did a staff locality plan that has a staff image, I just used their phone number as image name and just searched for block got number and vla-addraster at that point. Like 100 images in one go. I just redid the dwg each time it was updated saving as new dwg. It only took like 1 minute to do. Try this will need directory change and image scale. Change the ssget to get text etc. ; routine to insert images based on a block position ; By Alan H (vl-load-com) (defun *error* ( msg ) (princ "\nerror: ") (alert (strcat "\n Missing phone number image" name)) (princ) ) (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setvar "clayer" "staffimages") (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "phnum")))) ;block name is phnum (setq len (sslength ss1)) (setq x 0) ; then insert block value at x,y ; need to pull out block find x,y and value (repeat len (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 x )) 'getattributes) (if (= "PHNUM" (strcase (vla-get-tagstring att))) ; tagname is phnum (progn (setq blknum (vla-get-textstring att)) (setq inspt (vla-get-insertionpoint att)) ) ) ) (setq name (strcat "P:\\B St Offices\\" blknum ".jpg" )) (princ (strcat "\n" name)) (vla-AddRaster mspace name inspt 1.5 0.0) (setq x (+ x 1)) ) ;repeatlen (setq ss1 nil) (princ "all done" (princ) Quote
smitaranjan Posted December 14 Posted December 14 hi guys, can hypertext be created through lisp for matchline number with same page number of page sequence? Quote
BIGAL Posted December 14 Posted December 14 (edited) If your talking about layouts then could link to current tab (setq x (vla-get-taborder lay)). You can use taborder as a field property, not sure if that works in a hypertext. Ps taborder as field is not supported in Bricscad V24 has been reported. Edited December 14 by BIGAL Quote
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.