Special Functions

Предыдущая страницаВ началоСледующая страница

The following special functions are available in T-FLEX CAD:

check(,)

distance(,)

distance_u(,,)

measure(,,)

measure_u(,,,)

error()

message()

fixnodename()

get(,)

get_u(,)

get_lcs(,)

get_lcs_u(,)

getv(,)

setv(,)

graph(,)

isfragment()

tget(,)

switch(,,)

select(,)

tgetv(,)

tmgetv(,)

getg(,)

setg(,)

tgetg(,)

tsetg(,)

check("File name", Type)  -   Checks for the existence of a file (the file name is specified with the extension). The file type is specified by the following values:

0 - indefinite,

1 - T-FLEX CAD system document,

2 - font,

3 - database,

4 - texture,

5 - BOM.

The search is carried out in the current directory, and then in the directories specified in the System Options command, the Folders tab. If the specified file is found, the function returns 1, otherwise it returns 0.

distance("Name1", "Name2")   -   Get the value of the distance between two 2D or 3D elements (the parameters specify the names of the elements or their identifiers).

The function will be automatically substituted as expression for a variable if such variable is created when measuring distance between two 2D or 3D elements in Measure command.

Function syntax:

distance ("name1", "name2");

distance ("name1", "name2", "name_LCS") - if an LCS is specified;

distance_u ("name1", "name2", "name_unit") - if the units are specified;

distance_u ("name1", "name2", "name_LCS", "name_unit") - if LCS and units are specified.

name1 - the name of the first element or its identifier;

name2 - the name of the second element or its identifier;

name_LCS - LCS name;

name_unit - unit name.

You can determine the distance using the distance() function for the following pairs of 2D and 3D objects:

2D elements – is the distance between a 2D node and another 2D node, construction line, graphic line or hatch (the order of selecting the measurable entities is not significant);

3D objects – is the distance between two arbitrary 3D objects that are 3D construction entities (except for LCS), operations or such topological objects as an edge, loop, face, vertex.

Function distance() also measures distances for such geometrical 3D objects as vertices, edges, loops, faces. This is possible only for already named objects. Assignment of a name (for example, "Vertex_1" or "Edge_3") is carried out automatically in the Measure command or when using this object in any 3D operation. The name assigned to the object and must be used as its identifier when working with the distance () function.

Distance function examples

Distance between two 3D nodes "3D Node_0" and "3D Node_1" can be measured with the following call of distance() function:

distance ( "3D Node_0", "3D Node_1" )

Distance between image line with ID 0x3000014 and 2D node named as "Node 1" will be returned by the following call:

distance ( "0x3000014", "Node_1" )

Measure command is recommended for using distance().

measure("Name1", "Name2", "Ratio")   -   Get the specified ratio between two 2D or 3D objects (the names of the elements or their identifiers and the type of the ratio are specified).

The function will be automatically substituted as expression for a variable if such variable is created when measuring any relation (except distance) between two 2D or 3D elements in Measure command.

Function syntax:

measure("name1", "name2");

measure("name1", "name2", "name_LCS") - if an LCS is specified;

measure_u("name1", "name2", "name_unit") - if the units are specified;

measure_u("name1", "name2", "name_LCS", "name_unit") - if LCS and units are specified.

name1 - the name of the first element or its identifier;

name2 - the name of the second element or its identifier;

name_LCS - LCS name;

name_unit - unit name.

Function calculates the following types of relations:

for 2D elements:

"Angle" – is the angle between two lines, segments or a line and a segment.

for 3D objects:

"Angle" – is the angle between directional vectors of two 3D objects. Listed below are 3D objects, for which a direction can be defined (and, therefore, this relation can be calculated). Additionally specified is what will be selected as the direction vector for each object:

for a 3D path or open 3D profile lying on a straight line – the line direction;

for a 3D path or open 3D profile lying on an ellipse (circle) – the vector directed from the center of the ellipse (circle) normal to the plane of the ellipse (circle);

for a flat 3D profile; workplane; an operation body consisting of one face lying in a plane – the normal to the plane;

for a cylindrical worksurface; 3D profile lying on a cylinder; an operation body consisting of one face lying on a cylinder – the axis of the cylinder;

for a 3D profile, lying on a cone; an operation body consisting of one face lying on a cone – the axis of the cone;

for a toroidal worksurface; 3D profile or face lying on a torus; an operation body consisting of one face lying on a torus – the axis of the torus.

"AxisDistance" – is the distance between the axis of two 3D objects. The same 3D objects can be selected as the objects of the measurement as in the previous case (when identifying "Angle"), except for workplanes. In the latter case, the axes of the selected objects coincide with the directional vectors of the planes.

DX” – Shift of two 3D nodes or 3D points with respect to each other along the X-axis;

DY” – Shift of two 3D nodes or 3D points with respect to each other along the Y-axis;

DZ” – Shift of two 3D nodes or 3D points with respect to each other along the Z-axis.

Distance” – is the distance between two arbitrary 3D objects that are 3D construction entities (except for LCS), operations or such topological objects as an edge, loop, face, vertex.

GeomDistance” – is the distance between 3D points, 3D curves or surfaces corresponding to two respective 3D objects of the types: 3D node, vertex, edge, face.

MaxDistance” – Maximum distance between two 3D objects (between two points the most distant from each other).

MaxGeomDistance” – Maximum distance between two geometric elements (3D points, 3D curves or surfaces).

Analogous to distance(),  measure() can calculate relations between various topological 3D objects - vertices, edges, loops, and faces,  if these objects have already been used in any operation and were automatically named.

One more additional relation  can be measured for vertices, edges and faces, as well as for a pair "geometrical object – 3D node":

"GeomDistance" – is the distance between 3D points, 3D curves or surfaces corresponding to two respective 3D objects of the types: 3D node, vertex, edge, face.

Input parameters for distance() and measure() functions can be specified using either small or capital letters analogous to get() function. If an incorrect element name or relation name is input, then the function returns 0.

Measure function examples

Axial distance between cylinder axis resulted from extrusion operation named "Extrusion_1" and torus axis from "Rotation_2" operation can be calculated with the following call to measure() function:

measure ("Extrusion_1", "Rotation_2", "AxisDistance")

Measure command is recommended for using distance().

error(" ")  -   Display the user's message on the screen in an error warning window.

Functionspecial13

Functionspecial14

warn(" ")  -   Displays a user message in the diagnostic window, but unlike the previous command does not interrupt the model recalculation process. An item identifier can be used instead of a name, for example "0x01000010".

Functionspecial15

Functionspecial14

message(" ")  -  Display the user's message on the screen in a message box.

Functionspecial16

Functionspecial17

fixnodename(n)  -   Get the name of the fragment's node used for inserting the current document as a fragment by fixing points. This function is helpful for creating the libraries of logical and algorithmic schemes. It helps to orient direction of connecting arrow between elements. Input parameter: the number of the fragment's fixing point.

get("STR","P")  -  Get the value of the real parameter P of the system element named STR. Instead of an element name, you can specify its identifier (ID).

This function returns the value of the requested property of a 2D or 3D element, as well as the current drawing page. Sets of accessible properties vary depending on the queried element.

The function will be automatically substituted as expression for a variable if such variable is created when measuring properties of 2D or 3D element in Measure command.

The calling sequence:  

get("string1", "string2")

get("string1",…,"string1_n", "string2)

get_u("string1", "string2","string3") – if units are specified

get_lcs("string1", "string2","string3") – if LCS is specified

get_lcs_u("string1", "string2","string3","string4",) – if LCS and units are specified

string1 - element name or its identifier;

string1_n - element names or their identifiers in case of multiple dimensions;

string2 – parameter name;

string3 – unit name if suffix "_u", LCS if suffix "_lcs" or suffix "_lcs_u";

string4 – unit name if suffix "_lcs_u".

Multiple dimension is valid for all types of functions: get_u(), get_lcs(), get_lcs_u(). In case of multiple measurements, distances are measured using the get() function, with the parameter name "distance".

All 3D elements and operations are assigned Ids (unique identification numbers). They are also assigned a Name parameter that is automatically initialized by a system default. The name can be changed by the user if necessary. The 2D elements by default only get an Id. Names can be assigned to some 2D elements, particularly, to 2D nodes and graphic lines. The names are assigned in the editing commands, such as Edit Node or Edit Graphic Line, using the NameObject option.

The get() function allows you to get certain values of graphic items in the Variable Editor. The elements whose parameters can be got by the described function, are:

the drawing's 2D pages;

construction lines;

nodes;

graphic lines;

text;

fragments;

hatches;

3D elements;

3D operations;

faces, edges, loops.

This function is automatically substituted into the variable expression if the value of the selected property is saved in the variable in the Measure command.

The following reserved names are used for the available parameters:

for 2D pages of a drawing:

"ZONES_STEP_X" - the size of one zone along X-axis (the step size along X-axis);

"ZONES_STEP_Y" - the size of one zone along X-axis (the step size along Y-axis_;

"ZONES_OFFSET_X" - the offset of the area being divided into the zones from the point (0,0) - along X-axis;

"ZONES_OFFSET_Y" - the offset of the area being divided into the zones from the point (0,0) - along Y-axis;

"ZONES_COUNT_X" - the number of zones along X-axis;

"ZONES_COUNT_Y" - the number of zones along Y-axis.

The parameters of dividing a drawing page into zones are defined in the command Set Document Parameters, on the tab Paper > Zones.

for nodes:

"X" – X-coordinate of the node

"Y" – Y-coordinate of the node

for construction lines:

lines:

"X", "Y" – the coordinates of the first node the straight construction line is passing through.

"P1", "P2" - the coordinates of the second node the straight construction line is passing through.

circles and ellipses:

"LENGTH" – the length of the circumferential

"P1" – the radius of the circle (this parameter is specific to circles)

"X", "Y" – the coordinates of the center of the circle

splines, 2D paths, functions and offsets:

"LENGTH" – the entity length

for graphic lines:

segments:

"LENGTH" - the segment length

"Name or Page ID", "IMAGES_LENGTH" - total length of all graphic lines

"START_X", "START_Y" – the coordinates of the start point of the segment

"END_X", "END_Y" – the coordinates of the end point of the segment

based on circles:

"LENGTH" – the length of the circle arc;

"CENTER_X", "CENTER_Y" – the coordinates of the circle center;

"ANGLE" – the angular arc length of the graphic line;

"RADIUS" – the radius of the circle;

based on ellipses, splines, 2D paths, offsets and functions:

"LENGTH" – the entity length;

for graphic lines constructed as a circular or elliptical arc, portion of spline, 2D path, offset or function, there are following additional parameters:

"START_X", "START_Y" – coordinates of the arc start point;

"END_X", "END_Y" – coordinates of the arc end point;

for hatches:

"AREA" – the hatch area

"PERIMETER" – the hatch contour perimeter

"XMASS" - X-coordinate of the center of gravity

"YMASS" - Y-coordinate of the center of gravity

“XAREAMOMENT” – 1x component of inertia moment;

“YAREAMOMENT” – 1y component of inertia moment;

“PRODUCTAREAMOMENT” – Centrifugal inertia moment of area;

“XINERTIARADIUSVALUE” – Radius of inertia X;

“YINERTIARADIUSVALUE” - Radius of inertia Y;

“XAREAMOMENTMAINVALUE” – 1x component of principal moment of inertia relative to mass center;

“YAREAMOMENTMAINVALUE” – 1y component of principal moment of inertia relative to mass center;

“MAINAXESROTATIONVALUE” – Rotation angle of principal axes.

for text:

"WIDTH" – the text width

"HEIGHT" - the text height

"X", "Y" – X and Y coordinates of text fixing point;

“TEXT” – text content;

for fragments: "string 1" represents the fragment name or Id, "string 2" – the name of the fragment variable. The function returns the value of the variable.

In addition, the following parameters are available for 2D fragments:

“BoundBoxLeft” – left coordinate of bound box (X-coordinate);

“BoundBoxRight” – right coordinate of bound box (X-coordinate);

“BoundBoxTop” – top coordinate of bound box (Y-coordinate);

“BoundBoxBottom” – bottom coordinate of bound box (Y-coordinate);

“BoundBoxCenterX” –X-coordinate of bound box center;

“BoundBoxCenterY” –Y-coordinate of bound box center.

In the three-dimensional version of the system, the following 3D element parameters are accessible:

for operations:

"AREA" – the surface area

"MASS" – the mass of the body (material density accounted)

"XMASS", "YMASS", "ZMASS" - X, Y, Z-coordinates of the center of gravity

"IX", "IY", "IZ" – the moments of inertia about the axes X, Y, Z respectively

"IXY", "IYZ", "IZX" – the products of inertia with respect to the planes XY, YZ, ZX

"VOLUME" – volume

for "Apply Material" operation the following additional parameter is used:

"MaterialArea" – total area of faces with the attached material;

for all 3D Arrays (except arrays of faces) the following additional parameter is used:

"CopyCount" – actual number of copies in the array (with account of limitations and exclusions);

for 3D nodes:

"POINTX""POINTY""POINTZ"   - X, Y, Z-coordinates of the 3D node

for a 3D profile:

"AREA" – the area of the surface surrounded by the 3D profile

"PERIMETER" – perimeter of a closed 3D profile or length of an open one

for a 3D path:

"PERIMETER" – the length of the 3D path

for a face:

"AREA" - the area of the face surface

"PERIMETER" - the perimeter of the face border

special for a flat face:

"LocationX", "LocationY", "LocationZ" – X, Y, Z-coordinates of the face's underlying plane origin

"NormalX", "NormalY", "NormalZ" – X, Y, Z-coordinates of the normal to the face's underlying plane

"RefDirectionX", "RefDirectionY", "RefDirectionZ" – X, Y, Z-coordinates of the reference vector on the plane (the plane vector defines the direction of the X-axis of a flat plane)

special for a cylindrical face:

"RADIUS" – the radius of the cylinder

“Diameter” – cylinder diameter

"CENTERX", "CENTERY", "CENTERZ"   – X, Y, Z-coordinates of the center

"AXISX", "AXISY", "AXISZ"  – X, Y, Z-coordinates of the axis

for a toroidal face the following additional parameters are used:

"MaxRadius", "MinRadius" -  major and minor torus radii

"CenterX", "CenterY", "CenterZ" – X, Y, Z-coordinates of the torus center

"AxisX", "AxisY", "AxisZ" – X, Y, Z-coordinates of the torus axis

for a spherical face additional characteristics are used:

“Radius” – sphere radius

“Diameter” – sphere diameter

“CenterX”, “CenterY”, “CenterZ” – X, Y, Z-coordinates of sphere center

for an edge:

"PERIMETER" – the edge length

"STARTX", "STARTY", "STARTZ"  - X, Y, Z-coordinates of the start point

"ENDX", "ENDY", "ENDZ"  - X, Y, Z-coordinates of the end point

special for a straight edge:

"VECTORX", "VECTORY", "VECTORZ"   - X, Y, Z-coordinates of the edge direction

for a circular edge or along circular arc:

"Radius" – circle radius

“Diameter” – circle diameter

"CenterX", "CenterY", "CenterZ" – X, Y, Z-coordinate of the circle center

"AxisX", "AxisY", "AxisZ" – X, Y, Z-coordinates of the circle plane normal

"StartAngle" – arc start angle

"EndAngle" – arc end angle

special for a elliptical edge:

"MajorRadius" – ellipse major radius

"MinorRadius" – ellipse minor radius

"CenterX", "CenterY", "CenterZ" – X, Y, Z-coordinate of the ellipse center

"AxisX", "AxisY", "AxisZ" – X, Y, Z-coordinates of the normal to the ellipse plane

"MaxDirectionX", "MaxDirectionY", "MaxDirectionZ" – X, Y, Z-coordinates of the ellipse major axis

"MinDirectionX", "MinDirectionY", "MinDirectionZ" – X, Y, Z-coordinates of the ellipse minor axis

"STARTANGLE" – the start angle

"ENDANGLE" - the end angle.

for loop:

"Perimeter" – loop perimeter.

The parameter names are case-insensitive. If an incorrect element name or parameter name is input, then the function returns 0.

Get function examples

Get the X-coordinate of a node named NODE_1 by calling the function GET () as follows,

get ( "NODE_1", "X" )

Get the length of a graphic line named IMAGE_1 as follows,

get ( "IMAGE_1", "length" )

Get the perimeter of the contour of the hatch Id 0x9000001 as follows,

get ("0x9000001", "PERIMETER")

Get the volume of the 3D body of a 3D fragment named 3D fragment_11 as follows,

get ("3D fragment_11", "volume")

To compute the total length of a chain of connected graphic lines, one could call the function GET() for each line and sum up the results. However, a more efficient way is to construct a 2D path that follows along the chain of the graphic lines, and create a single graphic line from this path. In this case, the 2D path is considered a spline. Then it is easy to get the length of this single graphic line.

Functions getv() and setv()

Functions setv() and getv() allow the user to obtain and specify the values of real service characteristics of the T-FLEX CAD documents, such as the number of pages in the document, scale and font size, assigned for each page, coordinates of corners of the title block, volume of all bodies in the 3D scene (if the document contains a 3D model), etc. The values of these characteristics can be used, for example, for transferring data between the assembly drawing and the fragments.

getv("NAME",N)  -   Get the value of the service parameter of the document named NAME. Some parameters are defined separately for each 2D page of the document. In this case, "_Page" is added to the parameter name, where "Page" is the name of the required page of the current document. If no page name is specified, the parameter value for the first page of the document is returned.

setv("NAME",N)  -  Set the value N for the global system parameter named NAME.

The T-FLEX CAD system defines several service parameters that affect the display of the drawing on the screen. These parameters are:

SCALE – scale of current drawing.

XL – coordinate X of the left border of the drawing.

XH – coordinate X of the right border of the drawing.

YL – coordinate Y of the lower border of the drawing.

YH – coordinate Y of the upper border of the drawing.

_XL – coordinate X of the left border of the assembly drawing when using the current document as a fragment.

_XH – coordinate X of the right border of the assembly drawing when using the current drawing as a fragment.

_YL – coordinate Y of the lower border of the assembly drawing when using the current drawing as a fragment.

_YH – coordinate Y of the upper border of the assembly drawing when using the current drawing as a fragment.

FSIZE – font size of the drawing.

LTHICK – thickness of main lines in the drawing.

TLTHICK - thickness of thin lines in the document.

EXPLODE – state of exploded view mode for the fragments of 3D model of the current document (0 – exploded view mode is turned off, 1 – turned on).

XSIZE, YSIZE, ZSIZE – measure the overall dimensions of the 3D model along the X, Y and Z axes of the global coordinate system.

The following group of parameters allows you to perform page numbering in the formats of a multi-page document or specification.

APAGES - returns the total number of pages in the document containing a given fragment.

APAGE - returns the number of the page which contains a given fragment.

DPAGE – the number of the current drawing’s page.

DPAGES – total number of drawings’ pages in the document.

BOMPAGES – returns the total number of pages in the BOM of the document containing a given fragment.

BOMPAGE – returns the number of the page of the BOM which contains a given fragment.

getv_u allows you to return units of measurement.

The following service parameters are provided for three-dimensional models:

getv("mass",0) - mass of all bodies in the 3D scene of the current document, or mass set manually in document parameters. Mass set manually has the priority over the mass of bodies.

getv("volume",0) - volume of all bodies in 3D scene of the current document.

getv("area",0) - surface area of all bodies in 3D scene of the current document.

In the setv function, the parameters _XL, _XH, _YL, _YH, EXPLODE, PAGES, PAGE, BOMPAGES, BOMPAGE are not used.

In addition to these parameters, you can create your own service parameters.

The setv() and getv() functions allow you to set and receive the values of service parameters in the variable editor, respectively.

The setv() and getv() functions can receive and set the values of parameters set in the Set Document Parameters command of any page. To do this, when calling this function, it is necessary to form the name of the first operand from the old name (their list is given above), the underscore and the page name. For example, to get the scale of the second page, you need to call the function:

getv("SCALE_Page 2",0) – returns the value of the scale specified for the page of the current document with the name “Page 2”. If this page is absent in the document, the function returns the value “1”;

getv("mass",0) – returns the value of mass of all bodies in the 3D scene of the current document. If the 3D scene is empty, the function returns the value “0”;

setv("SCALE_Front_0",2)

If the page name is not specified, the parameter value for the first page of the document is returned.

Function syntax:

getv("NAME",N)

This call means: get the value of the service parameter of the system, where NAME is the name of the service parameter, N is the value that the function will return if it does not find the specified parameter.

You can get the value of any drawing parameter set by the setv() function.

setv("NAME",M)

This call means: set the value of the service parameter, where NAME is the name of the service parameter, M is the value that will be set for the specified parameter. A variable or an expression can be used as M.

If you specify a new name, the system will create a new service parameter for the current drawing. Service parameters can be used when transferring values between an assembly drawing and its component parts (fragments).

For example, in an assembly drawing, you use function

setv ("TMP", 50)

to create a service parameter TMP with a value of 50, and in fragments, using function

getv ("TMP", 0),

you get the value of the service parameter TMP equal to 50.

graph("Graph name",X) - Get the value of the function F(x), corresponding to the value of the X argument, for a graph named Graph name.

isfragment( )   -    Get a sign of using a drawing as a fragment. This function returns the value 0 if the drawing is current (loaded for editing), 1 if the drawing is a fragment of the first nesting level, 2 - of the second, etc.

The function is convenient if you need to extinguish any elements of the drawing when using it as a fragment.

 

tget( , )   -   The function allows you to get the text properties of elements: the name of the material of 3D operations, the values of the text variables of the fragment.

$text = tget("0xD000001","$razrab") – get the surname of the developer of the drawing.

$mater = tget("Extrusion_1","Material")  – defining the material for the "Extrusion_1" operation.

switch(Condition, Value1, Result1, Value2, Result2, … , Default result)  -   The function is used to select a value option by one condition.

The result will be accepted as the value of the variable, the value of which corresponds to the condition.

FunctionSpecial11

select(Condition1, Result1, Condition1, Result2, … , Default result) -   The function is used to select a value option for several conditions.

The conditions and results that will be specified if the condition is met are listed separated by commas.

The result of the first fulfilled condition, or the default result, will be accepted as the value of the variable.

FunctionSpecial12

If none of the listed options is suitable, and the default value is not set, the value of the variable will be zero.

tgetv( , )   -  This function is intended to get the value of text system variables or characteristics of the current drawing.

The function has two parameters. The first parameter is a text value. The second parameter is responsible only for the date/time output format for the parameters "PRINTDATE", "CREATEDATE", "SAVEDATE".

Calling example:

$TIME = tgetv ("TIME")

$TIME= tgetv ("CREATEDATE", "yyyy:MM:dd  hh:mm:ss")

The first parameter of the function can be one of the reserved values:

"USERNAME"

Name of current user of the system;

"YEAR"

Current year;

"MONTH"

Current month (number);

"DAYOFWEEK"

Current day of week (number);

"DAY"

Current day of month (number);

"HOUR"

Current hour;

"MINUTE"

Current minute;

"SECOND"

Current second;

"DATE"

Current date (the name) in accordance with system’s current settings;

"TIME"

Current time in accordance with system’s current settings;

"REGNAME"

User name on whom the system is registered;

"REGCOMPANY"

Name of company on which the system is registered;

"TITLE"        

Title of current drawing;

"SUBJECT"

Subject of current drawing;

"AUTHOR"

Name of author of current drawing;

"KEYWORDS"        

Keywords of current drawing;

"COMMENTS"

Comment of current drawing;

"TEMPLATE"

Template of OLE document;

"LASTAUTHOR"

Name of author who last saved the drawing by;

"REVNUM"

Number of revision of current drawing;

"EDITTIME"

Total editing time of current drawing;

"PRINTDATE"        

Date of the last print of current drawing;

"CREATEDATE"

Date of creation of current drawing;

"SAVEDATE"

Date of last save of current drawing;

"FILENAME"

Name of current file (the returned line contains full path to current document and the file name with extension);

"SHORTFILENAME"

Name of current file (the returned line contains the file name only);

"FORMAT"

Title block of current drawing;

"SCALE"

Scale of current drawing;

"SCALEVALUE"

Scale of the current drawing (the returned string contains the value of the scale without the letter М);

"MASSUNIT"

Units of mass measurement specified in the parameters of the current document
(Document Parameters > Document > 3D > Units > Mass);

"LINEARUNIT"

Units of length measurement specified in the parameters of the current document
(Document Parameters > Document > 3D > Units > Length);

"_FORMAT"

Title block of current drawing;

"FORMAT_BOM"

Returns the format of the first page of the "BOM" type. If there is no such page, it returns the format of the first page;

"_SCALE"

Scale for the drawing of the page on which the current fragment is inserted;

"_SCALEVALUE"

Scale of the current drawing (the returned string contains the value of the scale without the letter М);

"PAGENAME"        

Name of the page on which the current fragment is inserted;

"PAGETYPE"

Type of the page on which the current fragment is inserted.

The second (optional) parameter of the function can be one of the reserved values:

"d"

Day of the month without zero at the beginning;

"dd"

Day of the month;

"ddd"

Abbreviated name of the day of the week;

"dddd"

Full name of the day of the week;

"M"

Month without zero at the beginning;

"MM"        

Month;

"MMM"

Abbreviated name of the month;

"MMMM"

Full name of the month;

"yy, y"

Last two digits of the year;

"yyyy, yyy"

Year;

"h"

Clock in 12-hour format with no zero at the beginning;

"hh"

Clock in 12-hour format;

"H"

Clock in 24-hour format with no zero at the beginning;

"HH"        

Clock in 24-hour format;

"m"

Minutes without zero at the beginning;

"mm"

Minutes;

"s"

Seconds without zero at the beginning;

"ss"

Seconds;

"t"

Abbreviated designation of the part of the day (before or after noon) for the 12-hour format, if there is one in the current system language;

"tt"

Full designation of the part of the day (before or after noon) for the 12-hour format, if there is one in the current system language.

Extra characters in the parameters are ignored (for example, "ss" and "sssssss" will give the same result), the remaining characters are copied without changes. If there are single quotes or parameter letters in the text to be copied to the result, then it must be enclosed in single quotes, and to copy the quotation mark itself, you need to write two in a row.

tmgetv( )   -   This function works similarly to the tgetv function, but to get the values of the system variables of an assembly drawing in the case of using the current drawing as a fragment.

Functions for global variables

To access the values of global variables of real type, the following functions are used:

getg("NAME", N) - get the value of the global variable of the system (NAME is the name of the global variable, N is the value that the function returns if the variable "NAME" is not found).

setg("NAME", N) - set the value N for the global system variable named NAME. If a variable with the specified name does not exist, then it will be created.

To access the values of global variables of a text type, the following functions are used:

tgetg("NAME", STR)  - get the value of the global system variable (NAME is the name of the global variable, STR is the text string (the name of the text variable), which the function returns if the "NAME" variable is not found).

tsetg("NAME", STR) - set the STR value for the global system variable named NAME. If a variable with the specified name does not exist, then it will be created.

The second parameter can be a variable name or an expression.

In addition to using functions to set the value of global variables, you can call the Parameters > Global Variables command (the Edit option allows you to change the name, value, and type of the selected variable).

For example, in one document, you use the function...

setg ("TMP", 50)

...create a global TMP variable with a value of 50, and in other documents using the function...

getg ("TMP", 0)

...get the value of the global variable TMP equal to 50.