Jump to content

Recommended Posts

Posted

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

Posted
(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)
 )

Posted

I will patiently wait for the request of a lisp to remove all hyperlinks in a drawing. :D :D :D

Posted
I will patiently wait for the request of a lisp to remove all hyperlinks in a drawing. :D :D :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)
    )

Posted

ROFL sounds like a good idea haha

Posted

This is what I needed, thanks so much

  • 4 years later...
Posted (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 by GLORY
Posted

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)

 

  • 2 years later...
Posted

hi guys, can hypertext be created through lisp for matchline number with same page number of page sequence?

Posted (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 by BIGAL

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...