TheSwamp

Code Red => .NET => Topic started by: Bryco on March 08, 2017, 07:07:58 PM

Title: Sheet set placeview command
Post by: Bryco on March 08, 2017, 07:07:58 PM
New to sheetsets so have some problems.
1) In begin command I make a nonplot layer active whick puts the viewport on that layer.
2) In end command I make the previous layer active again then
case "PLACEVIEW":
                    ObjectId brefId = Autodesk.AutoCAD.Internal.Utils.EntLast();
                    using (Transaction tr = db.TransactionManager.StartTransaction())
                    {
                        BlockReference br = tr.GetObject(brefId, OpenMode.ForWrite) as BlockReference;
                        if (br == null) return;

                        doc.Editor.WriteMessage(Environment.NewLine + br.Name);
                        if (br.Name != "Viewport Title Callout") return;                       
                        br.UpgradeOpen();
                        br.Layer = Layers.Layers.NAnnotation();
                        doc.Editor.WriteMessage(Environment.NewLine + br.Layer);                     
                        tr.Commit();
                    }
                    break
both the name and the layer print correctly but the blockref assumes the current layer (which is not the noplot layer)

the callouts addressed must the same way
case "CALLOUT":      behave themselves.

Anybody have a fix for this? Cheers in advance