Get component count from assembly based on active design view or LOD

Get component count from assembly based on active design view or LOD

J_Dumont
Advocate Advocate
462 Views
2 Replies
Message 1 of 3

Get component count from assembly based on active design view or LOD

J_Dumont
Advocate
Advocate

I created a VB.Net program that runs from an assembly and gets a total count of all components. Is it possible to modify this and get a count of all visible components based on an active design view or LOD? I know I can do this from a drawing's part list but I'm hoping to do this from an assembly.

 

0 Likes
Accepted solutions (1)
463 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Unfortunately, neither representation object have a collection or enumerator that can be easily used to get all component occurrences that are being effected by them.  The design view representation has the DesignViewInfo property, but it contains a long complex string full of XML tags, which isn't fun to navigate.  What may be easier, but perhaps time consuming, would be to activate that DVR or LOD (by code), then loop through all components checking their Visible or Suppressed status, and when true/false adding them to a collection of sorts.

Here are a couple of links on the subject.

LevelOfDetailRepresentation Object 

DesignViewRepresentation.DesignViewInfo Property 

Design View Data XML Formatting 

One other option I haven't looked into would be to check Attributes, but I don't know if that would take longer or not.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

J_Dumont
Advocate
Advocate

Thank you for your input, it is very helpful.

I'll look into both methods. I found a great resource on the MSDN Forum with working with XML files.

 

Thank you and stay safe!!

0 Likes