LISP I made to bring in layouts that include xrefs from a template not attaching the xrefs

LISP I made to bring in layouts that include xrefs from a template not attaching the xrefs

fabi_rm94
Enthusiast Enthusiast
497 Views
4 Replies
Message 1 of 5

LISP I made to bring in layouts that include xrefs from a template not attaching the xrefs

fabi_rm94
Enthusiast
Enthusiast

Having a difficult situation here. I made a LISP that essentially automates the "layout" command and brought in specific pages from a template. The situation is that those pages have pdf xref's that I need to be referenced into the individual project Im bringing the pages to, but the xrefs are not attaching and the pdf pages are not coming in. I've messed about with changing the relative paths to absolute in the template but nothing changes. Does anybody have any idea how to solve this?

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

pendean
Community Legend
Community Legend
Not seeing your LISP, can you share it here?

And while you wait... is this the functionality you seek by chance https://apps.autodesk.com/ACD/en/Detail/Index?id=4083540461254954651&appLang=en&os=Win32_64
0 Likes
Message 3 of 5

fabi_rm94
Enthusiast
Enthusiast
(defun c:DISHAPPB ( / )

  	(vl-load-com)

	(command "layout" "template" "C:\\Users\\Fabian.Ruiz\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\APPENDIX_B-DISHHH.dwt" "R-1"
		 
  		 "layout" "template" "C:\\Users\\Fabian.Ruiz\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\APPENDIX_B-DISH.dwt" "R-2"
		 
  		 "layout" "template" "C:\\Users\\Fabian.Ruiz\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\APPENDIX_B-DISH.dwt" "R-3"
		 
  		 "layout" "template" "C:\\Users\\Fabian.Ruiz\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\APPENDIX_B-DISH.dwt" "R-4"
		 
  		 "layout" "template" "C:\\Users\\Fabian.Ruiz\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\APPENDIX_B-DISH.dwt" "R-5")

    (setq master-list
         (list "G-001"
               "R-1"
               "R-2"
               "R-3"
               "R-4"
               "R-5"
              ) ;_ end list
  ) ;_ end setq
  (setq tab-list (vl-remove "Model" (layoutlist)))
  (setq i 1)
  (setq layouts
         (vla-get-layouts
           (vla-get-activedocument (vlax-get-acad-object))
         ) ;_ end vla-get-layouts
  ) ;_ end setq

  (foreach
        tab-name
                master-list
    (foreach
          existing-tab
                      tab-list
      (if (wcmatch existing-tab tab-name)
        (progn
          (vla-put-taborder (vla-item layouts existing-tab) i)
          (setq i (+ i 1))
        ) ;_ end progn
      ) ;_ end if
    ) ;_ end foreach
  ) ;_ end foreach
  
  )
0 Likes
Message 4 of 5

fabi_rm94
Enthusiast
Enthusiast

Doesn't look like it mentions anything in that LM program about bringing in xrefs, it just sounds like Design Center. My problem is solely with bringing in items that are externally referenced (xref)

0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

2 suggestions (layoutlist) does not return "MODEL" so no need to remove (vla-get-layouts does.

 

Why would you not put your templates in say

"c:\company\Templates" and add to support paths 

(command "layout" "template" "APPENDIX_B-DISHHH.dwt" "R-1")

Much easier to remember where they live

0 Likes