Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic - select specific file in browser tree

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
CadlineSupport
1692 Views, 3 Replies

iLogic - select specific file in browser tree

 

Hi,

I'm sure this is very simple, I just can't find any reference to this. I am looking to apply a set part number iproperty to the first, then second, then third components in the assembly browser tree in my iLogic rule, regardless of their current part number. (I need to select them by their position in the browser tree as their part number will vary). How do I do this?

 

Many thanks for your help

3 REPLIES 3
Message 2 of 4

I found it. Dead easy when you know how of course. You can get the name of the first, second etc components in the assembly tree as follows:

 

My_Variable1 = ThisDoc.Document.ComponentDefinition.Occurrences.Item(1).Name

My_Variable2 = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2).Name

 

 

Message 3 of 4
Ursa_Major
in reply to: CadlineSupport

Hello,

 

i tried the same thing for the Part Number, but it gives me " end of statement expected".

 

 

 SyntaxEditor Code Snippet

PartX = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2).ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value

 

 is there an error in my line? did i forgot something?

 

 

Message 4 of 4
Ursa_Major
in reply to: Ursa_Major

i found the solution for my problem

 

SyntaxEditor Code Snippet

Dim PartX As Object
PartX = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2)
PartY = iProperties.Value(PartX.Name, "Project", "Part Number")
MessageBox.Show(PartY)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report