Display Plot Styles?

Display Plot Styles?

Anonymous
Not applicable
690 Views
2 Replies
Message 1 of 3

Display Plot Styles?

Anonymous
Not applicable

I'm trying to develop an app that if possible will check if the "Display plot styles" is turned on in the drawing's "page setup". I've been looking through the "Developer and ObjectARX Help" for any reference to it that I could find. I'm wondering if its even possible to accomplish this using .NET ?

 

Any help would be appreciated!

0 Likes
Accepted solutions (1)
691 Views
2 Replies
  • .net
Replies (2)
Message 2 of 3

jabowabo
Mentor
Mentor
Accepted solution
        public static bool GetShowPlotStyles(ref bool doShowPlotStyles)
        {
            Document doc = AcadApp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            bool didSuceed = false;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                try
                {
                    // Get the Layout Manager
                    LayoutManager layoutMgr = LayoutManager.Current;
                    // get current layout
                    Layout layout = (Layout)tr.GetObject(layoutMgr.GetLayoutId(layoutMgr.CurrentLayout), OpenMode.ForRead);

                    // Get the PlotInfo from the layout
                    PlotInfo plotInfo = new PlotInfo();
                    plotInfo.Layout = layout.ObjectId;

                    // Get a copy of the PlotSettings from the layout
                    PlotSettings ps = new PlotSettings(layout.ModelType);
                    ps.CopyFrom(layout);
                    // get the setting
                    doShowPlotStyles = ps.ShowPlotStyles;
                    didSuceed = true;
                }
                catch
                {
                }

                tr.Commit();
            }// End of transaction

            return didSuceed;
        }
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you for the quick reply! I over looked that one in the Developer Guide! Thank you!!!!

0 Likes