Getting property Comments from a virtual part

Getting property Comments from a virtual part

goran_nilssonK2TWB
Contributor Contributor
267 Views
2 Replies
Message 1 of 3

Getting property Comments from a virtual part

goran_nilssonK2TWB
Contributor
Contributor

Hello!

 

I'm going to export properties from my assembly model to an Excel sheet.

Most everything works well but I can't get access to property Comments at virtual parts in my assembly

My code is:

If TypeOf bRow.ComponentDefinitions(1) Is VirtualComponentDefinition Then
	xlWorksheet.Range("B" & row).Value = bRow.ComponentDefinitions(1).PropertySets("Design Tracking Properties")("Description").Value 
	xlWorksheet.Range("C" & row).Value = bRow.ComponentDefinitions(1).PropertySets("Design Tracking Properties")("Part Number").Value
    xlWorksheet.Range("D" & row).Value = bRow.ComponentDefinitions(1).PropertySets("Inventor Document Summary Information")("Comments").Value

 What's the problem? Isn't possible to access property Comments at virtual components?

 

/Göran

 

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

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @goran_nilssonK2TWB . I found a bug in your code. You have incorrectly defined PropertySets in line 4, instead of "Inventor Document Summary Information" you should write "Inventor Summary Information".

If TypeOf bRow.ComponentDefinitions(1) Is VirtualComponentDefinition Then
	xlWorksheet.Range("B" & Row).Value = bRow.ComponentDefinitions(1).PropertySets("Design Tracking Properties")("Description").Value 
	xlWorksheet.Range("C" & Row).Value = bRow.ComponentDefinitions(1).PropertySets("Design Tracking Properties")("Part Number").Value
    xlWorksheet.Range("D" & Row).Value = bRow.ComponentDefinitions(1).PropertySets("Inventor Summary Information")("Comments").Value

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 3

goran_nilssonK2TWB
Contributor
Contributor

@Andrii_Humeniuk Thank you!

I thought I had tried it but apperantly not!

0 Likes