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?
Solved! Go to Solution.
Solved by ronjonp. Go to Solution.
@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)
)
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 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)
)
attached is updated code
change the URL in the code here:
Can't find what you're looking for? Ask the community or share your knowledge.