Discovered Publish does not use cached xrefs. Chat gpt summary of what methods do and do not use them...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I had a user complain publish was taking forever on a planset.
It was indeed, maybe a minute per sheet.
Hand opening a sheet took seconds, and plot command a few more.
Why the heck was publish slow?
I realized it was the xref loading, as I had opened one of the sheets to get the xrefs cached.
Opens on other sheets were fast.
Publish does not do this though, it ignores the .ac$ cached xrefs no matter what.
full convo here:
Summary at end was:
Which “open” paths use the .ac$ cache?
Yes = uses .ac$ if valid (a “warm open”)
No = ignores .ac$ and cold-loads from the real xref path
Command line / UI
OPEN (typed/clicked): Yes
OPEN via SendCommand: Yes
SCRIPT file that calls OPEN: Yes
Sheet Set Manager → Open sheet DWG: Yes
RECOVER, AUDIT, -INSERT as block, etc.: Generally No (special pipelines; expect full reads)
.NET / ObjectARX / APIs
DocumentCollection.Open(path, …): No (new AcDbDatabase; cold)
Database.ReadDwgFile(path, …) (side DB): No (cold)
HostApplicationServices.WorkingDatabase = new Database(...); ReadDwgFile(...): No
Editor.Command("_.OPEN", path) (i.e., programmatic command): Yes (same as SendCommand)
Publish / Batch
Publish (Background ON): No (separate context/headless; cold)
Publish (Foreground OFF): No (still fresh doc per sheet; cold)
Sheet Set Manager → Publish: No (same as above)
Custom batch that uses OPEN (via script/SendCommand) then plots: Yes (warm per DWG), while the DWG remains open
Custom batch that uses DocumentCollection.Open then plots: No (cold per DWG)
Other caches (don’t conflate these)
In-RAM per-document cache: exists only while a DWG is open. Helps when plotting multiple layouts of the same DWG. Lost on close. No cross-document sharing.
OS file cache: Windows may keep file contents in memory after first read; any method can benefit indirectly, but it’s not AutoCAD’s .ac$ logic.
Practical picks (by goal)
Fastest “open many DWGs, plot their layouts” without Publish
Use a Session command that drives: OPEN (via SendCommand or Editor.Command) → plot all layouts via Plot API → CLOSE → next file.
You get warm open (uses .ac$) and warm within-doc (layouts share the in-RAM state).
Robust code-only open (no UI commands), don’t care about warm
DocumentCollection.Open or ReadDwgFile (side DB). Expect cold loads.
One DWG, many layouts
Any method is fine; the speed win comes from staying in the same DB instance (no re-opens).
I thought this was pretty cool.
I never realized most api methods ignore the xref cache.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties