Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
705 Views, 3 Replies

modify custom iproperty of selected(.Pick) component in assembly

The following code fails with "Error in rule: Change By Selection, in document: test.iam Public member 'Document' on type 'ComponentOccurrenceProxy' not found." Any help wold be appreciated. It appears i need to get the document object from the ComponentOccuranceProxy but I'm Not sure how... I am using kAllEntitiesFilter because it allows me to "reach into" subassemblies in th browser while making the selection.

 

SyntaxEditor Code Snippet

'select end1
 sel_flag=0
 Dim end1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter,"Select End 1:")
 If (Not end1 Is Nothing) Then
   sel_flag=1
 End If
 If(sel_flag=1)
  MessageBox.Show(end1.Name, "End1")
  Dim docEnd1 as document
  docEnd1 = end1.Document
  customPropertySet = docEnd1.PropertySets.Item("Inventor User Defined Properties")
  customPropertySet.item("Connected To").Value = end1.Name
 End If