スタイル

COM API では、ルート ドキュメント オブジェクトによってスタイルが保持されます。.NET API では、スタイルは StylesRoot 型のオブジェクトで、StyleBase から継承したスタイル オブジェクトを持つ、CivilDocument.Styles の下にあります。StyleBase オブジェクトのスタイル属性を取得して設定する際には、プロパティよりも GetDisplayStyle*() メソッドを使用することが必要になります。次に、COM VBA からの例を示します。

oAlignmentStyle.ArrowDisplayStyle2d.Visible = False
oAlignmentStyle.ArrowDisplayStyle3d.Visible = False
' Display curves using violet.
oAlignmentStyle.CurveDisplayStyle2d.color = 200 ' violet
oAlignmentStyle.CurveDisplayStyle3d.color = 200 ' violet
oAlignmentStyle.CurveDisplayStyle2d.Visible = True
oAlignmentStyle.CurveDisplayStyle3d.Visible = True

VB.NET での 同等コード:

oAlignmentStyle.GetDisplayStyleModel(AlignmentDisplayStyleType.Arrow).Visible = False
oAlignmentStyle.GetDisplayStylePlan(AlignmentDisplayStyleType.Arrow).Visible = False
' Display curves using violet.
oAlignmentStyle.GetDisplayStyleModel(AlignmentDisplayStyleType.Curve).Color = Autodesk.AutoCAD.Colors.Color.FromRgb(191, 0, 255) ' violet
oAlignmentStyle.GetDisplayStylePlan(AlignmentDisplayStyleType.Curve).Color = Autodesk.AutoCAD.Colors.Color.FromRgb(191, 0, 255) ' violet
oAlignmentStyle.GetDisplayStyleModel(AlignmentDisplayStyleType.Curve).Visible = True
oAlignmentStyle.GetDisplayStylePlan(AlignmentDisplayStyleType.Curve).Visible = True