Not getting poly data

[success, loadedVolumeNode] = slicer.util.loadVolume('\Sft.nrrd', returnNode=True)
#Segmentation
masterVolumeNode = getNode('Sft')

# Create segmentation
segmentationNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentationNode")
segmentationNode.CreateDefaultDisplayNodes() # only needed for display
segmentationNode.SetReferenceImageGeometryParameterFromVolumeNode(masterVolumeNode)
addedSegmentID = segmentationNode.GetSegmentation().AddEmptySegment("bone")

# Create segment editor to get access to effects
segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()
segmentEditorWidget.setMRMLScene(slicer.mrmlScene)
segmentEditorNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentEditorNode")
segmentEditorWidget.setMRMLSegmentEditorNode(segmentEditorNode)
segmentEditorWidget.setSegmentationNode(segmentationNode)
segmentEditorWidget.setMasterVolumeNode(masterVolumeNode)

# Thresholding
segmentEditorWidget.setActiveEffectByName("Threshold")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("MinimumThreshold","300")
effect.setParameter("MaximumThreshold","5695")
effect.self().onApply()

# Smoothing
segmentEditorWidget.setActiveEffectByName("Smoothing")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("SmoothingMethod", "MEDIAN")
effect.setParameter("KernelSizeMm", 3)
effect.self().onApply()

modelNode = getNode('Sft') 
points = arrayFromModelPoints(modelNode)

please check above code everything works fine except last line .
Traceback:
‘MRMLCorePython.vtkMRMLScalarVolumeNode’ object has no attribute ‘GetPolyData’

do i need any additional code, so that i can get polydata from my node or from these segmentation process.

This method will return your input volume node, the same way as this method call returns your input volume node at the beginning of your script. You can get surface mesh from your segmentation as shown in this example: This example demonstrates how to extract skin surface from an MRI image using thresholding and smoothing effect of Segment Editor · GitHub

using above method to create surfacemesh i’m still not able to get polydata
i have tried setting modelNode = getNode(sementID)

still am i missing any code?

getNode expects a node name or node ID. Passing a segment ID (an internal ID within a segmentation node) will not work. Follow the example that I referenced above more closely. It should be something like this:

segmentationNode.CreateClosedSurfaceRepresentation()
surfaceMesh = segmentationNode.GetClosedSurfaceRepresentation(addedSegmentID)

yeah, i did the same thing and then i tried to getNode like this

modelNode = getNode(addedSegmentID)
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "C:\Program Files\Slicer 4.9.0-2018-05-07\bin\Python\slicer\util.py", line 631, in getNode
        raise MRMLNodeNotFoundException("could not find nodes in the scene by name or id '%s'" % (pattern if (type(pattern) == str) else ""))
    MRMLNodeNotFoundException: could not find nodes in the scene by name or id 'bone'

and this error comes up , in data still i cant find out the mode hierarchy;only my volume node under that segmentation and a single segment…

This should return an error and it does, so everything works as expected. If you need a vtkPolyData of a segment, then please see my post above that shows how surfaceMesh variable is set.