Issue With iProp Constants

Issue With iProp Constants

Anonymous
Not applicable
197 Views
1 Reply
Message 1 of 2

Issue With iProp Constants

Anonymous
Not applicable
I'm making a macro to crawl an assembly, enumerate through the parts and dump some select iProps to an Excel sheet. I seem to be having an odd mix-up on the iProp constants though. For example, I write this:

For Each Component In oAllComponents
Set oCustomPropSet = Component.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Set oDesignPropSet = Component.PropertySets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}")
oDesignPropSet.Item(kPartNumberDesignTrackingProperties).Value = "Part_Number"

...and it writes Part_Number into the Checked By field. Same thing happens when I try to retrieve the iProp. So I check the constant to see what number it is and the kPartNumberDesignTrackingProperties is equal to 5, which I think is right from the research I've already done so I haven't accidentally changed my constant value somehow.

So, what is going on? Am I missing something dumb?
0 Likes
198 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
The problem is in the following line:

oDesignPropSet.Item(kPartNumberDesignTrackingProperties).Value =
"Part_Number"

The index of the item property can either be the name of the property or the
index of the property within the property set (not the enum value
corresponding to the property).

Sanjay-

wrote in message news:5785779@discussion.autodesk.com...
I'm making a macro to crawl an assembly, enumerate through the parts and
dump some select iProps to an Excel sheet. I seem to be having an odd mix-up
on the iProp constants though. For example, I write this:

For Each Component In oAllComponents
Set oCustomPropSet =
Component.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Set oDesignPropSet =
Component.PropertySets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}")
oDesignPropSet.Item(kPartNumberDesignTrackingProperties).Value =
"Part_Number"

...and it writes Part_Number into the Checked By field. Same thing happens
when I try to retrieve the iProp. So I check the constant to see what number
it is and the kPartNumberDesignTrackingProperties is equal to 5, which I
think is right from the research I've already done so I haven't accidentally
changed my constant value somehow.

So, what is going on? Am I missing something dumb?
0 Likes