Message 1 of 4
How to add current layout to SSM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I've been trying to write a program that adds the current layout tab to the SSM. So far I have this:
AcSmAcDbLayoutReference layRef = new AcSmAcDbLayoutReference();
layRef.SetName(LayoutManager.Current.CurrentLayout);
string name = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Name;
layRef.SetFileName(name);
AcSmSheet sheet = sheetSet.ImportSheet(layRef);
My program crashes with "Object reference not set to an instance of an object." when it tries the "AcSmAcDbLayoutReference.SetFileName" method. There is no documentation so I have no idea if I'm doing this right. Any help would be appreciated!!
James LeVieux