param:addconstraint


(param:addconstraint  constraintsGroup  name  cType  fsp1  [ fsp2 [ cs1 [ cs2 [ expression ]]]])

Adds a new constraint name (string or NIL) of type cType (integer), referencing the (sub-)entity fsp1 (sub-entity list), and optionally (sub-)entity fsp2 (sub-entity list), with CoordinateSystem cs2  for fsp1, and optionally CoordinateSystem cs2 (integer) for fsp2, to the specified constraintsGroup (integer) 3DConstraintsGroup.

Arguments

name (string) the name of the new constraint

cType (integer) one of the "3DConstraints Type" values (see 3DConstraints Constants)

fsp1 (sub-entity list) the first main entity or sub-entity

fsp2 (sub-entity list, optionally) the second main entity or sub-entity, if the constraint type requires 2 (sub-)entities

cs1 (integer, optionally) one of the "3DConstraints CoordinateSystemObject" values, defining the XY/XZ/YZ plane (see 3DConstraints Constants) for the first main/sub-entity

cs2 (integer, optionally) one of the "3DConstraints CoordinateSystemObject" values, defining the XY/XZ/YZ plane (see 3DConstraints Constants), for the second main/sub-entity

expression (string, optionally) the optionally required expression for the constraint

Return

the created constraint (integer) or NIL

Example

(vl-load-mech)  2
(setq blkId (tblobjname "BLOCK" "*Model_Space"))  <Entity name: a3c8b900>
(setq grp (param:get-constraintsgroup blkId))  2752346592

(setq sel (vl-subent-select "\n*** Select main or sub entity : " bcSubentFace))  ((227.219100374024 194.235093975203 1.64357280474275) (1 1 <Entity name: a099c740>) (1 5 <Entity name: a099c740>))
(setq fsp_1 (last sel))  (1 5 <Entity name: a099c740>)
(setq constraint_1 (param:addconstraint grp "Fix_01" bc3dcTypeFix fsp_1))  2695607696

Remarks

see functions (param:get-allconstraintsgroups) and (param:get-constraintsgroup) to retrieve the 3DConstraintsGroup;
see function (param:get-constraints) to get all constraints of a 3DConstraintsGroup;
for the sub-entity definition list, see (vl-subent-select)

Note




©  Bricsys NV. All rights reserved.