Results 1 to 2 of 2

Thread: Changing of excel file path in datalink

  1. #1
    Member
    Join Date
    2019-08
    Posts
    4
    Login to Give a bone
    0

    Default Changing of excel file path in datalink

    I've done hours or research and I can't find the answer: is it possible to change the excel file in a datalink using AutoLISP statements?

    In other words for a given datalink, I want to change the excel file. This is doable from the datalink window by editing the datalink.

    thank you

  2. #2
    Member
    Join Date
    2005-07
    Posts
    40
    Login to Give a bone
    0

    Default Re: Changing of excel file path in datalink

    Quote Originally Posted by cyware784241 View Post
    I've done hours or research and I can't find the answer: is it possible to change the excel file in a datalink using AutoLISP statements?

    In other words for a given datalink, I want to change the excel file. This is doable from the datalink window by editing the datalink.

    thank you


    Give this a whirl …

    Code:
    (setq datalinkDict (dictsearch (namedobjdict) "ACAD_DATALINK"))
    (setq datalink (dictsearch (cdr (assoc -1 datalinkDict)) "TEST"))
    (setq datapath (vl-string-subst "C:\\PATH\\CHANGE_TO_VALUE" "C:\\PATH\\ORIGINAL_VALUE" (cdr (assoc 301 datalink)))) 
    (entmod (subst (cons 301 datapath) (assoc 301 datalink) datalink))
    I believe placed datalinks will used assoc 301 and unused links will be assoc 302.

    "TEST" is the name of the datalink, if all you are doing is updating the path all you should need to do is work out the logic and substitute "C:\\PATH\\CHANGE_TO_VALUE" "C:\\PATH\\ORIGINAL_VALUE" respectively.

    Good luck.

    Rob

Similar Threads

  1. 2015: DATALINK Command - Excel Datalink without Dialog Box
    By ddowdy in forum AutoCAD General
    Replies: 0
    Last Post: 2014-12-13, 02:39 PM
  2. Replies: 1
    Last Post: 2009-06-16, 09:39 PM
  3. Datalink Path in Vlisp program
    By rklee in forum AutoLISP
    Replies: 6
    Last Post: 2009-02-03, 05:20 AM
  4. Excel and Datalink formatting
    By clarkmorgan in forum AutoCAD General
    Replies: 4
    Last Post: 2008-10-03, 05:01 PM
  5. Keep Excel Borders when creating a datalink table
    By mzavala in forum AutoCAD Tables
    Replies: 1
    Last Post: 2007-12-14, 07:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •