Grid cell properties- J Index Flip - ocean

Is it necessary to flip the J index while exporting the properties (Perm, porosity) to an Ascii file outside the Petrel environment?

Related

How do I change the value of the SlideMaster.Height in PowerPoint 2016 VBA?

I'm trying to automate the process of changing the height in the Slide Size dialog in the Slide Master system with VBA. When I try to change it, VBA informs me that I'm not permitted to assign a value to ActivePresentation.SlideMaster.Height because it is read-only.
I've studied the ActivePresentation object tree and have figured out to acquire the height value (with ActivePresentation.SlideMaster.Height), but the following line results in a Compile Error:
ActivePresentation.SlideMaster.Height = 1189
Changing the SlideHeight with...
ActivePresentation.PageSetup.SlideHeight = 1189
does change the height of the slide, but it doesn't have the same effect as changing the height through the Slide Master system. The primary question at this stage is if it's possible to change ActivePresentation.SlideMaster.Height with VBA, or is the Read-Only status immutable?
Sub test()
ActivePresentation.SlideMaster.Height = 1189 'Compile Error...can't assign to read-only property
ActivePresentation.PageSetup.SlideHeight = 1189 'Changes the height of the slides, _
but doesn't change the size of text within Shape elements like I need it to do.
End Sub
Here's some background...
Through a bit of trial and error, I've determined that if I change the dimensions of the slides using the slide master, the default text for Shapes is set how I want it (at pitch 18). If I don't change the dimensions in the Slide Master, the text for Shapes remains at 31. Even if a new shape is created, the font is changed to 18 and that shape is set as the default shape, if text is pasted onto the slide (with CTRL-v or Paste Special-Unformatted Text), the shape that gets created has a text-size of 31.
Just to be clear, if the default is set to 18 and I create another new Shape via Insert>Shapes, then that new shape is automatically set to 18. It's only when I paste text (using either CTRL-v or Paste Special - Unformatted) directly on the slide does it become 31.
The only thing that does what I want is making a slight change to the Slide Master Slide Size. Changing the height from 1188 to 1189 forces all of the shapes on all of the slides to go from 31 to 18. Any new text that gets pasted in the slide comes in as a shape containing 18 text.
The reason I'm posting this on Stack Overflow and not on Super User is because I have to automate this change...we have thousands of presentations to modify.

VBA Macro 'Moving" Graphics / Dynamic Graphs

Basically, the problem here is that I have a macro which changes the number of a specific cell and by doing that I change the numbers from three columns and when those numbers are changed my graphic starts to 'move'.
To be more specific, I have this graphic:
When I click on the button I have, the lines starts to move, and it looks like a mouth opening and closing.
The blue line corresponds to the first and second column values, whereas the red line is changed accordingly to the first and third column values:
Cell(B2) contains the number generated by this code:
Sub OpenMouth()
For i = 1 To 20
Worksheets("Mouth").Cells(2, 2).Value = 0.1 + 2 * i / 20
Calculate
For j = 1 To 5000000
Next j
Next i
End Sub
What I need to do is to prepare something similar: A graphic that by changing the numbers I have in columns A, B and C, it starts to move. The columns A, B and C will be changed by doing a simple loop in VBA, this loop will change one value, and the three columns will have a formula linked to this value, so they will have their values changed.
I've seen some really cool graphics, a ball rolling, a wheel moving, but I really don't have a clue of how to do this, I don't know how to do it.
Does anyone have an idea? Can anyone help me build a different graphic with a similar idea (of an object moving)?
This is another example, using the same logic:
Frankly, I would suggest rethinking your approach of creating a custom & complex animation in Excel. Excel just isn't the right tool for this.
I would use Javascript and embed a Internet Explorer control into Excel with the animation. The solution would work as follows:
Press a button in Excel
A VBA macro executes the animation by loading the Microsoft Web Browser control with a custom HTML file with your animation in Javascript. The animation is show in the MS Web Browser Control.
Drawing in Javascript
Here a simple tutorial:
http://www.w3schools.com/html/html5_canvas.asp
Test your drawings here:
http://www.codecademy.com/courses/web-beginner-en-SWM11/0/1
Microsoft Web Browser Control
https://msdn.microsoft.com/en-us/library/aa752040(v=vs.85).aspx

Index of the cell containing a point after 3D Delanay triangulation

I have done 3D Delaunay Triangulation with the help of CGAL and am trying to locate the cell containing a specified point in it. I am pretty sure that Delaunay_triangulation_3::Locate() is what I need. However, the Locate() function returns a Cell_handle and what I need is the index of the cell containing the given point.
How does one obtain the index of the cell from a Cell_handle or is there other direct way to obtain the index of the cell?
Cells have no index in CGAL.
From the Cell_handle, you can access the vertices or the neighboring cells
or any information you have previously stored in the cell
(your own index if you have put one).

Display Fixed Width Text in Winforms using VB.NET

I need to write some fixed-width font (i.e Courier New or Consolas) text to a .net Winforms window in the Paint event - not using a label or any other winforms control - rather using a graphics object method to render the text onto the form's client area.
I am having difficulty aligning text on different lines under headings even though it is fixed width font. How can I get a precise measurement of the width of a single character in the fixed-width font? How can I get 2 lines to print out aligned horizontally in successive text out calls?
For example:
Heading 1 Heading 2
Short Other text
A bit longer Still aligned?
I need a separate call to render each cell of text under Heading 2. For argument's sake - let's say column 1 items are printed in black and column 2 are printed in blue - we can't use the same text out call for the entire line.
Graphics.MeasureString may be what you are looking for.
Ok so here is the code that works the way I want using MeasureString. A string is printed twice. One time using a single call to DrawString. The second time, character by character in a loop. What I needed was that the 2 strings should appear identical but I was having trouble getting the correct horizontal position of each char when drawing the second string. You can put this code into the Paint event of a form to try it out (set the form font to Consolas or other fixed width font):
Dim i As Single
Dim sf As StringFormat
Dim String1 As String = "Here is out test string"
Dim CharSizeF As SizeF
sf = StringFormat.GenericTypographic
CharSizeF = e.Graphics.MeasureString(String1, Me.Font, 10000, sf)
CharSizeF.Width /= String1.Length
e.Graphics.DrawString(String1, Me.Font, Brushes.Black, 0, 0, sf)
For Each c As Char In String1
e.Graphics.DrawString(c.ToString, Me.Font, Brushes.Black, i * CharSizeF.Width, CharSizeF.Height, sf)
i += 1
Next
Microsoft also helped with:
http://msdn.microsoft.com/en-us/library/957webty.aspx
To obtain metrics suitable for adjacent strings in layout (for example, when implementing
formatted text), use the MeasureCharacterRanges method or one of the MeasureString methods that
takes a StringFormat and pass GenericTypographic. Also ensure the TextRenderingHint for the
Graphics is AntiAlias.

Resizing a two dimensional Array

How can I resize the two dimensional array size without affecting its value?
Use ReDim with the Preserve modifier. VB.NET will make sure the original values are untouched. Didn't read the documentation right. ReDim Preserve will only allow you to change the length of the last dimension of the array.
You need to allocate a new array (with the correct size) and manually copy the elements from the first array to the second.
As Adam said, you can't resize 2D arrays dynamically. You can easily copy the existing array into a bigger one like so:
Dim smaller(1, 1) As Byte
Dim bigger(2, 2) As Byte
Array.Copy(smaller, bigger, smaller.length)
Try using array.resize if you are on .net 2 framework or above.
For example:
Dim MyArray() as string
Array.Resize(myarray,12)