OK, Found it out myself!!
Here is the code I was looking for:
PartNumber=oCompOccurrence.Definition.Document.PropertySets.Item("{32853F0F-
3444-11d1-9E93-0060B03C1CA6}")
.ItemByPropId(kDescriptionDesignTrackingProperties).Value
I found the clue for this (.Definition.Document.PropertySets.) in "Browser
Rename sample & source" at cbliss.com. Thanks Charles!!!
It was really nice to find this project, WITH Sourcecode. Way to go!!
Jorgen
On Thu, 31 Jul 2003 23:39:51 -0700, Jorgen Bjornes wrote:
> Hmm. Nobody replied.
>
> This could mean 3 things:
>
> 1) That I wrote my question so clumsily that no-one understood it.
>
> 2) That what I'm trying to do is impossible with Apprentice.
>
> 3) That you guys have not bumped into this problem before and do not know
> what the solution is.
>
>
> So which one is it, Or does anyone know 😉 I'd be really glad for any
> hint.
> I can access the properties of the top assy, but not the nodes....
>
>
> Jorgen
>
>
>
>
>
> On Mon, 28 Jul 2003 08:17:07 -0700, Jorgen Bjornes
> wrote:
>
>> I'm building an VB application which uses Apprentice.
>> It will rucursively run through an assy and collect property-info of all
>> its components (and their components etc.)
>>
>> I decided to basy my code on the AssemblyTree sample supplied with
>> Inventor.
>>
>> But I cannot quite understand how I can get access to the component
>> occurences.
>> See code:
>>
>>
>> ' Call the recursive function to iterate through the assembly tree:
>> Call GetComponents(oDoc.ComponentDefinition.Occurrences, TopNode)
>>
>>
>>
>>
>> 'Sub that Gets the components from the Occurrences collection and add it
>> to the tree.
>> Private Sub GetComponents(InCollection As ComponentOccurrences,
>> ParentNode As Node)
>> Dim PartNumber As String
>> Dim WebLink As String
>>
>> ' Iterate through the components in the current collection.
>> Dim oCompOccurrence As ComponentOccurrence
>> For Each oCompOccurrence In InCollection
>> 'Here, I want to access the Part Number property and WebLink Property of
>> the
>> 'current component occurence.
>> 'WebLink=?????????
>> 'PartNumber=??????????
>>
>> ' Determine if the current component is an assembly or part.
>> Dim ImageType As String
>> If oCompOccurrence.Definition.Document.DocumentType =
>> kAssemblyDocumentObject Then
>> ImageType = "Assembly"
>> Else
>> ImageType = "Part"
>> End If
>> ' Display the current component in the tree.
>> Dim CurrentNode As Node
>> Set CurrentNode = treList.Nodes.Add(ParentNode, tvwChild, ,
>> oCompOccurrence.Name, ImageType)
>> ' Recursively call this function for the suboccurrences of the current
>> component.
>> Call GetComponents(oCompOccurrence.SubOccurrences, CurrentNode)
>> Next
>> End Sub
>>
>
>
>
--
Jorgen Bjornes
----------------------------------------------
Visit the Scandinavian Discussion-forum
For Inventor at www.bjornes.org
----------------------------------------------