Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create a complete list of all available Content Centre parts

25 REPLIES 25
SOLVED
Reply
Message 1 of 26
Anonymous
3627 Views, 25 Replies

Create a complete list of all available Content Centre parts

Hi there

We would like to be able to access all of filenames from the available Content Centre parts, Excel or the likes.

The reason being we have many duplicate parts in our outdated Access database and Vault. I'd love to be able to tidy this up by pointing the duplicates to the Content Centre part i.e. "do not use, use ********* from Content Centre".

If anybody could help me I'd be most appreciative.

 

Thanks

25 REPLIES 25
Message 21 of 26
A.Acheson
in reply to: Rich-T

Your actually looping through all of the categories on your way to the family members. This sample here shows how its layed out. 

Get the node in the content browser based on the names of the nodes in the hierarchy.
    Dim hexHeadNode As ContentTreeViewNode
     hexHeadNode = ThisApplication.ContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")
    

You will need the displayname of the last node before looping through the families. Syntax here from API help. Or you could print the full tree path for additional info. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 22 of 26
Rich-T
in reply to: Anonymous

Thanks again AA

I think I'll have to park this for a while - i've reached my skill limit with ilogic an need to level up a bit i think.

 

Message 23 of 26
suresh.r.ext
in reply to: A.Acheson

Hi it's works well. But if some component doesn't have partnumber column then it shows error again. Can you ignore the part number column if family member doesn't have it means?

 

Message 24 of 26
alexanderboogaard
in reply to: Anonymous

This solution works great, however I just have an additional question. Would it be possible to only show the Unsuppressed items?
We have suppressed most of the fastener lengths and diameters to make our content center clean and similar to what we have have in stock. Our users are only allowed to use some specific diameters and lengths.

If i edit the Family table through Excel, I find that every family table has a column STATUS, but it won't show in the oFamily.TableColumns in the iLogic.


Kind regards,
Alexander Boogaard
Message 25 of 26

Hi @alexanderboogaard 

 

Yes this is possible

 For Each oMember As ContentTableRow In oFamily.TableRows
	If oMember.IsSuppressed = True Then Continue For
'.........Other code
Next

 

And here is the method if you want to show all the rows but know what is and isn't suppressed. 

 

First add the property Status to the Family Member Class, this will allow it's use through out the sub routines. 

Public Property Status

Next in the row loop you can click on the variable name and check the methods and properties available. You will find a property of Is Suppressed. 

AAcheson_1-1718942274729.png

In the same for loop copy one of the other properties try catch statement and  paste in the bottom then adjust the Class property and then sets it's value like below.

Try
      FamilyMember.Status = oMember.IsSuppressed
Catch ex As Exception
      FamilyMember.Status = "#N/A"			
End Try

Next  in the set to excel sub routine create the excel column and set the rows value. 

oSheet.Range("J1").Value  = "Status"

and lastly in the loop of class properties set the cell value of the column you just added. 

oSheet.Range("J" & oCount).Value = FamilyMember.Status

AAcheson_3-1718942839700.png

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 26 of 26

Hi Alan,

Thank you very much. Working like a charm.

Kind regards,
Alexander Boogaard

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report