For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How to check the Handle is available or invalid?

tudousi's picture

hello everyone:
my programm as follow:

double fir, lst;
TopoDS_Edge aEdge = ...;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, fir, lst);
Handle(Standard_Type) edgeType = aCurve->DynamicType();

my question is how can i check "aCurve" is a available or NULL Handle,
it is crush sometime in "aCurve->DynamicType();"

sergey zaritchny's picture

Hi tudousi,
The handle may be checked to be null by its method IsNull().
See paragraph "2.2. Programming with Handles" of "Foundation Classes User's Guide"

tudousi's picture

Hi sergey zaritchny, thank you for your reply, but IsNull() is not a member of Geom_Curve,
and use "if ( aCurve == NULL ) { ... }" also cann't work.

Best Regards

P Dolbey's picture

aCurve is an instance of Handle_Geom_Curve, not Geom_Curve, so it will have an IsNull method.


EricThompson's picture

You have to use aCurve.IsNull(), not aCurve->IsNull()

tudousi's picture

yes, you are right, my bug was fixed, thank you.

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.