Jump to content

Recommended Posts

Posted

looking for a lisp that gives a mark to the option DWG HYPERLINK TO DWF in the hyperlink dialog (ctrl+k)

 

TKS,

 

Mike

Posted

i found something, but i have to drag it from explorer to Autocad, is there a other lisp that kan be loaded from appload.

 

found lisp:

 


(defun markHlinkDWF ()
(setq mysel (ssget "_X" '((-3 ("PE_URL")))))
(setq iMaxSel (sslength mysel))
(setq iCnt 0)
(while (< iCnt iMaxSel)
(setq my_entname (ssname mysel iCnt))
(setq my_ent (entget my_entname '("PE_URL")))
;; get the entity including Xdata for hlinks
(setq my_xdata1 (assoc -3 my_ent))
;; open up the XData
(setq my_xdata_URL (nth 1 my_xdata1))
(setq my_new_xdata_URL (subst '(1071 . 1) '(1071 . 0) my_xdata_URL))
;; enable flag for convert DWG to DWF
(setq my_new_xdata1 (subst my_new_xdata_URL my_xdata_URL my_xdata1))
;; update XData
(setq my_ent (subst my_new_xdata1 my_xdata1 my_ent))
(entmod my_ent)
;; set the entity
(setq iCnt (+ iCnt 1))
)
nil
)
(defun validate ()
(setq mysel (ssget "_X" '((-3 ("PE_URL")))))
(setq iMaxSel (sslength mysel))
(setq iCnt 0)
(setq iFailCnt 0)
(while (< iCnt iMaxSel)
(setq my_entname (ssname mysel iCnt))
(setq my_ent (entget my_entname '("PE_URL")))
;; get the entity including Xdata for hlinks
(setq my_xdata1 (assoc -3 my_ent))
;; open up the XData
(setq my_xdata_URL (nth 1 my_xdata1))
(if (/= (member '(1071 . 0) my_xdata_url) nil)
(setq iFailCnt (+ iFailCnt 1))
)
(setq iCnt (+ iCnt 1))
)
(if (> iFailCnt 0)
(progn
(setq
my_str (strcat (itoa iFailCnt) " hyperlink(s) not updated.")
)
(princ my_str)
nil
)
)
)

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...