Solid Edge Draft Type Library
ConductorTables Property
Solid Edge Draft Type Library > DraftDocument Object : ConductorTables Property
Description
Returns the associated ConductorTables object for the referenced DraftDocument object.
Property type
Read-only property
Syntax
Visual Basic
Public Property ConductorTables As ConductorTables
Example
Imports System.Runtime.InteropServices

Module Module1

    Sub Main()
        Dim objSEApplication As SolidEdgeFramework.Application
        Dim objDraftDoc As SolidEdgeDraft.DraftDocument
        Dim ConductorTable As SolidEdgeDraft.ConductorTable
        Dim ConductorTables As SolidEdgeDraft.ConductorTables
        Dim DrawingView As SolidEdgeDraft.DrawingView
        Dim StrFail As String

        Dim Titles As SolidEdgeDraft.TableTitles
        Dim Title As SolidEdgeDraft.TableTitle
        Dim Columns As SolidEdgeDraft.TableColumns
        Dim Column As SolidEdgeDraft.TableColumn
        Dim Rows As SolidEdgeDraft.TableRows
        Dim Row As SolidEdgeDraft.TableRow
        Dim Cell As SolidEdgeDraft.TableCell
        Dim Page As SolidEdgeDraft.TablePage

        Dim ListSavedSettings(2) As String
        Dim initialMarginH As Double
        Dim ii As Integer
        Dim strTableStyle As String
        Dim objAnchorPt As Object
        Dim intNumSavedSettings As Integer
        Dim arrList(10) As Object
        Try
            objSEApplication = Marshal.GetActiveObject("SolidEdge.Application")

            objDraftDoc = objSEApplication.ActiveDocument
            ConductorTables = objDraftDoc.ConductorTables
            DrawingView = objDraftDoc.ActiveSheet.DrawingViews.Item(1)

            'Add
            ConductorTable = ConductorTables.Add(DrawingView)
            If ConductorTables.Count <> 1 Then
                StrFail = "Could not ADD ConductorTable."
            End If
            strTableStyle = ConductorTable.TableStyle
            objAnchorPt = ConductorTable.AnchorPoint
            ConductorTable.GetListOfSavedSettings(intNumSavedSettings, arrList)
            'Update
            For Each ConductorTable In ConductorTables
                ConductorTable.Update()
            Next


            'SavedSettings
            ConductorTable.SavedSettings = "Normal"

            If ConductorTables.Count <> 1 Then
                StrFail = "Could not UPDATE all ConductorTables."

            End If

            'MarginHorizontal
            'Taking initial margin for SavedSettings test below.
            initialMarginH = ConductorTable.MarginHorizontal
            ConductorTable.MarginHorizontal = initialMarginH * 2
            If ConductorTable.MarginHorizontal <> initialMarginH * 2 Then
                StrFail = "Could not get or set MARGINHORIZONTAL."

            End If

            'MarginVertical
            ConductorTable.MarginVertical = 0.01
            If ConductorTable.MarginVertical <> 0.01 Then
                StrFail = "Could not get or set MARGINVERTICAL."

            End If

            ConductorTable.ColumnHeaderPosition = SolidEdgeDraft.TitlePosition.igHeader
            ConductorTable.ShowColumnHeader = False
            ConductorTable.MaximumRows = 100
            ConductorTable.PageGap = 0.001
            ConductorTable.ReverseDisplayOrder = True
            ConductorTable.HeaderFixedRowHeight = 0.007
            ConductorTable.DataFixedRowHeight = 0.007
            ConductorTable.NumberOfHeaderRows = 2
            ConductorTable.MaximumRowsFirstPage = 100
            ConductorTable.MaximumRowsAdditionalPages = 100
            ConductorTable.MaximumHeightFirstPage = 0.3
            ConductorTable.MaximumHeightAdditionalPages = 0.3
            ConductorTable.CreateNewSheetsForTable = True
            ConductorTable.FirstSheetBackgroundName = "A1-Sheet"
            ConductorTable.AdditionalSheetsBackgroundName = "A1-Sheet"
            ConductorTable.ShowSheetBackground = True
            ConductorTable.MaintainSheetsWithTableSize = True
            ConductorTable.WrapDataCellsToNewRow = True
            ConductorTable.FillEndOfTableWithBlankRows = False
            ConductorTable.TitleFixedRowHeight = 0.01

            ' titles
            Titles = ConductorTable.Titles
            Title = Titles.Add
            Title.value = "1st. title"
            Title.Position = SolidEdgeDraft.TitlePosition.igHeader
            Title.Alignment = SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants.igTextHzAlignRight
            Title.FitToWidth = True
            Title.FontName = "Arial"
            Title.FontStyle = SolidEdgeFrameworkSupport.DimTextFontStyleConstants.igDimStyleFontItalicBold
            Title.FontSize = 0.005

            ' remove existing rows and columns
            Columns = ConductorTable.Columns
            Rows = ConductorTable.Rows

            ' columns
            Column = Columns.Add(1, False)
            Column.Width = 0.035
            Column.DataHorizontalAlignment = SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants.igTextHzAlignRight
            Column.Show = True
            Column.SortPrecedence = 0
            Column.SortAscending = True
            Column.DataMergeCellsWithSameValue = True

            Column.CurrentHeaderRow = 1
            Column.HeaderRowValue = "Column 1"
            Column.HeaderRowHorizontalAlignment = SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants.igTextHzAlignCenter
            Column.HeaderRowVerticalAlignment = SolidEdgeFrameworkSupport.TextVerticalAlignmentConstants.igTextVtAlignTop
            Column.HeaderRowOrientation = SolidEdgeDraft.TableTextOrientation.igHorizontal
            Column.HeaderRowFitToWidth = True
            Column.HeaderRowMergeWithNext = True
            Column.DataVerticalAlignment = SolidEdgeFrameworkSupport.TextVerticalAlignmentConstants.igTextVtAlignTop
            Column.DataFitToWidth = True
            Column.CurrentHeaderRow = 2
            Column.HeaderRowValue = "Secondary"

            Column = Columns.Add(2, False)
            Column.Header = "Column 2"
            Column.Width = 0.05
            Column.SortPrecedence = 0

            'rows
            For ii = Rows.Count To 4
                Row = Rows.Add(ii, False)
            Next

            ' cell
            ConductorTable.Cell(1, 1).value = "a"
            ConductorTable.Cell(2, 1).value = "b"
            ConductorTable.Cell(3, 1).value = "c"
            ConductorTable.Cell(4, 1).value = "d"

            ConductorTable.Cell(1, 2).value = "1"
            ConductorTable.Cell(2, 2).value = "2"
            ConductorTable.Cell(3, 2).value = "3"
            ConductorTable.Cell(4, 2).value = "4"

            Cell = ConductorTable.Cell(1, 1)
            Cell.FontName = "Arial"
            Cell.FontStyle = SolidEdgeFrameworkSupport.DimTextFontStyleConstants.igDimStyleFontBold
            Cell.Underline = True
            Cell.HorizontalAlignment = SolidEdgeFrameworkSupport.TextHorizontalAlignmentConstants.igTextHzAlignCenter
            Cell.VerticalAlignment = SolidEdgeFrameworkSupport.TextVerticalAlignmentConstants.igTextHzAlignVCenter

            'update
            ConductorTable.Update()

            ConductorTable.SetOrigin(0.1, 0.1)

            'Page
            Page = ConductorTable.Pages.Item(1)
            Page.SetOrigin(0.2, 0.2)
            Page.RotationAngle = 1.57
            Page.Layer = "Default"

            ConductorTable = ConductorTables.Item(1)

        Catch ex As Exception
            Console.WriteLine(ex.ToString)
        End Try
    End Sub

End Module
See Also

DraftDocument Object  | DraftDocument Members