aPointFeature = aPart.addFeature("Point")
aPointFeatureData = aPointFeature.data()
assert(aPointFeatureData is not None)
-# aPointFeatureData.string("creation_method").setValue("by_xyz")
-aPointFeatureData.real("x").setValue(0.)
-aPointFeatureData.real("y").setValue(0.)
-aPointFeatureData.real("z").setValue(0.)
+geomDataAPI_Point(aPointFeatureData.attribute("point3d")).setValue(0., 0., 0.)
aPointFeatureData.string("creation_method").setValue("by_xyz")
aPointFeature.execute()
aSession.finishOperation()
aPointFeature = aPart.addFeature("Point")
aPointFeatureData = aPointFeature.data()
assert(aPointFeatureData is not None)
-# aPointFeatureData.string("creation_method").setValue("by_xyz")
-aPointFeatureData.real("x").setValue(0.)
-aPointFeatureData.real("y").setValue(0.)
-aPointFeatureData.real("z").setValue(100.)
+geomDataAPI_Point(aPointFeatureData.attribute("point3d")).setValue(0., 0., 100.)
aPointFeatureData.string("creation_method").setValue("by_xyz")
aPointFeature.execute()
aSession.finishOperation()
##
from ModelAPI import *
+from GeomDataAPI import *
aSession = ModelAPI_Session.get()
aDoc = aSession.moduleDocument()
aFeature = aDoc.addFeature("Point")
aFeatureData = aFeature.data()
assert(aFeatureData is not None)
-# aFeatureData.string("creation_method").setValue("by_xyz")
-aFeatureData.real("x").setValue(0.)
-aFeatureData.real("y").setValue(0.)
-aFeatureData.real("z").setValue(0.)
+geomDataAPI_Point(aFeatureData.attribute("point3d")).setValue(0., 0., 0.)
aFeatureData.string("creation_method").setValue("by_xyz")
aFeatureName = aFeature.name()
aFeature.execute()
"""
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2017-11-30"
aSession.startOperation()
aPoint = aPart.addFeature("Point")
aPoint.string("creation_method").setValue("by_xyz")
-aPoint.real("x").setValue(20)
-aPoint.real("y").setValue(5)
-aPoint.real("z").setValue(0)
+geomDataAPI_Point(aFeature.attribute("point3d")).setValue(20, 5, 0)
aSession.finishOperation()
aSession.startOperation()
double Model_ExpressionDouble::value()
{
- if (myIsInitialized)
+ if (myIsInitialized && !myReal.IsNull())
return myReal->Get();
return std::numeric_limits<double>::max(); // error
}
int Model_ExpressionInteger::value()
{
- if (myIsInitialized)
+ if (myIsInitialized && !myInteger.IsNull())
return myInteger->Get();
return std::numeric_limits<int>::max(); // error
}
# Initialization of the test
#=========================================================================
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2014-12-26"
aFeature = aPart.addFeature("Point")
aFeatureData = aFeature.data()
assert(aFeatureData is not None)
-aFeatureData.real("x").setValue(15.)
-aFeatureData.real("y").setValue(10.)
-aFeatureData.real("z").setValue(20.)
+geomDataAPI_Point(aFeatureData.attribute("point3d")).setValue(15., 10., 20.)
aSession.finishOperation()
assert(aPart.size("Features") == 1)
# Duplicate the document
# Initialization of the test
#=========================================================================
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2017-11-22"
aPoint0 = aPartSetDoc.addFeature("Point")
aPoint0Data = aPoint0.data()
assert(aPoint0Data is not None)
-aPoint0Data.real("x").setValue(0.)
-aPoint0Data.real("y").setValue(0.)
-aPoint0Data.real("z").setValue(0.)
+geomDataAPI_Point(aPoint0Data.attribute("point3d")).setValue(0., 0., 0.)
aPoint0Data.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
aPoint1 = aPartSetDoc.addFeature("Point")
aPoint1Data = aPoint1.data()
assert(aPoint1Data is not None)
-aPoint1Data.real("x").setValue(0.)
-aPoint1Data.real("y").setValue(0.)
-aPoint1Data.real("z").setValue(0.)
+geomDataAPI_Point(aPoint1Data.attribute("point3d")).setValue(0., 0., 0.)
aPoint1Data.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
aPoint2 = aPartDoc.addFeature("Point")
aPoint2Data = aPoint2.data()
assert(aPoint2Data is not None)
-aPoint2Data.real("x").setValue(0.)
-aPoint2Data.real("y").setValue(0.)
-aPoint2Data.real("z").setValue(0.)
+geomDataAPI_Point(aPoint2Data.attribute("point3d")).setValue(0., 0., 0.)
aPoint2Data.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
# Initialization of the test
#=========================================================================
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2017-11-24"
aPoint = theDocument.addFeature("Point")
aPointData = aPoint.data()
assert(aPointData is not None)
- aPointData.real("x").setValue(theX)
- aPointData.real("y").setValue(theY)
- aPointData.real("z").setValue(theZ)
+ geomDataAPI_Point(aPointData.attribute("point3d")).setValue(theX, theY, theZ)
aPointData.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
return aPoint
# Test checks stability of the foldering mechanism due to incorrect input parameters
#=========================================================================
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2017-11-23"
aPoint = theDocument.addFeature("Point")
aPointData = aPoint.data()
assert(aPointData is not None)
- aPointData.real("x").setValue(theX)
- aPointData.real("y").setValue(theY)
- aPointData.real("z").setValue(theZ)
+ geomDataAPI_Point(aPointData.attribute("point3d")).setValue(theX, theY, theZ)
aPointData.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
return aPoint
# Initialization of the test
#=========================================================================
from ModelAPI import *
+from GeomDataAPI import *
__updated__ = "2017-11-23"
aPoint = theDocument.addFeature("Point")
aPointData = aPoint.data()
assert(aPointData is not None)
- aPointData.real("x").setValue(theX)
- aPointData.real("y").setValue(theY)
- aPointData.real("z").setValue(theZ)
+ geomDataAPI_Point(aPointData.attribute("point3d")).setValue(theX, theY, theZ)
aPointData.string("creation_method").setValue("by_xyz")
aSession.finishOperation()
return aPoint
# add an origin
aSession.startOperation()
aFeature = aDocument.addFeature("Point")
-# aFeature.string("creation_method").setValue("by_xyz")
-aFeature.real("x").setValue(0.)
-aFeature.real("y").setValue(0.)
-aFeature.real("z").setValue(0.)
+geomDataAPI_Point(aFeature.attribute("point3d")).setValue(0., 0., 0.)
aFeature.string("creation_method").setValue("by_xyz")
anOriginName = aFeature.name()
aSession.finishOperation()
# add an origin
aSession.startOperation()
aFeature = aDocument.addFeature("Point")
-# aFeature.string("creation_method").setValue("by_xyz")
-aFeature.real("x").setValue(0.)
-aFeature.real("y").setValue(0.)
-aFeature.real("z").setValue(0.)
+geomDataAPI_Point(aFeature.attribute("point3d")).setValue(0., 0., 0.)
aFeature.string("creation_method").setValue("by_xyz")
anOriginName = aFeature.name()
aSession.finishOperation()