Use iLogic to change custom iProperty based on Pick

Use iLogic to change custom iProperty based on Pick

Anonymous
Not applicable
479 Views
2 Replies
Message 1 of 3

Use iLogic to change custom iProperty based on Pick

Anonymous
Not applicable

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

 

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

smilinger
Advisor
Advisor
Accepted solution
0 Likes
Message 3 of 3

Anonymous
Not applicable

Right on the money... short and sweet! Thanks

0 Likes