Message 1 of 2
Ilogic Add the "File Name" Column into a parts list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
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)