cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Open Model in Jlink

ssuttle
7-Bedrock

Open Model in Jlink

All,


I am working on a Jlink program that I cannot get to open a model in a new window. I am using an event action listener of OnAfterModelCopyAll. When a copy is done I want to open the model that was just copied to in a new window and have it be the active window. I have tried OpenFile(descr) which according to the API will open a new window and retrieve and activate the window. I can use this method with nothing in the base window just as a test and I can get it to work. But I cannot get it to work after the copy. A new window will come up but there is no model in the window nor is the window active. It shows the correct model in the window name on the upper left corner of the window. If you look at the windows under the Pro/E windows menu it shows the window that I copied from as the active window and has 2.prt as the other window. Any help would be appreciated. Thanks


4 REPLIES 4

Hi Steve,


I use


Window win = session.OpenFile(descr);


to open a model and then set win.activate(); to get the resulting window activated. Sometimes u must redraw the window after u get it, or after simple operations to get everything visible thats in it.


win.repaint(); is ur friend to repaint the window.


If the model is scrolled out of view in some case u don't have a chance I know to do it with jlink. But u can use toolkit to get it back. and get the toolkit in a DLL started with jlink.



Best regards,


Eike

bfrandsen
6-Contributor
(To:ssuttle)

Hi Steve
After retrieving a model into session I use these methods to display it in
a new window:

window = session.CreateModelWindow(model);
window.Activate();
model.Display();

Regards,
Bjarne



Steve Suttle <steve.suttle@oracle.com>
19-09-2011 18:59
Please respond to
Steve Suttle <steve.suttle@oracle.com>


To
<->
cc

Subject
[proecus] - Open Model in Jlink






All,
I am working on a Jlink program that I cannot get to open a model in
a new window. I am using an event action listener of OnAfterModelCopyAll.
When a copy is done I want to open the model that was just copied to in a
new window and have it be the active window. I have tried OpenFile(descr)
which according to the API will open a new window and retrieve and
activate the window. I can use this method with nothing in the base window
just as a test and I can get it to work. But I cannot get it to work after
the copy. A new window will come up but there is no model in the window
nor is the window active. It shows the correct model in the window name on
the upper left corner of the window. If you look at the windows under the
Pro/E windows menu it shows the window that I copied from as the active
window and has 2.prt as the other window. Any help would be appreciated.
Thanks


Site Links: View post online View mailing list online Send new post
via email Unsubscribe from this mailing list Manage your subscription
Use of this email content is governed by the terms of service at:
ssuttle
7-Bedrock
(To:ssuttle)

Here is a summary of the answers I received. I had actually tried both
of these before I posted and cannot get them to work.

1)

Window win = session.OpenFile(descr);

to open a model and then set win.activate(); to get the resulting window
activated. Sometimes u must redraw the window after u get it, or after
simple operations to get everything visible thats in it.

win.repaint(); is ur friend to repaint the window.

If the model is scrolled out of view in some case u don't have a chance
I know to do it with jlink. But u can use toolkit to get it back. and
get the toolkit in a DLL started with jlink.

2)

window = session.CreateModelWindow(model);
window.Activate();
model.Display();

Where is your problem / why can't u get it work? Is there an exception or can't u compile your code?

Top Tags