# Run LISP routine on external documents

**URL:** <https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538>\
**Category:** Civil 3D\
**Created:** [September 30, 2025, 2:34pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538 "2025-09-30T14:34:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbrunkhorst](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrunkhorst](https://forum.dynamobim.com/u/jbrunkhorst)\
**Post date:** [September 30, 2025, 2:34pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/1 "2025-09-30T14:34:09Z")

</div>

Does anyone have any ideas on how I can batch run a LISP routine in a set of external .dwg’s? I am inserting a block into a bunch of .dwg’s in a Dynamo script right now, but I need to run attsync on files to update the attributes of the block. I have a LISP routine that does attsync on all blocks called attsyncall.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 30, 2025, 2:58pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/2 "2025-09-30T14:58:04Z")

</div>

Why not just build the node/code to do the attsync in Dynamo? While there isn’t a direct API call it’s certainly doable via the API, as indicated in this external forum post form 2013: [https://www.theswamp.org/index.php?topic=31859.msg508802#msg508802](https://www.theswamp.org/index.php?topic=31859.msg508802#msg508802)

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [September 30, 2025, 10:39pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/3 "2025-09-30T22:39:50Z")

</div>

Showing my age & a bit off-topic for this forum, but you don’t need a LISP routine- just a script

In Excel, create a batch file as follows- replacing drawing names etc, with one line per drawing

`“C:\Program Files\Autodesk\AutoCAD 2025\acad.exe” “C:\Users\YourUser\Documents\MyDrawing.dwg” /b “C:\Users\YourUser\Scripts\MyScript.scr”`

Create a script file (MyScript.scr) as follows- replacing with your block name:

`ATTSYNC`  
`Name`  
`blockname`

I’d be surprised if it took more than 5 mins

---

<div class="post-metadata">

**Author:** ![jbrunkhorst](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@jbrunkhorst](https://forum.dynamobim.com/u/jbrunkhorst)\
**Post date:** [October 7, 2025, 6:13pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/4 "2025-10-07T18:13:38Z")

</div>

I used this and ChatGPT to create a python script that seems to work pretty well!

With one major caveat… it doesn’t work on file with a viewport in the external file. I am well beyond my knowledge now, so my information comes from ChatGPT, but ChatGPT said the viewports have XData with them and its causing the script to fail on files with viewports in them. Is there a way to avoid this so I can leave the viewports in the file? Or have I gone down a path with ChatGPT that I shouldn’t have.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/b/1bb380013adef621b00c0bb2083623ab42a9d7a7.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [October 8, 2025, 5:51am UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/5 "2025-10-08T05:51:59Z")

</div>

Not sure - it would help to have the script you’re using. Weighing in on chat gpt’s thoughts won’t be a good use of anyone’s time.

---

<div class="post-metadata">

**Author:** ![AdammReilly](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/adammreilly/32/95902_2.png) [@AdammReilly](https://forum.dynamobim.com/u/AdammReilly)\
**Post date:** [October 9, 2025, 12:29pm UTC](https://forum.dynamobim.com/t/run-lisp-routine-on-external-documents/112538/6 "2025-10-09T12:29:24Z")

</div>

You could also use the Batch Save Utility. This allows you to run a script against a series of selected files. You could potentially use it to do the original insert and then run the attsync command. In your current case, it could be used to just run through all the files and run attsync since you already have a lisp routine.
