TheSwamp
Code Red => .NET => Topic started by: A_LOTA_NOTA on April 15, 2011, 10:02:59 AM
-
I was tring to use LISP to get a list of selected tabs but I'm not sure it can be done. Can it be done in C#?
-
Yes
From the arxmgd help:
Layout.TabSelected Property
public bool TabSelected;
Description
Accesses the layout tab is included in the selection set for operations that affect multiple tabs. The user can perform multiple selection via the user interface using shift-click.
Conditions
Read / Write
-
Thanks for the reply. Being a noob I still haven't been able to get this to work. Can someone please post some example code.
-
Can you post what you've tried?
-
I think I got it...
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acDB = acDoc.Database;
Editor ed = acDoc.Editor;
using (Transaction tr = acDB.TransactionManager.StartTransaction())
{
DBDictionary layoutDic = tr.GetObject(acDB.LayoutDictionaryId, OpenMode.ForRead) as DBDictionary;
foreach (DBDictionaryEntry entry in layoutDic)
{
Layout lay = tr.GetObject(entry.Value, OpenMode.ForRead) as Layout;
if (lay.TabSelected == true)
{
ed.WriteMessage("\n" + lay.LayoutName);
}// end if
}// end foreach
tr.Commit();
}// end transaction
-
:-)
-
From the arxmgd help:
Layout.TabSelected Property
public bool TabSelected;
Description
Accesses the layout tab is included in the selection set for operations that affect multiple tabs. The user can perform multiple selection via the user interface using shift-click.
Conditions
Read / Write
Jeff,
Pardon my novice question but how did you find this information? I have downloaded the ObjectARX SDK and copied the CHM files into the Help folder of my AutoCAD Program Files. The ObjectARX sections now appear in my VLIDE Help, but doesn't seem to be included when the Help is Searched. Also, is this the best application to use to view these help files?
Lee
-
Hi Lee,
I just have a shortcut that points directly to that chm file. When it is opened direct, the search works fine. I haven't added them to the normal acad help documents since R2008 as I found this easier for me.
I also use the Object Browser inside Visual Studio which has a search of it's own. Sometimes I don't need the 'complete' definition, just seeing what properties are available and what is returned is enough to move on.
-
Many thanks Jeff - I'll see what I can do following your advice :-)
-
Fantastic Jeff - works splendidly 8-)