T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design T-FLEX Parametric CAD. Fundamentals. 2D Design

scp.s.scptuj.mb.edus.si
from scp.s.scptuj.mb.edus.si More from this publisher
30.07.2013 Views

Creating a Database Creating Libraries of Parametric Elements At the step, you need to create an internal database to pick the values from. First, you need to decide, which will be the driving parameter. In our case, the candidate parameter is the bolt thread diameter. Therefore, the bolt diameter is entered in the first column, followed by all the rest of the parameters (except the length). The names of the database columns (and the database itself) should be made descriptive, so that later, when creating variables, you could easily remember which column relates to which parameter. However, too long column names are not recommended either. A good strategy is to name the columns according to engineering standard notations adopted in your industry. In our example, the thread diameter is named d, the bolt head size - S, etc. In our example, the input bolt length must be rounded to the nearest standard length. We should also account for the fact that the set of standard lengths is different for each diameter. For example, the bolt diameter of 6 mm corresponds with the length of 22 mm, while the bolts 12 mm in diameter have minimum length of 32 mm. Besides, depending on the selected bolt length, two additional parameters are defined: l1 and l0. We recommend creating separate databases of lengths for each diameter. The suggested database names are l6, l8, etc. The letter l, as in “length”, refers to the databases of lengths, while the number stands for the respective diameter. Once the databases are created, proceed to the next step. Creating Variables Relying on Databases At this step, we need to create variables that would be used for building the parametric drawing and the 3D model. We recommend using descriptive names for the variables. 709

Fundamentals. Two-Dimensional Design 710 First, define the driving variables for the rest of dimensions, whose values need to be defined when assembling the part. In this example, those are the diameter, the length and the implementation (see below). If a variable has a set of standard values, it is helpful to create the predefined list of values for convenient and quick input. The list of values can be created based on an existing field in the database. Upon creating a variable, it is a good practice to put a description in the comment field, so that another person can easily decide on what data to input, when working with this document. Next, we need to create variables that keep track of the database record number from which the values are taken. Such variable value can be read by calling the function rec or frec. For the functions description, refer to the chapter “Databases”. In this example, we need two such variables: one (the variable n) for accessing the values dependent on the bolt diameter from the respective database, and the other (the variable nl) for maintaining the value of the length. The challenge here is that the second variable should be assigned an appropriate record number across different databases (depending on the diameter). Besides, one should keep in mind, that the input length might not be always correct, as the designer of the part could enter a nonstandard bolt length. Therefore, the value of the variable nl can be described by the expression: d==6 ? frec(6.l,l) : (d==8 ? frec(l8.l,l) : d==… ), that means, if the variable d (diameter) is equal to 6, then do the search for the record number in the database number 6, otherwise, if the variable d is equal to 8 - then do the search for the record number in the database named l8, and so on over all databases. Next, create the rest of the variables. Their values are accessed by calling the function val based on the value of the variable that keeps the record number of the database (those are - n and nl). The value of the bolt length (ll) will be defined by the expression: d==6 ? val(nl,l6) : (d==8 ? val(l8.l,l) :d==… ). The meaning of this expression is similar to that of the variable nl described above. The bolt has several implementations. The drawing should adjust, depending on the implementation. This can be fulfilled by setting, when necessary, the level of certain drawing elements below the displayable threshold. We need to create special variables for this purpose (separate for each implementation). By default, the displayable elements have level from 0 to 127. If the level of an element is below zero, it is not displayed. Consider, for example, the variable imp25 that defines the level of the elements visible only in the implementations number two and five. It is equal to 0 when the implementation (defined by the string variable $imp) is equal to “2 - with pin hole” or “5 - with pin hole and groove”, and is equal to -10 in all other cases: $imp=="2 - with pin hole"||$imp=="5 - with pin hole and groove"?0:-10.

Creating a Database<br />

Creating Libraries of <strong>Parametric</strong> Elements<br />

At the step, you need to create an internal database to pick the values from.<br />

First, you need to decide, which will be the driving parameter. In our case, the candidate parameter is the bolt<br />

thread diameter. Therefore, the bolt diameter is entered in the first column, followed by all the rest of the<br />

parameters (except the length). The names of the database columns (and the database itself) should be made<br />

descriptive, so that later, when creating variables, you could easily remember which column relates to which<br />

parameter. However, too long column names are not recommended either. A good strategy is to name the<br />

columns according to engineering standard notations adopted in your industry. In our example, the thread<br />

diameter is named d, the bolt head size - S, etc.<br />

In our example, the input bolt length must be rounded to the nearest<br />

standard length. We should also account for the fact that the set of standard<br />

lengths is different for each diameter. For example, the bolt diameter of 6<br />

mm corresponds with the length of 22 mm, while the bolts 12 mm in<br />

diameter have minimum length of 32 mm. Besides, depending on the<br />

selected bolt length, two additional parameters are defined: l1 and l0. We<br />

recommend creating separate databases of lengths for each diameter. The<br />

suggested database names are l6, l8, etc. The letter l, as in “length”, refers to<br />

the databases of lengths, while the number stands for the respective<br />

diameter.<br />

Once the databases are created, proceed to the next step.<br />

Creating Variables Relying on Databases<br />

At this step, we need to create variables that would be used for building the parametric drawing and the 3D<br />

model. We recommend using descriptive names for the variables.<br />

709

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!