nanoCAD Platform Help

Panel HB

Script of the detail:

SVersion = 2;
ObjectDescription = @ MCS_STRING6;
 
function ActHeader {
  NPart = 1;
  Public (
     // Options- exterior length and width of the plate
     L,LENGTH,
     W,WIDTH,
     // Design load and weight plates
     P, @ MCS_STRING9,
     massa,MASS
  );
  Protected (seted, obozn, H);
  Changeable ();
  OnDlgBeforeSelectParam = 1;
  ShowWhenSelPnt = 1;
  ContourOnLine = 1;
};
 
function OnInitialization {
  LoadInCache (obozn, L, W, H, massa, P);
  if (seted == UnknownValue) {
     seted = 1;
     rZOrder = 100;
     // Set the initial values ??of parameters and execution
     SelectInCache (" kFirst ", " L ", " ~ ", 2700, " W ", " ~ ", 1190);
     strDesignName = " Implementation 1 ";
  };
};
 
function SetGripPoint {
  NGrip = 2;
  Two handles // - at the insertion point and with the opposite end
  // Panel
  pntGrip0 = pntOrigin;
  pntGrip1 = pntOrigin + L * vecDirection;
};
 
function OnMoveGripPoint {
  // When editing handles the following behavior:
  // Move the entire object when you drag over
  // First handle. And stretch the length and change the vector
  // Direction when stretching a second handle
  if (NMovingGrip == 1) {
     // Intermediate variables to define the geometry
     rW = W;
     rP = P;
     // Relative length
     rL = vecLen (pntGrip0 - pntGrip1) / rScl;
     // The new direction of the vector inserts
     vecDirection = pntGrip1 - pntGrip0;
    
     LoadInCache (P, W, L);
     // Select the new settings plate.
     SelectInCache (" kFirst ", " P ", " ~ ", rP, " W ", " = ", rW, " L ", " ~ ", rL);
  } Else {
     // If you edit the handle to move the 0 point
     // Insert an object
     pntOrigin = pntGrip0;
  };
};
 
function OnMakeParameters {
  // Classifications plates
  strTheName = " Panel NV ";
  strTheType = " Plita ";
  strTheSubType = " Plita ";
};
 
function OnDialog {// insert type of dialogue
  LoadInCache (obozn, L, W, H, massa, P);
  UniDialog (
     // The table control fields
     DBFLD, L, W, P,
     // The table reference field
     DBINF, obozn, H, massa,
     // Types - front, top, left
     TVIDS, lViewType, " F ", " T ", " L ",
     VIEW, " Vids ");
};
 
function OnDialogChanged {
  ShowDesign (0, " Preview ");
};
 
// Parameter changes
function OnChangeParameters {
  // Just when controlling parameter changes
  // Select from a table those which correspond to the new
  // Values
  if (new.L! = L || new.W! = W)
  {
     LoadInCache (L, W);
     SelectInCache (" kFirst ", " L ", " ~ ", new.L, " W ", " ~ ", new.W);
  }
  
  Handled = OBJ_HANDLED;
};
 
function OnSelectParam {
  // Function of the dynamic selection of parameters
  rW = W;
     // For type VTOP do not select dynamically
  if (lViewType == VTOP) {
     BreakAll = 1;
  } Else {
     // For other species
     // Selected variable rL - how
     // Abscissa the relative position of the cursor.
     rL = abs (vecCoord: x);
     // Selected values ??from the table with the same width,
     // But with a new value for the wavelength plate.
     SelectInCashe (" kFirst ", " W ", " = ", rW, " L ", " ~ ", rL);
  };
};
 
function BeforeConnect {
  ResetLastConstraint ();
}
 
function OnConnect
{
// Automatic installation of dependencies
// Set only parametric dependence.
// Between the plates along the length and width.
  if (rPart == 0)
  {
     if (obj.strTheType == " Plita ")
     {
        SetParamConstraint (L, obj, EXPR, " obj.L ");
        SetParamConstraint (W, obj, EXPR, " obj.W ");
        NoVectorSelect = 1;
        seted = 1;
     };
  };
}
// The name plate is formed on the basis of the table box
// Obozn
strPartName = obozn;