Author Topic: PDF Paths  (Read 2518 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1443
PDF Paths
« on: September 11, 2014, 06:45:56 PM »
Ok, I know I can change xRef paths with -xref path option. But how do I change the paths of PDFs without using anything that requires (vl-load-com)?

I need to do this through the ACCoreConsole, which is why I have this limitation.
« Last Edit: September 11, 2014, 07:02:12 PM by cmwade77 »

ronjonp

  • Needs a day job
  • Posts: 7529
Re: PDF Paths
« Reply #1 on: September 11, 2014, 07:21:19 PM »
This is untested but may give you ideas:
Code - Auto/Visual Lisp: [Select]
  1. (defun _foo (pdfname newpath / d)
  2.   (and (setq d (dictsearch (namedobjdict) "ACAD_PDFDEFINITIONS"))
  3.        (setq d (dictsearch (cdr (assoc -1 d)) pdfname))
  4.        (entmod (subst (cons 1 (strcat newpath pdfname ".pdf")) (assoc 1 d) d))
  5.   )
  6. )
  7. ;; (_FOO "TEST" "C:\\DIR\\")
« Last Edit: September 11, 2014, 08:41:37 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: PDF Paths
« Reply #2 on: September 11, 2014, 07:41:00 PM »
I am not sure what the (strcat newpath) or should the code be:
Code: [Select]
(defun _foo (pdfname newpath / d)
  (and (setq d (dictsearch (namedobjdict) "ACAD_PDFDEFINITIONS"))
       (setq d (dictsearch (cdr (assoc -1 d)) pdfname))
       (entmod (subst (cons 1 (strcat newpath pdfname ".pdf")) (assoc 1 d) d))
  )
)

ronjonp

  • Needs a day job
  • Posts: 7529
Re: PDF Paths
« Reply #3 on: September 11, 2014, 08:42:08 PM »
Sorry .. Fixed above.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7529
Re: PDF Paths
« Reply #4 on: September 12, 2014, 10:31:55 AM »
Did it work ?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: PDF Paths
« Reply #5 on: September 12, 2014, 11:21:58 AM »
Did it work ?
I am not sure yet, I haven't had time to test it......darn work keeps getting in the way of making lisp routines.  :-D

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: PDF Paths
« Reply #6 on: September 15, 2014, 02:36:11 PM »
I finally managed to test it and it is not working.

Edit: Ok, I see why, it's because I have multipage PDFs, which affect the PDF names in this code, so now I have to figure out how to handle this.
« Last Edit: September 15, 2014, 02:47:31 PM by cmwade77 »