Assigning iPROPERTY based on Part's XYZ Co-Ordinates...Help!?!

Assigning iPROPERTY based on Part's XYZ Co-Ordinates...Help!?!

munderwood4GRE6
Enthusiast Enthusiast
263 Views
1 Reply
Message 1 of 2

Assigning iPROPERTY based on Part's XYZ Co-Ordinates...Help!?!

munderwood4GRE6
Enthusiast
Enthusiast

I'm trying to write an external rule that will allow me to assign a custom iPROPERTY or possibly an instance property to parts in an assembly based off their co-ordinates in the assembly. This seems simple enough when I put the steps down into xcel but I'm not sure what the best way to tackle this would be using iLogic. I'm guessing I make an array and then run different sorts. Any help or advice would be greatly appreciated!

 

munderwood4GRE6_0-1641919684055.png

 

 

0 Likes
264 Views
1 Reply
Reply (1)
Message 2 of 2

NSBowser
Advocate
Advocate

Solve your problem in the same manner you laid it out, one step at a time!

It appears your steps are:

  1. Collect component data: PN, coordinates (you indicate X,Y... Z left out in the cold?), etc.
  2. Sort those coordinates (By Y then X)
  3. Identify some 'undesirable' parts based on position and Part number to remove from the set
  4. Assign new 'Instance properties' to the items in the set

Lets talk step 1:

  • First and foremost, I don't know what you're programming experience is, and since you've provided no code, I wont either. I'll assume you know how to do stuff and simply just not what to do now. You'll need to google and research how to utilize the following suggestions (a good rule in programming and in life in general!)
  • You'll need to loop through each of the components and keep track of the occurrences and their coordinates. You'll need the occurrences since you'll need them later to add Instance Properties to as you wont know the value as you work through the set.
  • In general, regarding arrays, I would recommend you use more sophisticated datatypes such as List(of <type>) or Dictionary(of <type>,<type>), etc., rather than arrays (no one should use arrays unless they know why they are a better solution for their current problem, a they're usually not.) These enhanced datatypes give you capabilities like 'Sort'. However, that is complicated by the fact you are looking to build a matrix and not a List
  • Since you want to build a matrix, I would suggest you try a DataTable, which you can add different columns with different datatypes to the table, keep track of the Occurrence, Part Number, Coordinates, etc. You can sort on various columns and work through the data in a logical manner.

Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes