.NET

Reply
Member
David9818
Posts: 3
Registered: ‎09-18-2013
Message 1 of 3 (109 Views)
Accepted Solution

How to lock the format of a Table Cell in C#

109 Views, 2 Replies
05-06-2014 10:42 AM

Hi, I have created a table with several cells and wanted to lock the cell format in C#. I have searched the web and couldn't find anything about that. Could someone shed me some light on how to do this? Thanks a lot!

 

Hi,

 

Depending of the Autocad version you can use SetCellState (it's obsolete now, but I don't know since when) or Table.Cells[i,j].State to lock the format of a table cell, this are the permited cell states:

 

[Wrapper("AcDb::CellState"), Flags]
public enum CellStates {
ContentLocked = 1,
ContentModifiedAfterUpdate = 8,
ContentReadOnly = 2,
FormatLocked = 0x10,
FormatModifiedAfterUpdate = 0x40,
FormatReadOnly = 0x20,
Linked = 4,
None = 0
}

 

Gaston Nunez

 

 

 

Distinguished Mentor
gasty1001
Posts: 529
Registered: ‎04-11-2010
Message 2 of 3 (102 Views)

Re: How to lock the format of a Table Cell in C#

05-06-2014 12:48 PM in reply to: David9818

Hi,

 

Depending of the Autocad version you can use SetCellState (it's obsolete now, but I don't know since when) or Table.Cells[i,j].State to lock the format of a table cell, this are the permited cell states:

 

[Wrapper("AcDb::CellState"), Flags]
public enum CellStates {
  ContentLocked = 1,
  ContentModifiedAfterUpdate = 8,
  ContentReadOnly = 2,
  FormatLocked = 0x10,
  FormatModifiedAfterUpdate = 0x40,
  FormatReadOnly = 0x20,
  Linked = 4,
  None = 0
}

 

Gaston Nunez

 

 

 

Member
David9818
Posts: 3
Registered: ‎09-18-2013
Message 3 of 3 (90 Views)

Re: How to lock the format of a Table Cell in C#

05-07-2014 06:15 AM in reply to: gasty1001
I am using AutoCAD 2010. It works great. Thanks Gaston!
David
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.