Message 1 of 3
Creating a table in a drawing using ilogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day,
I'm completely confused when creating a table in a drawing using ilogic.
Here's what I wanted to do:
1. When you run the rules to select the view in the drawing.;
2. If axonometry is selected, then continue if not, then error;
3. Deletes the table if it was created earlier for the selected view to this view;
4. Create a table with the number of rows taken from the parameters of the selected type;
' add custom table. oDrawDoc = ThisDoc.Document ' Set a reference to the active sheet. Dim oSheet As Inventor.Sheet oSheet = oDrawDoc.ActiveSheet For Each oCustomTable In oSheet.CustomTables If InStr(oCustomTable.Title) > 0 Then oCustomTable.Delete End If Next ' Set the column titles Dim oTitles(2) As String oTitles(0) = "№ сгиба" oTitles(1) = "Расстояние до начала гиба от базы A1 ,мм" oTitles(2) = "Угол в плоскости гиба" ' Set the contents of the custom table (contents are set row-wise) х = Parameter("Труба ilogic (Новая).ipt.Кол_гибов") Dim oContents(х*3) As String Dim i1 As Integer = 0 For i As Integer = 1 To x oContents(i1) = "Parameter"&i i1+=1 Next ' Set the column widths (defaults to the column title width if not specified) Dim oColumnWidths(2) As Double oColumnWidths(0) = 4 oColumnWidths(1) = 4 oColumnWidths(2) = 4 ' Create the custom table Dim oCustomTable As Inventor.CustomTable oCustomTable = oSheet.CustomTables.Add("Таблица гибов", ThisApplication.TransientGeometry.CreatePoint2d(0, 0), 4, 4, oTitles, oContents, oColumnWidths)