Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select all objects with specific hyperlink

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
S_v_d_Markt
506 Views, 7 Replies

Select all objects with specific hyperlink

Hey guys, I'm trying to create a selection set with all objects with a specific hyperlink.

Through commands I can do it through qselect but i figured that won't work in a lisp.

I've looked online but I can't seem to find anything. Can someone please help me?

Labels (4)
7 REPLIES 7
Message 2 of 8
hosneyalaa
in reply to: S_v_d_Markt

Can you attached example drawing

Message 3 of 8
ronjonp
in reply to: S_v_d_Markt

@S_v_d_Markt AFAIK you can't directly filter further than the registered app name. This will select all items ( not nested ) that have a hyperlink and will check if it matches the supplied URL and will create a selection set.

 

(defun c:foo (/ hl s)
  ;; RJP » 2024-06-24
  (cond	((setq s (ssget "_X" '((-3 ("PE_URL")))))
	 ;; Put in your URL here
	 (setq hl (strcase "http://www.google.com"))
	 (foreach e (mapcar 'cadr (ssnamex s))
	   (or (wcmatch hl (strcase (cdadr (cadr (assoc -3 (entget e '("PE_URL"))))))) (ssdel e s))
	 )
	 (sssetfirst nil s)
	)
  )
  (princ)
)

 

 

Message 4 of 8
paullimapa
in reply to: S_v_d_Markt

try attached HplFnd.lsp

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 8
S_v_d_Markt
in reply to: ronjonp

Thank you so much! this is exactly what i was looking for! Only thing is that this selects across different layouts, is it possible to change this to only search in the current layout?

Message 6 of 8
S_v_d_Markt
in reply to: paullimapa

Thank you for the reply, This almost does what i want, i'd like to specify the hyper link in the lisp.
Message 7 of 8
ronjonp
in reply to: S_v_d_Markt


@S_v_d_Markt wrote:

Thank you so much! this is exactly what i was looking for! Only thing is that this selects across different layouts, is it possible to change this to only search in the current layout?


@S_v_d_Markt Give this a try:

 

 

(defun c:foo (/ hl s)
  ;; RJP » 2024-06-25
  (cond	((setq s (ssget "_X" (list (cons 410 (getvar 'ctab)) '(-3 ("PE_URL")))))
	 ;; Put in your URL here
	 (setq hl (strcase "http://www.google.com"))
	 (foreach e (mapcar 'cadr (ssnamex s))
	   (or (wcmatch hl (strcase (cdadr (cadr (assoc -3 (entget e '("PE_URL"))))))) (ssdel e s))
	 )
	 (sssetfirst nil s)
	)
  )
  (princ)
)

 

 

Message 8 of 8
paullimapa
in reply to: S_v_d_Markt

attached is updated code

change the URL in the code here:

paullimapa_0-1719326509577.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report