New Frame

Tecplot's Add-on Developer's Kit

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

irobert
Newbie
Posts: 3
Joined: Fri Mar 26, 2010 11:15 am
Location: England
Contact:

New Frame

Postby irobert » Fri Mar 26, 2010 11:21 am

Does anyone know how to find out if there is any data in a user created new frame through the ADK?

Ben

Re: New Frame

Postby Ben » Fri Mar 26, 2010 11:56 am

Try TecUtilDataSetIsAvailable.

irobert
Newbie
Posts: 3
Joined: Fri Mar 26, 2010 11:15 am
Location: England
Contact:

Re: New Frame

Postby irobert » Sat Mar 27, 2010 1:41 am

When a frame has just been created TecUtilIsDataSetIsAvailable will come back as false. But this doesn't necessarily mean that the frame doesn't contain any information, I think. If the frame is created whilst another frame in the workspace has 2D data in it, the 2D data is available to the frame but only after switching the view to a 2D plot. Then TecUtilIsDataSetIsAvailable comes back as true. The problem is that if the frame actually contains no data trying to switch the view to 2D will cause a crash. So how do I check if the frame has data in it before switching the view without using TecUtilIsDataSetIsAvailable? There must be a way as Tecplot itself will allow you to change the type of plot to 2D, 3D etc depending on what data is available in the new frame.

scottf
Tecplot Employee
Posts: 115
Joined: Wed Apr 05, 2006 8:58 am
Location: Bellevue, WA
Contact:

Re: New Frame

Postby scottf » Mon Mar 29, 2010 9:11 am

You're right, when you create a new frame and change the plot type, it will inherit the dataset from the frame behind it in the frame order. That said, the dataset is not "attached" to the new frame until you change the plot type. The act of changing the plot type attaches the dataset.

This is (in my mind) an unfortunate behavior and we should have required explicit attachment of a dataset. So, I would not rely on this behavior.

You can attach an explicit dataset via: TecUtilFrameSetDataSet().

If you must rely on the existing behavior, you will have to determine if the frame below the active frame in the frame order has an available dataset before changing the plot type.
Scott Fowler
Image

irobert
Newbie
Posts: 3
Joined: Fri Mar 26, 2010 11:15 am
Location: England
Contact:

Re: New Frame

Postby irobert » Tue Mar 30, 2010 11:17 am

Thanks for that. Currently I am searching for the frame under the new one but it does make me a little nervous as Tecplot crashes when I change the plot style to 2D etc if I get it wrong. I think I will explicitly attach an available dataset. Thanks for your help.


Return to “Add-on Developer's Kit (ADK)”

Who is online

Users browsing this forum: No registered users and 1 guest