J-link: question about selection
Hi,
I have a question about selection of models with J-Link. I made a Part Properties query tool, which givesme a specific list of properties of the modelthat I pick with the mouse.
This works great when an assembly is loaded, but it doesn't work when there's just one model on the screen. In that case, I click on the part, but nothing happens. What I'd like is that when I start the J-Link tool, it determines whether there's an assy on the screen or just a single part. If it's an assembly, the user has to select the desired part. If there's just one model on the screen,J-Link should simply select that model and give me it's properties.
Does anyone know how to make that work in J-link??
Below is the code I use now for the selection.
Thanks!
Regards,
Jaap
private void partProp() {Session session2 = null;
try {
session2 = pfcGlobal.GetProESession();
} catch (jxthrowable xx) {
UIHelper.showException(xx, "getting Pro/E session");
}
SelectionOptions sel_options;
Selection selektie;
Model model;
ComponentPath modelPath;
intseq parentIds;
Assembly modelParent;
ComponentPath parentPath = null;
String modelParentString = ";
try {
File file = new File("C:\\local\\temp\\PartProp.txt");
if (file.exists()) {
file.delete();
}
int max = 1;
sel_options = pfcSelect.SelectionOptions_Create("prt_or_asm");
sel_options.SetMaxNumSels(new Integer(max));
Selections selekties = session2.Select(sel_options, null);
selektie = selekties.get(0); //select first element
model = selektie.GetSelModel();
Solid solid = (Solid) model;
// etcetera.....
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

