.NET

.NET

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

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

117 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: 582
Registered: ‎04-11-2010
Message 2 of 3 (110 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 (98 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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.