Skip to content

Using the API

Bret Leasure edited this page Aug 13, 2024 · 8 revisions

The addin's API allows creating and updating Sheet Lists from code instead of having to use the UI buttons. This can be from either iLogic or an external application. If using the API from an external application, the SheetList NuGet package will need to be referenced in your project in order to use the Extension Methods for creating and updating Sheet Lists.

Extension Methods

A Sheet List can be created or updated by using the extension methods available on the Sheet and DrawingDocument objects.

Sheet

Method Name Description
CreateSheetList(Point2d) Creates a sheetlist using the default settings
CreateSheetList(Point2d, SheetListSettings) Creates a sheet list using the provided settings

DrawingDocument

Method Name Description
UpdateSheetList(SheetListSettings) Updates an existing sheet list using the provided settings

Configuration

Customizations are made by passing in SheetListSettings into the CreateSheetList methods.

Important

The API methods will not use the same settings that are set using the addin's configure window.

SheetListSettings

Setting Type Description
Title string Title of the Sheet List Table
ShowTitle boolean Whether the Title is shown on the Table
Direction TableDirectionEnum Direction of the Table (Top Down / Bottom up)
HeadingPlacement HeadingPlacementEnum Placement of the column headings
WrapLeft boolean Wrap table to the left
EnableAutoWrap boolean Enables auto wrapping of the table base on MaxRows and NumberOfSections
MaxRows int Maximum number of rows before the table is wrapped
NumberOfSections int The number of vertical sections the table should wrap to
Anchor TableAnchor Whether the table is anchored on the top or bottom
ColumnPropertyData List<PropertyColumn> Collection of Property data that defines the Columns to be included in the table

PropertyColumn

Property Type Description
Source PropertySource The source for where the property value comes from (Sheet, Drawing, or SheetDocument). SheetDocument refers to the referenced document of the first placed view on the Sheet
PropertyName string The name of the property from the source. This value needs to match the Inventor API's internal name for the property. Inventor.InternalNames can be referenced in you project to make finding the internal names for all of the properties easier
ColumnName string The name that will be displayed as the column heading, if column headings are visible
ColumnWidth double The width of the column in centimeters
DisplayValue string Used only for the Addin's UI. This is the value that shows in the Selected Properties Column of the Column Builder window when a property is selected to be in the table

Examples

C#

var dwgDoc = (DrawingDocument)inventorApp.Documents.Open(@"C:\Work\MyDrawing.idw");

var position = inventorApp.TransientGeometry.CreatePoint2d(0, 0);

dwgDoc.ActiveSheet.CreateSheetList(position);

iLogic

AddReference "SheetList"
Imports SheetList

Dim dwgDoc As DrawingDocument
dwgDoc = ThisDoc.Document

Dim position As Point2d
position = ThisApp.TransientGeometry.CreatePoint2d(0, 0)

dwgDoc.ActiveSheet.CreateSheetList(position)

Clone this wiki locally