Inserting a layout (tab page) from a template with a lisp isn't bringing in the pdf underlays (xrefs) in that page. Solutions??

Inserting a layout (tab page) from a template with a lisp isn't bringing in the pdf underlays (xrefs) in that page. Solutions??

fabi_rm94
Enthusiast Enthusiast
776 Views
10 Replies
Message 1 of 11

Inserting a layout (tab page) from a template with a lisp isn't bringing in the pdf underlays (xrefs) in that page. Solutions??

fabi_rm94
Enthusiast
Enthusiast

Wrote a simple lisp that allows me to bring in the tabs from a template into my current drawing. The lisp brings in everything I need EXCEPT for the xref pdf underlays, which do not appear at all. Is there another step I can write into the lisp to bring those in?

(defun c:STDGENSUP (/ BNAME LAYOUTNAME acadObj adoc ss AcDbBlkRef)

(command "layout" "template" "C:\\Users\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\BUP_Supplemental-sheets-template.dwt" "R-616"
		 
  		 "layout" "template" "C:\\Users\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\BUP_Supplemental-sheets-template.dwt" "R-608"
		 
  		 "layout" "template" "C:\\Users\\AppData\\Local\\Autodesk\\AutoCAD 2020\\R23.1\\enu\\Template\\BUP_Supplemental-sheets-template.dwt" "R-609")

    (command "layout" "rename" "R-616" "R-601"
	     
	     "layout" "rename" "R-608" "R-602"

	     "layout" "rename" "R-609" "R-603" )
  

 (vla-endUndoMark adoc)
 (vlax-release-object adoc)

 (setvar "cmdecho" 1) 
 (princ)
); c:STDGENSUP

 

Above is the code I have, and I've attached the template Im bringing the tab pages from. I appreciate any guidance. 

0 Likes
Accepted solutions (1)
777 Views
10 Replies
Replies (10)
Message 2 of 11

paullimapa
Mentor
Mentor

yes, I recall recently learning from another posts here about that limitation with pdfs not coming over.


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

fabi_rm94
Enthusiast
Enthusiast

Do you know of any way I could bypass this issue somehow? I can try bringing in the pdfs through a lisp that uses pdf-insert, but I would have to create so many more things to bring in everything else and it would be incredibly painful, whereas just inserting the layout page exactly how I want it from an existing template would save everybody lots of time.

0 Likes
Message 4 of 11

paullimapa
Mentor
Mentor
0 Likes
Message 5 of 11

fabi_rm94
Enthusiast
Enthusiast

Ok, I think Im getting somewhere now. Do you know of any way to attach all the xrefs from a template into a different file? If I do write that process within the code prior to bringing in the layout, I think this could work 

0 Likes
Message 6 of 11

paullimapa
Mentor
Mentor

What’s the problem with the this method

https://forums.autodesk.com/t5/autocad-forum/how-to-insert-a-template/td-p/6963606#


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

fabi_rm94
Enthusiast
Enthusiast

The xrefs are not copying correctly using this method. The pdf overlays disappear completely.

0 Likes
Message 8 of 11

paullimapa
Mentor
Mentor

Please clarify “not copying correctly “


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

fabi_rm94
Enthusiast
Enthusiast

The pdf overlays that are xref in the template do not appear when I bring in the template layout to another drawing. They disappear 

0 Likes
Message 10 of 11

paullimapa
Mentor
Mentor
Accepted solution

Yes we already covered that as an AutoCAD limitation regarding inserting templates with PDFs inside xrefs and I provided for you a link with Autodesk solutions. So unfortunately there’s no other way to get around this limitation 


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

Sea-Haven
Mentor
Mentor

The only other way may be make a text file that has layout name and all the pdf details so the layout is copied from the dwt then the pdf are Attached according to the information in the text file.

0 Likes