use SelectSet to get PropertySets

use SelectSet to get PropertySets

Anonymous
Not applicable
424 Views
1 Reply
Message 1 of 2

use SelectSet to get PropertySets

Anonymous
Not applicable
i need to get a "value" in the PropertySets from a part in an Assembly. can some one point me in the right direction? 'm a bit confused how SelectSet works from inside an Assembly.
0 Likes
425 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
An assembly is really just references to other assemblies and parts. Each
file has its own set of properties. When someone selects a part or
subassembly within an assembly they're selecting an occurrence of that part
or subassembly. This occurrence doesn't have any iProperties, but it does
provide functionality so that you can get to the subassembly or part that it
represents and then you can get the iProperties from it. The code below
demonstrates this for the selected occurrence.

Public Sub GetiProperty()
' Get the selected occurrence.
On Error Resume Next
Dim oOcc As ComponentOccurrence
Set oOcc = ThisApplication.ActiveDocument.SelectSet.Item(1)
If Err Then
MsgBox "An occurrence must be selected."
Exit Sub
End If
On Error GoTo 0

' Get the document that the occurrence is referencing.
Dim oDoc As Document
Set oDoc = oOcc.Definition.Document

' Get the set of design tracking properties.
Dim oDesignTrackPropertySet As PropertySet
Set oDesignTrackPropertySet = oDoc.PropertySets.Item("Design Tracking
Properties")

' Display the designer name.
MsgBox "Designer: " &
oDesignTrackPropertySet.ItemByPropId(kDesignerDesignTrackingProperties).Value
End Sub
--
Brian Ekins
Autodesk Inventor API

wrote in message news:[email protected]...
i need to get a "value" in the PropertySets from a part in an Assembly. can
some one point me in the right direction? 'm a bit confused how SelectSet
works from inside an Assembly.
0 Likes