Functions to work with dependences
Function
Comment
ResetAllConstraint(idFrom = NULL)
Switches off the dependences, set in the last OnConnect, when the insertion of the object with the selection of several objects is used.
idFrom – object identifier, from which the dependences should be switched off. By default it equals NULL; in this case, all dependencies from all objects are switched off.
SetParamConstraint(
Parameter,
idFrom,
TYPE,
expr,
bBidirect = FALSE,
idTo = objectID
Sets the parametric dependence.
Parameter – parameter name
idFrom – object identifier from which the dependence starts
TYPE – the type of parametric dependence (EXPR is only used)
expr – expression, setting the parameter of the connected object
bBidirect – checkbox, TRUE – two-sided dependence,
FALSE (by default) – one-sided dependence.
idTo – object identifier to which the dependence is set
(By default is objectID – identifier of the current object)
Example:
SetParamConstraint(rDn, obj, EXPR, “obj.rDnE2”, TRUE); SetParamConstraint(LTPlug, obj, EXPR, “obj.rLT”);
SetGeomConstraint(
TYPE,
SUBTYPE,
IdFrom,
PlaneTo,
PlaneFrom,
expr,
bBidirect = FALSE,
idTo = objectID );
Sets the parametric dependence.
TYPE – type of the geometric dependence. Can take the following values:
INSERT – Insertion
MATE – Coincidence by plane
AXIS – Coincidence by axis
DIRECTION – Coincidence by direction (angular dependence)
SUBTYPE – Dependence subtype. Can take two values:
CODIRECT – codirectional dependence
CONTRDIRECT – opposite directional dependence
idFrom – object identifier, from which the dependence is set.
PlaneTo – plane of the inserted object.
PlaneFrom – plane of the connected object.
expr – expression, setting the dependence parameter (for insert the INSERT – distance between planes)
bBidirect – checkbox, TRUE – two-sided dependence,
FALSE (by default) – one-sided dependence.
idTo – object identifier, to which the dependence is set
(by default equals the objectID – the identifier of the current object)
Example:
SetGeomConstraint(INSERT, CODIRECT, obj, WP1, obj.WP2, 0);
IsFixedParam(Parameter, bOnlyFixed =FALSE)
Function as used in the OnChangeParameters event handler.
Checks if the dependence for the parameter was set and if the parameter was changed, if the bOnlyFixed is TRUE.
Activation by default (from FALSE) is recommended when checking the parameters of objects with permanent geometry (screw). In this case, the function returns 1 if the parameter is connected by the dependence and changed its value; and 0 otherwise. Activation (from TRUE) is recommended for objects with changing geometry (tubes, barrels); the function returns 1 if the parameter is connected by the dependence.
Example:
if (IsFixedParam(WP1, TRUE)) { pntOrigin = Point(new.WP1); vecDirection = Vector(new.WP1




Post your comment on this topic.