← Inbox

C3DO-0898 · 261101: vicinity map embedded as OLE (no link) - paste [C3D-VICOLE1101] done

Parks the broken linked raster 214A0 (file missing) on frozen V-R21-OFF, switches to 11X17 paper space and pastes the R21 vicinity map from the clipboard as an embedded OLE picture at 0.6575,5.82 (upper-left). No file reference. Skips if 11X17 already has an OLE frame.

Script file
C3DO-0898.cs
Target
261101 - 5491 Roswell Rd NE R2-C3DCP.dwg · model space
Author
claude
Approved
yes · auto-auth
Timeout
60s

C# payload

ObjectId H(string h)=>Db.GetObjectId(false,new Handle(Convert.ToInt64(h,16)),0);
var ld=(DBDictionary)Tx.GetObject(Db.LayoutDictionaryId,OpenMode.ForRead);
var lay=(Layout)Tx.GetObject(ld.GetAt("11X17"),OpenMode.ForRead);
var ps=(BlockTableRecord)Tx.GetObject(lay.BlockTableRecordId,OpenMode.ForRead);
int ole=0; foreach(ObjectId id in ps) if(Tx.GetObject(id,OpenMode.ForRead) is Ole2Frame) ole++;
if(ole>0){ Log("11X17 already has "+ole+" OLE frame(s) - not pasting again"); return; }
// park the broken linked raster (file missing) on the frozen V-R21-OFF layer - not erased
var ri=(Autodesk.AutoCAD.DatabaseServices.Entity)Tx.GetObject(H("214A0"),OpenMode.ForWrite);
string old=ri.Layer; ri.Layer="V-R21-OFF"; Log("linked raster 214A0 (missing file): layer "+old+" -> "+ri.Layer+" (frozen)");
var lm=LayoutManager.Current; if(lm.CurrentLayout!="11X17"){ lm.CurrentLayout="11X17"; }
Log("current layout: "+lm.CurrentLayout);
Doc.SendStringToExecute("_.PSPACE _.PASTECLIP 0.6575,5.82 ", true, false, false);
Log("queued PASTECLIP of the clipboard map at upper-left 0.6575,5.82 (embedded OLE, no file)");

Result

Status
success
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\261101 - Project\261101 - 5491 Roswell Rd NE R2-C3DCP.dwg
Message
Executed C3DO-0898 (0 entities touched).
Entities
—
Duration
1136 ms
Civil 3D
25.0.0.0

Log

linked raster 214A0 (missing file): layer BLOCK_CLOSURE -> V-R21-OFF (frozen)
current layout: 11X17
queued PASTECLIP of the clipboard map at upper-left 0.6575,5.82 (embedded OLE, no file)

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.