Ilogic Add the "File Name" Column into a parts list.

Ilogic Add the "File Name" Column into a parts list.

cdepaoloAFYZ3
Explorer Explorer
103 Views
1 Reply
Message 1 of 2

Ilogic Add the "File Name" Column into a parts list.

cdepaoloAFYZ3
Explorer
Explorer

I am looking to sort and number multiple parts list on the same page. If the exact same part shows up in 2 parts list it will need to maintain the same number for clarity. Some of the parts are mirrors of other parts and they need to have unique numbers. The best way I can see to identify if they are the exact same part or not is the "File Name" Column already built into Inventor.

cdepaoloAFYZ3_0-1752605611161.png

I know that the columns can be added. Like in the code below.

"

sSortColumnName = "KEYWORDS"
Dim oPartsList As PartsList = ThisApplication.CommandManager.Pick _
    (SelectionFilterEnum.kDrawingPartsListFilter, "Select a Parts List for Line Sortation.")
oADoc = oPartsList.ReferencedDocumentDescriptor.ReferencedDocument
oPropSet = oADoc.PropertySets.Item("Inventor Summary Information")

'add temporary column to the parts list
oID = oPropSet.Item(sSortColumnName).PropId
Try
    oPartsList.PartsListColumns.Add _
    (PropertyTypeEnum.kFileProperty, oPropSet.InternalName, oID)
Catch
End Try
 
"
This method does not work for file name. When I tried to work backwards and get the Property Type, Property Set, and Property ID I run into a wall. I have found that the property type is a kFilenamePartsListProperty (45571) not a kFileProperty(45569). But even when I try to find the set and property to go with it with the following code.
 
    for i = 1 to oADoc.PropertySets.count
        for j = 1 to oADoc.PropertySets.item(i).count
            Plist.add(oADoc.PropertySets.item(i).name & "-" & oADoc.PropertySets.item(i).item(j).name )
        next j
    next i
    Datalogger(Plist,1)
 
It does not appear. (Data logger just takes the list and outputs it to a CSV with a title of 1.txt)
0 Likes
104 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @cdepaoloAFYZ3.  When using the PartsListColumns.Add method, only the first input parameter it is asking for is 'required', all others are 'optional'.  There is no 'iProperty' for file name, it is just a direct property of the Document object (such as Document.DisplayName) or extracted from the File object.  So you should still be able to add a column for the file name, without needing to specifying a PropertySet ID or Property ID.  If you want to be able to specify where the column will be, you can just include a couple commas (or use 'Nothing' keyword) where those values would be included, to get to where you can specify the 'TartetIndex' and 'InsertBefore' optional inputs.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes