.NET

Reply
Distinguished Contributor
Gaituuth
Posts: 168
Registered: ‎10-28-2005
Message 1 of 4 (251 Views)
Accepted Solution

Table Outline invisible

251 Views, 3 Replies
07-04-2012 01:53 AM

Hi,

 

Is there a property available which changes the oultine of a table to invisible / not printable

By default it prints the lines around and inside the table,

I want to change it that it is not visible on my print, but I don't know which property I should use and how I can do it.

 

anyone?

 

Best regards,

 

Gerald

See cell borders property,

 [CommandMethod("tablevis")]
public static void setGridLinesInvisible()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
PromptEntityOptions opts = new PromptEntityOptions("\nSelect the table:");
opts.SetRejectMessage("\nMust be the table only...");
opts.AddAllowedClass(typeof(Table), true);
PromptEntityResult res = ed.GetEntity(opts);
if (res.Status != PromptStatus.OK) return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
DBObject obj = tr.GetObject(res.ObjectId, OpenMode.ForRead, false) as DBObject;
Table tbl = obj as Table;
if (tbl==null) return;
tbl.UpgradeOpen();
tbl.Cells.Borders.Bottom.IsVisible = false;
tbl.Cells.Borders.Top.IsVisible = false;
tbl.Cells.Borders.Right.IsVisible = false;
tbl.Cells.Borders.Left.IsVisible = false;
tr.Commit();
}
}

 

 

~'J'~

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 4 (242 Views)

Re: Table Outline invisible

07-04-2012 07:01 AM in reply to: Gaituuth

See cell borders property,

       [CommandMethod("tablevis")]
        public static void setGridLinesInvisible()
        {
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            Database db = doc.Database;
            PromptEntityOptions opts = new PromptEntityOptions("\nSelect the table:");
            opts.SetRejectMessage("\nMust be the table only...");
            opts.AddAllowedClass(typeof(Table), true);
            PromptEntityResult res = ed.GetEntity(opts);
            if (res.Status != PromptStatus.OK) return;
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                DBObject obj = tr.GetObject(res.ObjectId, OpenMode.ForRead, false) as DBObject;
                Table tbl = obj as Table;
                if (tbl==null) return;
                tbl.UpgradeOpen();
               tbl.Cells.Borders.Bottom.IsVisible = false;
               tbl.Cells.Borders.Top.IsVisible = false;
               tbl.Cells.Borders.Right.IsVisible = false;
               tbl.Cells.Borders.Left.IsVisible = false;
                tr.Commit();
            }
        }

 

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Distinguished Contributor
Gaituuth
Posts: 168
Registered: ‎10-28-2005
Message 3 of 4 (210 Views)

Re: Table Outline invisible

07-11-2012 12:38 PM in reply to: Hallex

thx for the reply it was exactly what I was looking for, sometime you don't see the trees in the forest.:smileywink:

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 4 of 4 (207 Views)

Re: Table Outline invisible

07-11-2012 12:57 PM in reply to: Gaituuth

Me too...

But glad if this helps,

Cheers :smileyhappy:

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!