Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a working code for the mtext match orientation to layout, but it won't set the match orientation to layout in bricscad. Anyone have any working code for the match orientation to layout in bricscad?
The acMText.SetPaperOrientation(true); does not work with bricscad, only works with autocad.
Here is my code:
#if BRX_APP
Document doc = Bricscad.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
#elif ACAD_APP
Document doc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
#endif
Database acCurDb = doc.Database;
using (doc.LockDocument())
{
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
MText acMText = acTrans.GetObject(id, OpenMode.ForWrite, false) as MText;
ObjectContextManager ocm = acCurDb.ObjectContextManager;
ObjectContextCollection occ = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES");
if (isAnnotation == true)
{
acMText.Annotative = AnnotativeStates.True;
acMText.SetPaperOrientation(true);
#if BRX_APP
try
{
acMText.AddContext(occ.CurrentContext);
}
catch { }
#elif ACAD_APP
try
{
ObjectContexts.AddContext(acMText, occ.CurrentContext);
}
catch { }
#endif
}
else
{
acMText.Annotative = AnnotativeStates.False;
acMText.SetPaperOrientation(false);
}
acTrans.Commit();
}
}
Solved! Go to Solution.