nanoCAD Platform Help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
I-profiles GOST 19425
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
I-profiles GOST 19425
I-profile script:
SVersion = 2; ObjectDescription = @ GOST_19425_74; function ActHeader { NPart = 1; Public ( // Open options- defining the geometry: length, height // Width of the shelves. L,LENGTH, h,I_SHAPE_HEIGHT, b,FLANGE_WIDTH, // Reference: weight per meter and the total weight massa,MASS, mas1,RUNNING_METER_MASS, // Standard designation and a series of I-beam Designation, @ STANDART_DESIGNATION, seria, @ SERIES, // Working planes WP1,CROSS_PLANE, WP2, @ BOTTOM_PLANE, WP3, @ SIDE_BOTTOM_RIGHT_PLANE, WP4, @ SIDE_TOP_RIGHT_PLANE, WP5, @ TOP_PLANE, WP6, @ SIDE_TOP_LEFT_PLANE, WP7, @ SIDE_BOTTOM_LEFT_PLANE, WP8, @ CROSS_PLANE ); Protected (seted, massa, bHid, seria); Changeable (L, b, h, WP1, WP2, WP3, WP4, WP5, WP6, WP7, WP8, Designation); OnDlgBeforeSelectParam = 1; ShowWhenSelPnt = 1; ContourOnLine = 0; NotStdBody = 1; }; function OnInitialization { LoadInCache (seria, Designation, h, b); if (seted == UnknownValue) { seted = 1; rZOrder = 100; bHid = 0; L = 50; strDesignName = "Implementation 1"; SelectInCache ("kFirst", "seria", "~", "C", "h", "~", 100, "b", "~", 10, "Designation", "~", "1") ; }; }; function SetGripPoint { // At four I-beam handle NGrip = 4; // Handles are situated at the extreme points of the model I-beam // The insertion point pntGrip0 = pntOrigin; // On the opposite end pntGrip1 = pntOrigin + L * vecDirection; // At the midpoint of the top shelf pntGrip2 = pntOrigin + h * vecPlane; // At the extreme point of the bottom shelf vecNormal = getLocalNormal (vecDirection, vecPlane); pntGrip3 = pntOrigin + vecNormal * b / 2; }; function OnMoveGripPoint { // The first carrying handle entire I-beam if (NMovingGrip == 0) { pntOrigin = pntGrip0; }; // The second handle stretches the length of the I-beam and determines // Direction vector insertion I-beam if (NMovingGrip == 1) { L = max (vecLen (pntGrip0 - pntGrip1), 1); vecDirection = pntGrip1 - pntGrip0; LoadInCache (seria, h, b); SelectInCache ("kFirst", "seria", "~", "20", "h", "~", h, "b", "~", b); }; // Handle height of an I-beam // At its height stretched selected new I-beam, // Roughly equal relative distance from the cursor point // Insert parts. if (NMovingGrip == 2) { // Auxiliary variable height of the new I-beam. rNew_h = vecLen (pntGrip0 - pntGrip2); LoadInCache (seria, h, b); SelectInCache ("kFirst", "seria", "~", "20", "h", "~", rNew_h, "b", "~", b); }; // Handle I-beam flange width // If it is stretched selected new I-beam flange width, // Approximately equal to twice the relative distance if (NMovingGrip == 3) { // A new auxiliary variable distances. rNew_b = 2 * vecLen (pntGrip0 - pntGrip3); LoadInCache (b, h); SelectInCache ("kFirst", "b", "~", rNew_b, "h", "~", h); }; }; function OnMakeParameters { strTheName = "19425-74"; strTheType = "Profile"; strTheSubType = "I-Shape"; massa = mas1 * L / 1000; // Find the right third vector in the workpiece coordinate system, // As the vector product vecNormal = getLocalNormal (vecDirection, vecPlane); // We place the plane in order counterclockwise // The plane of the first end WP1 = Plane (pntOrigin + vecDirection * (0), vecDirection); // The plane of the second end WP8 = Plane (pntOrigin + vecDirection * L, -vecDirection); // Plane from the middle of the bottom shelf. WP2 = Plane (pntOrigin-vecPlane * (0), -vecPlane); // Right side WP3 = Plane (pntOrigin + vecNormal * (b / 2), vecNormal); WP4 = Plane (pntOrigin + vecNormal * (b / 2) + vecPlane * h, vecNormal); // The plane from the middle of the upper shelf WP5 = Plane (pntOrigin + vecPlane * (h), vecPlane); // Left Side WP6 = Plane (pntOrigin-vecNormal * (b / 2) + vecPlane * h, -vecNormal); WP7 = Plane (pntOrigin-vecNormal * (b / 2), -vecNormal); }; function OnDialog { // For beauty strRefDataHeader = "------"; LoadInCache (seria, Designation, h, b); // Type of dialogue UniDialog ( // Define the parameters of a series of height and width of the shelves DBFLD, seria, h, b, // Reference parameters - designation and weight per meter DBINF, Designation, mas1, // Arbitrary length parameter I-beam VFLD, L, @ I_SHAPE_LENGTH__MM, // Making reference block settings page // Arbitrary properties strRefDataHeader, @ REFERENCE_DATA_, A, @ A__CM2, Ix,IX__CM, ix,IX__CM, Wx, @ WX__CM3, Sx, @ SX__CM3, Iy, @ IY__CM4, Wy, @ WY__CM3, iy,IY__CM, // Jackdaw display hidden lines BFLD, bHid,HIDDEN_LINES, // Display types AnyWBK generation means // Mirror species, if they are not overridden performances TVIDS, lViewType, "AnyWBK", VIEW, "Vids" ); }; function OnDialogChanged { ShowBool ??(0,HIDDEN_LINES); // Check the "invisible line" is only required for those species // For which they have. if (lViewType == VLEFT || lViewType == VRIGHT) {ShowBool ??(1,HIDDEN_LINES)}; }; function OnChangeParameters { // To change the settings: // Arbitrary simply assigned new values L = new.L; // For table or selected by a combination of the defining parameters if (new.b! = b || new.h! = h) { LoadInCache (h, b); SelectInCache ("kFirst", "h", "~", new.h, "b", "~", new.b); // Or by defining a standard notation field } Else if (Designation! = New.Designation) { LoadInCache (Designation); SelectInCache ("kFirst", "Designation", "~", new.Designation); }; Handled = OBJ_HANDLED; fix = 0; // The response to the change of position of the planes. // Is to recalculate the new position of the insertion point // And directions // Under the conditions IsFixedParam units can be grouped into // Options direction of the plane. // Surface normal collinear vecDirection if (IsFixedParam (WP1)) { fix = fix + 1; vecXOld = vecDirection; vecDirection = Vector (new.WP1); pntOrigin = Point (new.WP1) - vecDirection * (0); restoreBasis (vecXOld, vecPlane, vecDirection); }; if (IsFixedParam (WP8)) { fix = fix + 1; vecXOld = vecDirection; vecDirection = -Vector (new.WP8); pntOrigin = Point (new.WP8) - vecDirection * (L); restoreBasis (vecXOld, vecPlane, vecDirection); }; // Surface normal collinear vecPlane if (IsFixedParam (WP2)) { fix = fix + 1; vecYOld = vecPlane; vecNormal = getLocalNormal (vecDirection, vecYOld); vecPlane = -Vector (new.WP2); pntOrigin = Point (new.WP2) + vecPlane * (0); restoreBasis (vecYOld, vecNormal, vecPlane); vecDirection = getLocalNormal (vecPlane, vecNormal); }; if (IsFixedParam (WP5)) { fix = fix + 1; vecYOld = vecPlane; vecNormal = getLocalNormal (vecDirection, vecYOld); vecPlane = Vector (new.WP5); pntOrigin = Point (new.WP5) - vecPlane * (h); restoreBasis (vecYOld, vecNormal, vecPlane); vecDirection = getLocalNormal (vecPlane, vecNormal); }; // Surface normal collinear vecNormal if (IsFixedParam (WP3)) { fix = fix + 1; vecZOld = getLocalNormal (vecDirection, vecPlane); vecZNew = Vector (new.WP3); vecYNew = getLocalNormal (vecDirection, vecZNew); restoreBasis (vecZOld, vecPlane, vecZNew); pntOrigin = Point (new.WP3) - vecZNew * (b / 2); vecDirection = getLocalNormal (vecZOld, vecYNew); }; if (IsFixedParam (WP4)) { fix = fix + 1; vecZOld = getLocalNormal (vecDirection, vecPlane); vecZNew = Vector (new.WP4); vecYNew = getLocalNormal (vecDirection, vecZNew); restoreBasis (vecZOld, vecPlane, vecZNew); pntOrigin = Point (new.WP4) - vecZNew * (b / 2) + vecYNew * h; vecDirection = getLocalNormal (vecZOld, vecYNew); }; if (IsFixedParam (WP6)) { fix = fix + 1; vecZOld = getLocalNormal (vecDirection, vecPlane); vecZNew = -Vector (new.WP6); vecYNew = getLocalNormal (vecDirection, vecZNew); restoreBasis (vecZOld, vecPlane, vecZNew); pntOrigin = Point (new.WP6) + vecZNew * (b / 2) + vecYNew * h; vecDirection = getLocalNormal (vecZOld, vecYNew); }; if (IsFixedParam (WP7)) { fix = fix + 1; vecZOld = getLocalNormal (vecDirection, vecPlane); vecZNew = -Vector (new.WP7); vecYNew = getLocalNormal (vecDirection, vecZNew); restoreBasis (vecZOld, vecPlane, vecZNew); pntOrigin = Point (new.WP7) + vecZNew * (b / 2); vecDirection = getLocalNormal (vecZOld, vecYNew); }; if (fix > 1) { Handled = OBJ_ERROR; }; }; function BeforeConnect { ResetLastConstraint (); }; function OnSelectParam { // The dynamic selection of parameters. if (lViewType == VTOP || lViewType == VBOTTOM) // Do not choose the parameters for the types of side {BreakAll = 1;} else { // For other species to choose the length of an I-beam in the relative // Cursor abscissa L = max (abs (rXcoord), 1); }; }; // Formation of the line specifications, as the sum of substring strPartName =I_PROFILE_N_ + Designation + "x" + L + @ _MASS_ + massa + @ _GOST_19425_74;