Creating points with the PointCollection class

Forums: 

I was wondering if anyone has tried creating points with the PointCollection class in the Python API?

According to the documentation in https://docs.plm.automation.siemens.com/data_services/resources/nx/10/nx..., all you should need is an NXOpen.Point3d object, but inputting that only yields the following error message: "TypeError: descriptor 'CreatePoint' requires a 'NXOpen.PointCollection' object but received a 'NXOpen.Point3d'"

It seems to work smoothly in C++ when attempting the same. Is it possible that it has to do with the Python API being less developed?

The following code works for me.

import NXOpen
import NXOpen.Features

theSession = NXOpen.Session.GetSession()

def main() :

workPart = theSession.Parts.Work
newPt = workPart.Points.CreatePoint(NXOpen.Point3d(1.0,2.0,3.0))
newPt.SetVisibility(NXOpen.SmartObjectVisibilityOption.Visible)

if __name__ == '__main__':
main()

Oh, that works! Thank you!