Selected vertex did not highlight in Blender 3D.

I made Cube in Blender.
And i did enter EDIT mode.
And i was select a one vertex.
But the Vertex was not highlight with orang color.
Next i moved the Vertex to -3,-2,-3
But the Vertex did not moved.
Way did not highlight and did not moved?
Please answer to me.
Thank you.

Script code : http://shshop.da.to/tmp/Select_vertex.txt

import bpy
bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.mode_set(mode=“EDIT”)
bpy.ops.mesh.select_all(action=“DESELECT”)
bpy.context.tool_settings.mesh_select_mode = (True , False , False)
bpy.context.object.data.vertices[0].select = True
bpy.context.object.data.vertices[0].co = (-3,-2,-3)

because you have to use bmesh in editmode

http://www.blender.org/documentation/blender_python_api_2_69_release/bmesh.html

taken from the template ‘BMesh Simple Editmode’ available in the text editor


# This example assumes we have a mesh object in edit-mode

import bpy
import bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data


# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)

bm.faces.active = None

# Modify the BMesh, can do anything here...
for v in bm.verts:
    v.co.x += 1.0


# Show the updates in the viewport
# and recalculate n-gon tessellation.
bmesh.update_edit_mesh(me, True)

Thank you your help.
I solved a problem with your advice.
Thank you.

You use the standard API in your snippet, which requires the object to be in editmode for some, in object mode for other operations (e.g. change geometry selection states requires object mode, whereas deselect requires edit mode).

With heavy meshes, you may run into performance problems if you need to toggle modes a lot. Use the bmesh module instead:

http://www.blender.org/documentation/blender_python_api_2_69_3/bmesh.html

If you change selection only, call update_edit_mesh() with False, False, 'cause there’s no need to recalc anything.

You can gain access to the editmesh directly, but also get a mesh copy in both, object- and edit-mode, and work with that entirely in memory (and write it to a mesh datablock if desired, but must not be in editmode).

import bpy, bmesh

me = bpy.context.object.data

# editmode-only
bm = bmesh.from_edit_mesh(me)
for v in bm.verts:
    v.select_set(v.index % 2)
bmesh.update_edit_mesh(me, tessface=False, destructive=False)

# object mode only
bm = bmesh.new()
bm.from_mesh(me)
for v in bm.verts:
    if v.index % 2:
        v.co.z += 0.1
bm.to_mesh(me)
me.update()

Thank you your help.
I had learn more information.