SimplifiedLogic / creoson

OpenSource Automation using JSON Transactions for PTC's CREO Parametric
http://www.creoson.com
MIT License
79 stars 23 forks source link

Request: Get selected components update [bom : get_paths] #74

Open dmtr99 opened 3 years ago

dmtr99 commented 3 years ago

Is it possible to get the current selected components of the active assembly?

Maybe it is possible to add a return parameter to bom : get_paths if the component was selected?

adama2000 commented 2 years ago

We do have the feature.list_selected function, though that would list any selected feature, not just components. Have you tried that?

Sorry for the late reply.

1011010101 commented 2 years ago

Hello,

Example assembly with three parts (*.prt). Each part corresponds to its own component.

Somehow the "feature:list_selected" function doesn't do what I would expect. For example, it should recognize the component that the user has selected in the tree. The "feature:list_selected" function expects the component (e.g. "C11(name)"). But internally selected is the file (e.g. "name.prt"). You can see this in the search dialog when searching for components. Selected item there is the file. If you remove the selected file and take the component instead, the "feature:list_selected" function finds it.

I think if a file is selected with its own component in it, the "feature:list_selected" function should also list the component.

How can the function find the component selected by the user?

(Creo 6.0.6.0 is used)

I hope you can help me. Thanks very much.

adama2000 commented 2 years ago

Can you attach a sample model here for us to play with?

1011010101 commented 2 years ago

Please use this example assembly: ehs.zip