Author Topic: How customize 'Format' for TableStyle object via .Net?  (Read 2944 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
How customize 'Format' for TableStyle object via .Net?
« on: July 26, 2010, 06:21:19 AM »
How customize 'Format' for TableStyle object via .Net?

(Screen for understanding):



I see it:


but I don't know string formats of second parameter.
« Last Edit: July 26, 2010, 07:13:46 AM by Hwd »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #1 on: July 28, 2010, 07:06:40 AM »
The question is solved

Glenn R

  • Guest
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #2 on: July 28, 2010, 07:55:19 AM »
So others can learn, how did you solve it?

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #3 on: July 28, 2010, 08:33:33 AM »
So others can learn, how did you solve it?
I have thought that to my question do not respond, because it silly. :)

1. Via IAcadTableStyle2.DataType2 to set data type and units.
2. Via IAcadTableStyle2.SetFormat2 to set Format.

For example:
Code: [Select]
//ts2 is IAcadTableStyle2
ts2.SetDataType2(name, AcValueDataType.acDate, AcValueUnitType.acUnitVolume);
ts2.SetFormat2(name, "dd.mm.yyyy");

I search now (for TableStyle):

1. How to set Text Style for specific users Cell Style (Text tab)?
2. How to set vertical and Horizontal Margins for specific users Cell Style (General tab)?
3. How to set, what must use Double Line for specific users Cell Style (Borders tab)?
4. How to set distance between border lines for specific users Cell Style (Borders tab)?
================================================================

I can to set text style for standard cell style (for example - "Data"):
Code: [Select]
ts2.SetTextStyle((int)RowType.DataRow, "Тип А курсив");But I can't do it for specific users Cell Style (I do not know how).

I find it in ObjectArx 2009:

AcDbTableStyle::setMargin
AcDbTableStyle::gridDoubleLineSpacing

but I not find it in .Net API.
« Last Edit: July 28, 2010, 11:03:09 AM by Hwd »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #4 on: July 28, 2010, 10:55:10 AM »
ts2 is IAcadTableStyle2 instance.

It work but I need do it for SPECIFIC CUSTOM cell style:

Code: [Select]
ts2.SetTextStyle((int)(RowType.DataRow | RowType.HeaderRow), "My TextStyle Name");
May be I must use method: IAcadTableStyle2.SetTextStyleId32, but I do not know what must be transfered via second parameter (search help in web - without results).

It not work:
Code: [Select]
ts2.SetTextStyleId32("My TextStyle Name", ts2.GetCellClass("My Cell Style Name"));
//or it:
ts2.SetTextStyleId32("My TextStyle Name", ts.CellStyles.IndexOf("My Cell Style Name"));

« Last Edit: July 28, 2010, 10:58:37 AM by Hwd »

Glenn R

  • Guest
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #5 on: July 28, 2010, 11:10:35 AM »
The name of that function implies that it probably wants an ObjectId of the TextStyleTableRecord to use, as one of it's arguments...

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: How customize 'Format' for TableStyle object via .Net?
« Reply #6 on: July 28, 2010, 11:16:25 AM »
The name of that function implies that it probably wants an ObjectId of the TextStyleTableRecord to use, as one of it's arguments...
second parameter wants int (for SetTextStyleId32) or long (for SetTextStyleId) type.

I find!
Code: [Select]
//ts - is TableStyle object.
//id - is ObjectId of TextStyleTableRecord
ts.SetTextStyle(cid, name);
:)

instance of TableStyle has properties HorizontalCellMargin and VerticalCellMargin. But it properties modify 'Title', 'Header' and 'Data' cell styles at once. But I want to set values for each of cell style individually.

And one moment still: it properties can't set values for custom cell styles.
« Last Edit: July 28, 2010, 11:50:37 AM by Hwd »