Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to import the BOM of assembly to idw from an excel.
By running the code below, I am getting the BOM on the sheet but I am trying to do 2 adjustments:
1. I want the code to be general, means I want to eliminate manually typing the spreadsheet name for each assembly (TEST.XLS in this example) and want the code should detect the excel by the part name on the drawing sheet.
2. I want the cells in the table to be auto adjusted based on the text length.
I have attached the screen shot of the table I am getting by running this code.
SyntaxEditor Code Snippet
Sub main CreateDrawingExcelTable()
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oActiveSheet As Sheet oActiveSheet = oDrawDoc.ActiveSheet Dim oPoint As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(69, 58) Dim oExcelTable As CustomTable oExcelTable = oActiveSheet.CustomTables.AddExcelTable _ ("C:\Temp\Test\Test.xlsx", oPoint,iProperties.Value("Project", "Part Number")) End Sub
Solved! Go to Solution.