Cancel
Showing results for 
Search instead for 
Did you mean: 

Contour output problem using API

Experimenter
Experimenter

Hi All,

 

I am writing a program in C# that creates a custom data set I am attempting to send to Femap. I can create the Output Set and an associated vector of scalar values that are being written to the Femap session correctly (I can query the nodes and the correct values are showing up), but I get the following error in the message window and no contour data is displayed:

 

Contour output data does not exist
 
What am I missing?
 
Code:
 
// Send results to Femap
int setID = 1000;
int vectorID = 9000000;
 
// Set up the results set
femap.OutputSet resultsSet = femapSession.feOutputSet;
resultsSet.title = "Custom Output Test";
resultsSet.Put(setID);
resultsSet.Value = 0.0;
 
// Simple function to generate dummy data
double[] dummydata= new double[nodeIDs.Length];
for (int i = 0; i < dummydata.Length; i++)
{
dummydata[i] = (double)i;
}
 
// Create and populate the damage vector
femap.Output outputDataVector = femapSession.feOutput;
zrc = outputDataVector.InitScalarAtNode(setID, vectorID, "Dummy data", femap.zOutputType.FOT_ANY, false);
zrc =outputDataVector.PutOutputList(dummydata.Length, (object)nodeIDs, (object)dummydata);
outputDataVector.Put(vectorID);
 
Thanks in advance
Chris
4 REPLIES

Re: Contour output problem using API

Siemens Phenom Siemens Phenom
Siemens Phenom

It is a bit hard to tell since what is shown clearly isn't the entire program, however assuming you are actually seeing the message ... "Contour output vector does not exist"... that means that you have not properly defined the View. Most likely you have set the View to display a contour, but have not selected Output Set 1000 and Output Vector 9000000  as the contour data to be displayed. The message tells you that whatever Set/Vector was selected in the View does not exist.

 

Also, just FYI, the statement

 

resultsSet.Value = 0.0;

 

 in the program you sent has no real effect since it comes after the "Put( )" call. It changes the value in the object, but not in the FEMAP database.

Re: Contour output problem using API

Experimenter
Experimenter

Thanks for the help. I figured out how to set the displayed contour data using the API, but now can't figure out how to set the contour maxima and minima. I found the following:

 

view.set_UserContourLevel(int, int)

But there is no useful intellisense popping up, or info in the API help.

 

Can anyone help?

 

Thanks

Chris

Re: Contour output problem using API

Phenom
Phenom

Hello,

 

This is very well documented in Help > API > 5.59.1.2 View Option Types.

 

It explains that all options accessed manually in the View Options (F6) are accessed as options in the API View Object. The figure explains how to access "classic" view properties, then lower aditionanal properties are listed.

 

What you're looking for is listed:

minimum <=> feView.UserContourValue(11)

maximum <=> feView.UserContourValue(0)

Re: Contour output problem using API

Experimenter
Experimenter

D'oh! My colleague pointed out my error.

 

I was setting view.UserContourLevel[11], not view.UserContourValue[11]. I wondered why it would only accept an int, and not a double!

 

All works smoothly now. Thanks