.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loop through layouts in the layoutmanager

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
2209 Views, 2 Replies

Loop through layouts in the layoutmanager

How can I loop through every Layout in DatabaseServices.LayoutManager.Current

Or any way really. I need to loop through every layout of a drawing, change some PlotSettings.

Thanks in advanced
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

This should show you a way.


* Found here http://www.autocad.ru/cgi-bin/f1/board.cgi?t=26588Fa
* Posted by: detox
* Date: 7/31/2006

[CommandMethod("GetLayoutNames")]
static public void GetLayoutNames()
{
ED ed = App.DocumentManager.MdiActiveDocument.Editor;
Database db = HostApplicationServices.WorkingDatabase;
Transaction trans = db.TransactionManager.StartTransaction();
try
{
DBDictionary layoutDict =
(DBDictionary)trans.GetObject(db.LayoutDictionaryId, OpenMode.ForRead);
Int32 iLayout = 0;
foreach (DictionaryEntry id in layoutDict)
{
Layout ltr = (Layout) trans.GetObject((ObjectId)id.Value,
OpenMode.ForRead);
ed.WriteMessage("\nLayout N{0} = {1}", ++iLayout, ltr.LayoutName);
}
trans.Commit();
}
finally
{
trans.Dispose();
}
}

--

Tim
"A blind man lets nothing block his vision."


wrote in message news:5744558@discussion.autodesk.com...
How can I loop through every Layout in
DatabaseServices.LayoutManager.Current

Or any way really. I need to loop through every layout of a drawing, change
some PlotSettings.

Thanks in advanced
Message 3 of 3
Anonymous
in reply to: Anonymous

Perfect!

thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost