How to add a Column in a Partslist with kMaterialPartsListProperty (combined Field material / vendor)

How to add a Column in a Partslist with kMaterialPartsListProperty (combined Field material / vendor)

wolfgang_nickl
Advocate Advocate
1,065 Views
9 Replies
Message 1 of 10

How to add a Column in a Partslist with kMaterialPartsListProperty (combined Field material / vendor)

wolfgang_nickl
Advocate
Advocate

Hello together,

I want to add colums to a partslist with API. The following VBA sub inserts four different values in a Partslist.

Public Sub subTestPartslistInsertColumn()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    'The Partslist to change is selected, get it
    Dim oPartsList As PartsList
    Set oPartsList = oDoc.SelectSet(1)
    'add new user "Inventor User Defined Properties" RAL
    Call oPartsList.PartsListColumns.Add(kCustomProperty, , "RAL")
    'add ItemNumber
    Call oPartsList.PartsListColumns.Add(kItemPartsListProperty, , "ItemNumber")
    'add "Design Tracking Properties" description
    Call oPartsList.PartsListColumns.Add(kFileProperty, "{32853F0F-3444-11D1-9E93-0060B03C1CA6}", "29")
    'Add the quantity
    Call oPartsList.PartsListColumns.Add(kItemQuantityPartsListProperty, , "ItemQuantity")
End Sub

What I can't figur out is how to insert the combined Field for Material / Vendor. I found out that I have to use kMaterialPartsListProperty, but where I can find the values for PropertySetId and PropertyIdentifier?

 

Best Regards

Wolfgang

0 Likes
1,066 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

@wolfgang_nickl . This works for me.

Put them together in a "For" loop. 

 

'Add Columns
oColumns.Add(kMaterialPartsListProperty, "{32853F0F-3444-11D1-9E93-0060B03C1CA6}", "20")
oColumns.Add(kFileProperty, "{32853F0F-3444-11D1-9E93-0060B03C1CA6}", "30")
oColumns.Add(kCustomProperty, , "Mat_Ven")

'ADD VALUE TO CUSTOM COLUMN
For i = 1 To oPList.PartsListRows.Count
VendorValue = oPList.PartsListRows.Item(i).Item("Vendor").Value
MaterialValue = oPList.PartsListRows.Item(i).Item("Material").Value
Mat_Ven = oPList.PartsListRows.Item(i).Item("Mat_Ven")
Mat_Ven.Value = VendorValue & ": " & MaterialValue
Next

 

0 Likes
Message 3 of 10

wolfgang_nickl
Advocate
Advocate

Hello JoJo.S,

 

thank you for your reply, but this isn't the solution.

I need the property von Partslist as shown in the dialog.

As I use a german Inventor I can't tell you the exact naming, but please have a look at the picture.

The Red marked Bauteilliste (1) meens Partslist and Werkst./Lieferant (2) means material/vendor.

I need excatly this property, it delievers only vendor if defined, and material if there is no vendor.

Your solution isn't compatible with our PDM Solution.

Partslist_select_column.jpg

Best Regards

Wolfgang

0 Likes
Message 4 of 10

Anonymous
Not applicable

@wolfgang_nickl  Which version you are using?

0 Likes
Message 5 of 10

wolfgang_nickl
Advocate
Advocate

Hello Jojo.S,

 

we use Inventor 2021, but its the same behaviour in previous versions.

 

Best Regards

Wolfgang

0 Likes
Message 6 of 10

Anonymous
Not applicable

Hi @wolfgang_nickl . How did you put it under Partslist (manually)? I dont have that option. And also cannot create a custom parameter with that name. I have to find out.

 

partslist column.png

0 Likes
Message 7 of 10

wolfgang_nickl
Advocate
Advocate

Hello JoJo.S,

with an open Drawing I go to Ribbon Manage (German: Verwalten) -> Styleeditor (German: Stil- und Normeneditor) -> Partslist (German: Teileliste (DIN)) -> Columnselection (German: Spaltenauswahl) and thats the dialog you can see in the previous picture. The next two pictures show the way.

Bild1.JPGBild2.JPG

Best Regards

Wolfgang

0 Likes
Message 8 of 10

wolfgang_nickl
Advocate
Advocate

Hello JoJo.S,

 

I forgot one point, could it be that your MATERIAL is the German Werkst./Lieferant?

 

Best Regards

Wolfgang

0 Likes
Message 9 of 10

Anonymous
Not applicable

Hi @wolfgang_nickl . So, what you need is an ilogic to do the same as the substitution option. sUBS.JPG

0 Likes
Message 10 of 10

wolfgang_nickl
Advocate
Advocate

Hello JoJo.S,

 

if I don't find an api-call to insert that column we have to do it manualy because the mapping with our PDM is on that field. I know the possibility of your idea with iLogic, but it doesn't work for me.

 

Best Regards

Wolfgang

0 Likes