各位同仁, 问题已经解决!
主要是把约束后面的 1 换成0就好。 虽然 我也不懂这个数字代表什么!
spConstraint2DFactory->CreateConstraint( spLine2, NULL, spLine3, NULL, spLine1, NULL, NULL, Cst2DType_Symmetry, 0, 0);
附上,约束函数:
CreateConstraint
public virtual CATISpecObject_var CreateConstraint( CATBaseUnknown* iElem1,
const double* iSelPt1,
CATBaseUnknown* iElem2,
const double* iSelPt2,
CATBaseUnknown* iElem3,
const double* iSelPt3,
CATBaseUnknown* iDirection,
const CAT2DCstType iCstType,
const int iDriven =0,
const int iEvaluation =1) = 0
Creates a constraint.
Parameters:
iElem1
[in] Address of the first geometrical element.
iSelPt1
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iElem2
[in] Address of the second geometrical element. Pass NULL if necessary (e.g. for a length constraint, only iElem1 should be valuated).
iSelPt2
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iElem3
[in] Address of the third geometrical element. Pass NULL if necessary.
iSelPt3
[in] If the geometry is a curve, pass the 2D selection coordinates of the curve expressed according to the sketch system of reference. Else, pass NULL. (This entry serves as the initialization point of the resolution. If no information is passed, the system will evaluate one automatically. However, the returned solution (location where the constraint on the curve will be solved) can be unexpected for the user).
iDirection
[in] Address of a geometrical element of the line type to create an oriented dimension. (e.g. vertical if the V direction of the sketch absolute axis is passed, or horizontal if the H direction is passed).
iCstType
[in] Type of the constraint to create.
iDriven
[in] The default value 0 corresponds to a driving dimension. If <> 0, if will be a measured dimension (reference constraint).
iEvaluation
[in] The default value 1 implies a solver evaluation after the constraint is created. If several constraints must be created successively, you can run explicitly a final evaluation by setting the value to 0.
还望,懂这个函数的同仁给于指点, 比如:参数const double* iSelPt1 什么意思。 以及最后两个参数什么意思?
{:soso_e176:}
|