|
The file of the collection of mathematical expressions |
Scroll |
The file of the collection of mathematical expressions collection.law is an XML file containing mathematical expressions used for defining values of variables and parametric equation of curve by law in KOMPAS-3D documents.
The path to the file is defined by the environment variable EXPRCOLLECTION of KOMPAS-3D. If you want the location of the mathematical expressions collection file to be different from the default, use the file Kompas.ini.
More information about the determination of paths to system files and folders...
A collection file is created automatically on saving the first mathematical expression or a group law defines for the variable (saving is performed with the Save expressioncommand). All the expressions and laws saved further are automatically written into a collection file. If necessary, you can open and edit the file using one of text editors, or create a collection file of your own.
|
A collection file should be the only one and have the name thing and have the name collection.law. |
Mathematical expressions written into the collection file are displayed in the group From collection file in dialog Expression and can be used to set values of variables or parametric equations of the curve according to the law.
The syntax of the collection file has the following specialties.
•The file must contain the XML declaration and one root element <collection>.
•The elements containing mathematical expressions are included into the root element.
•Each mathematical expression is written into a separate <law> element. This element contains a string attribute whose value is the set mathematical expression. Besides, it may contain the comment attribute. You can enter additional information about expression Into the value of this attribute. This information is passed to the KOMPAS-3D system and displayed in the respective cell of the Comments dialog Expression.
•A few mathematical expressions written sequentially can be merged into a group to represent a group law. For that, the <complex_law> element is used. It may contain the name attribute whose value if the law name. Each expression which is part of a law is written in the form of a separate <law> element.
If necessary, you can change the values of attributes. All the changes made are passed to the dialog Expression.
Example of a file of collection of mathematical expressions:
<?xml version="1.0" encoding="utf-16"?>
<collection>
<law string="a*((1–x/a)^2–2*ln(1–x/a)–1)/4" comment="Route mile"></law>
<complex_law name= "Conical Spiral">
<law string="r*cos(t*M_PI2)" comment="X coordinate"></law>
<law string="r*sin(t*M_PI2)" comment="Y Coordinate"></law>
<law string="h*t" comment="Z coordinate"></law>
</complex_law>
<law string="k*a" comment="Archimedean Spiral"></law>
<law string="2*k*cos(a)+d" comment=”Limacon of Pascal"></law>
</collection>