How can I get the values from the Part Number column in a member table

How can I get the values from the Part Number column in a member table

fsdolphin
Collaborator Collaborator
447 Views
6 Replies
Message 1 of 7

How can I get the values from the Part Number column in a member table

fsdolphin
Collaborator
Collaborator

Hi,

 

How can I get the PartNumbers from a member table?

 

Here is how I'm getting the MemeberNames but I don't see how I can get the values form the PartNumber column.

 

  For Each row As iPartTableRow In factory.TableRows
     memberList.Add(row.MemberName)
  Next

Thanks

0 Likes
448 Views
6 Replies
Replies (6)
Message 2 of 7

MechMachineMan
Advisor
Advisor

iPartTableColumns.Item Property

 

Description

Returns the specified iPartTableColumn object from the collection. This is the default property of the iPartTableColumns collection object.

Syntax

iPartTableColumns.Item( Index As Long ) As iPartTableColumn

 

api HELP.JPG


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 3 of 7

fsdolphin
Collaborator
Collaborator

@MechMachineMan


Hi,

I honestly don't know how to use the Item Property you are suggesting. Could you please help me a little bit more showing me or telling me how to add this property to my For Each for loop?

Thanks

0 Likes
Message 4 of 7

MechMachineMan
Advisor
Advisor
What is your end goal that you are trying to accomplish with this sub
routine?

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 7

fsdolphin
Collaborator
Collaborator

 

@MechMachineMan

 

What I'm trying to do is add all of the part numbers in the table to the Keywords field from the iProperties. I was able to add all of the names in the Member Name column but I need the part numbers not the memer names.

 

FYI - I'm doing this for better searchability in Vault.

0 Likes
Message 6 of 7

MechMachineMan
Advisor
Advisor
Looks like you have to use columns to figure out which column contains part numbers, then use that in conjunction with row data and access the cell that corresponds to the column you just found.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 7 of 7

Balaji_Ram
Alumni
Alumni

To add to Justin's reply :

 

You can iterate and get the column display heading to know which column holds the part number. That should help you retrieve it.

 

Dim oFactory As iAssemblyFactory
Set oFactory = oAsmDoc.ComponentDefinition.iAssemblyFactory

If oFactory.TableColumns.Count > 0 Then
Dim tableCol As iAssemblyTableColumn
For Each tableCol In oFactory.TableColumns
MsgBox tableCol.DisplayHeading
Next
End If

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes