Ocean SDK get property value at cell - properties

In my plugin I get property as an input parameter. I'm trying to get property value at particular cell. I've checked that value at the cell is really defined, but I get Nan.
Code sample:
double permValueCell;
Index3 TestIndex = new Index3(54,8,7);
permValueCell = _propPermeability[TestIndex];
Firstly I thought that there is some problem in getting property as parameter, but during debug I saw that description section of the property displays a correct name. What can be wrong ?

In Petrel, the cell index seen in the UI is not the same as stored in Ocean.
You can convert between the two by using the ModelingUnitSystem class in Petrel 2014.
Look at :
Slb.Ocean.Petrel.ModelingUnitSystem.ConvertIndexFromUI
Slb.Ocean.Petrel.ModelingUnitSystem.ConvertIndexToUI

Related

Using Value obtained with Get Value

I am very new to using Robot Framework, and I am using the RIDE development environment. I am trying to obtain a value from an element on a website, and then set a variable with that value. The keyword Get Value only accepts one argument from what I can see, and I cannot find any documentation explaining how to do this. This question is similar to another SO question but I am unclear on how to assign this data to a variable.
Any help is greatly appreciated!
--edit--
here is the element that i am trying to obtain data from:
<div class="highlight-box animate ng-binding" animate-change="master.user.balance.toFixed(2)" id="header-balance">
0.00
</div>
I tried setting the variable like this:
#{balance} get value header-balance
as suggested, and it didnt throw any errors, but then when I tried to use the variable with an input text:
input text Textbox-1 #{balance}
it threw an error saying that input text requires two arguments. I took this to mean that the variable did not contain anything, regardless of being set in the last line.
To set a variable with the value obtained, just add the variable name as first element in your statement. Something like:
${variable} = Get Value id=my_element

How to use Get command in Monkey talk?

Does anybody know how to use the Get command in monkey talk?
In monkey talk guide only the command is written but no syntax is present.
Here is an example for you,
var x = app.label("label1").get("x","value")
Above line will get the value of label1 and store it in variable x. You can change the second parameter "value" to ".text" or ".size" depending on your needs
since the question is not marked Answered and For the future reference i am answering this.
‘GET’ ACTION RETRIEVES COMPONENT PROPERTY VALUES
Syntax:
ComponenType MonkeyId Get varName propName
Works like an assignment statement (varName= propName)
The default property is “value”
// Get label value currently displayed
Label lastname Get name
// Enter name into input field
Input query EnterText ${name}
// Get the first table item
Table countries Get country items1
// Enter into input field
Input * EnterText ${country}
you can refer this document here, thanqs
I will try to explain using example. Suppose there is a ListView(Table) and you want to scroll till its last item.
//Define a variable
Vars * Define row
//Store size of list in variable row using Get. Check use of "Get" here
Table * Get row size %thinktime=20000
//Now stored variable can be used as per need. here I am using for scrolling
Table * ScrollToRow ${row} %thinktime=2000
Hope it helps you !!

Stimulsoft code based variables won't show their value

I´m losing my mind here, I've tried every example I've found online and still can't get it to work, this is the way im creating the variable on the code that generates the report, I'm working on a .NET application:
report.Dictionary.Variables.Add(New Stimulsoft.Report.Dictionary.StiVariable("test",""))
report("test") = "ANYTHING"
While it does show me the created variables on the Stimuloft gui, it contains absolutely nothing, any ideas on what I'm doing wrong? Thanks!
You should use next code to set value of variable:
report.Dictionary.Variables("test").Value = "ANYTHING"
The code that you use will work after calling report.Compile() method only.

Changing the color of a leader in AutoCad

I'm currently working on converting a VBA AutoCAD-application over to VB.NET, and the current command I'm working on is creating a simple leader with code like this:
Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, blockRefObj, leaderType)
leaderObj.ArrowheadType = acArrowDotSmall
leaderObj.ArrowheadSize = 2.5 * varDimscale
leaderObj.DimensionLineColor = acWhite
I've been able to create the Leader-line in .NET using
Dim l = New Leader()
For Each point In jig.LeaderPoints
l.AppendVertex(point)
Next
l.Dimldrblk = arrId
The arrId I got from using the function found here, but I've been unable to figure out how to set the color of the leader to white (it shows up as red by default), and also how to set the size of the arrowhead. If anyone could help me out with this I would be most grateful.
Ok, after a lot of trial and error, I figured out that the solution was rather simple. I didn't have to override any dimension styles (which I honestly don't even know what is, I had a short beginners course in AutoCAD before getting handed this project), I simply had to set an obscure property on the Leader-object. For future references, and for anyone else trying to do the same, here's the properties I ended up using:
leader.Dimclrd
The color of the leader-line. Stands for something like "dimension line color".
leader.Dimasz
The scale of the leader-head.
As type BlockReference, it should have a color property and the property should be an Autodesk.Autocad.Colors.Color or an Integer. Also the reason you are getting the object for read is, in your transaction you are opening the database with
OpenMode.ForRead
And that is correct. But to edit the object in the database, you must retrieve the object like below
var obj = Thetransaction.GetObject(theobjectid,OpenMode.ForWrite) as BlockReferance;
This is done inside of the
using(var trans = TransactionManager.StartTransaction()){}
I'm doing this on a cell, so check the camel case and syntax because I write in c#, but it should be pretty close.
You may want to see if there is a scale property, as to change the size.
Hopefully this will move you in the right direction.
Let me know if you have any problems. :)

getting the value of the boundfield in a gridview

I have encountered something strange.
I wanted to have the value of my gridview boundfield so I did this.
SelectedID = objGridView.Rows(0).Cells(4).Text.ToString
At first this seemed to work. I played around a little created a hyperlinkfield wanted to get that value but got an empty string. After some looking around it turned out I could not get it as easily as I could with a boundtextfield. No problem.
But here comes my problem , now all of a sudden my line of code to retrieve the value from the selectedId does not work anymore ( at least I'm getting empty strings back ).
I've build and rebuild my gridview but to no avail.
I'm flabbergasted and don't get it why it doesn't work anymore.
Hence my question.
Does anyone have an idea what's happening or have a solution to this problem.
edit:
I'm seeing this in my item value
"In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user"
Don't know why you dont use the datagridview.
I started with GridView as well but after changing the control type it's really easy to get those values e.g:
SelectedID = dgvExample.CurrentRow.Cells("Columname/Index").Value
dgv compared with gv
There is an answer here
An other one (which was the reason of my problem) could be that the BoundFields are set to Visible = false. Invisible Bound fields are... not bound.
A simple workaround is to make it invisible in CSS instead.
Code behind :
gvColumn.ItemStyle.CssClass = "className"
CSS :
.className { display:none; }