代码:
NXOpen.UF.UFSession theUf = NXOpen.UF.UFSession.GetUFSession();
Tag partition;
theUf.Ps.CreatePartition(out partition);
double x = 1;
double y = 1;
double z = 1;
VECTOR1_t axis = new VECTOR1_t(0,0,1);
VECTOR1_t refAxis = new VECTOR1_t(1, 0, 0);
VECTOR_t coord = new VECTOR_t(0, 0, 0);
AXIS2_sf_t basis_set;
basis_set.axis = axis;
basis_set.location = coord;
basis_set.ref_direction = refAxis;
BODY_t psBody;
ERROR.code_t errorCode = BODY.create_solid_block(x, y, z, &basis_set, &psBody);
if(errorCode == ERROR.code_t.no_errors)
{
Tag ugBody;
theUf.Ps.CreateObjFromPsTag((Tag)psBody.Value, out ugBody);
theUf.Obj.SetBlankStatus(ugBody, 0);
}