Skip to main content
1-Visitor
June 30, 2015
Question

Using JTree to fill with an assembly

  • June 30, 2015
  • 1 reply
  • 3026 views

Hi!

 

Has anyone ever used a JTree to assemble a structure that is in the Tree View?

 

Note: The picture is just to illustrate.

 

Capturar.PNG

 

Thanks.

1 reply

15-Moonstone
June 30, 2015

Hi,

it's a little bit of programming but you can do this. I didn't have done that right now but you can read all features with J-Link, and you can programm a tree completly like you want it (also with drag n drop and so on).

I have done both seperately.

Br,

Eike

1-Visitor
June 30, 2015

Thanks Eike.

This is just one example, but I'm trying to do this way:


1.PNG

Here I can recover the code and the name of the item, but I can not recover the amount of each item.


I need to do two things from this code:
1) recover the quantity.
2) Insert the information into a JTree.


Thanks.

15-Moonstone
July 1, 2015

Uh that's not what you want.

You go through all models inside the session. Every model is only one time inside the session.

You need to get the current model.

Check if it is an ASM.

Then you get all Features from these ASM.

Check if it is a Component.

Change Component to Model if it is a part count it inside a Map, tree, whatever

  if it is a asm count it inside a Map / Tree and call the function recursive.

You don't have circles inside of a tree so it never should be a problem.

If the model isn't a component you can ignore it. You also can filter it at the feature list option as far as I remember. But not sure about this.

Br,

Eike