Lisp does update table

Lisp does update table

thomas_huntFMPXR
Contributor Contributor
256 Views
4 Replies
Message 1 of 5

Lisp does update table

thomas_huntFMPXR
Contributor
Contributor

any tips to correct this the table will not update with new link.

0 Likes
257 Views
4 Replies
Replies (4)
Message 2 of 5

paullimapa
Mentor
Mentor

I see all kinds of errors after you enter 2 

Can you share your lisp and share a dwg with datalinks using etransmit command?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 5

thomas_huntFMPXR
Contributor
Contributor

(defun c:2 ( / linkname filepath range )
;; VARIABLES
(setq linkname "SystemDescription") ; Name of your data link
(setq newPath (getfiled "Select new Excel file" "" "xlsx" 0)) ; Full path to Excel file
(setq range "EXPORTTOCAD!B2:I16") ; Sheet name and range

;;MODIFYDATA LINK
(prompt (strcat "\n🔄 Modifying data link: " linkname))
(vl-cmdf "_-DATALINK" "Edit" linkname "Path" filepath "Format" "Range" range "")

;;REFRESH TABLES
(prompt "\n🔄 Refreshing linked tables...")
(command "_DATALINKUPDATE" "All" "K") ; "K" keeps formatting

(prompt "\n Excel link modified and tables updated.")
(princ)
)

0 Likes
Message 4 of 5

Moshe-A
Mentor
Mentor

@thomas_huntFMPXR ,

 

(vl-cmdf "_-DATALINK" "Edit" linkname "Path" filepath "Format" "Range" range "")

 

Looks like the error arise from the above call that uses filepath as an argument but it is not defined in the function, maybe

it should be replaced with newPath?

 

Moshe

 

0 Likes
Message 5 of 5

thomas_huntFMPXR
Contributor
Contributor

Still the same error 

 

0 Likes