├── .github
└── workflows
│ └── python-publish.yml
├── .gitignore
├── LICENSE
├── Makefile
├── MathcadPy
├── __init__.py
├── __version__.py
├── _application.py
└── util.py
├── README.md
├── Test
├── test.mcdx
├── test_output.mcdx
├── test_output.rtf
├── test_output.xps
├── test_units.mcdx
└── units_test.py
├── documentation
├── Examples
│ ├── matrix_example.mcdx
│ ├── matrix_example.py
│ ├── matrix_example_output.mcdx
│ ├── simple_example.mcdx
│ ├── simple_example.py
│ ├── simple_example_complete.mcdx
│ └── simple_example_output.mcdx
└── Images
│ ├── Example_000.PNG
│ ├── Example_001.PNG
│ ├── Example_002.PNG
│ ├── Example_003.PNG
│ ├── Getting_Started.md
│ ├── simple_example_001.PNG
│ ├── simple_example_002.PNG
│ ├── simple_example_003.PNG
│ ├── simple_example_004.png
│ ├── simple_example_005.PNG
│ ├── simple_example_006.PNG
│ ├── simple_example_007.PNG
│ ├── simple_example_complete_001.PNG
│ ├── simple_example_complete_002.PNG
│ ├── simple_example_complete_003.PNG
│ └── simple_example_complete_004.PNG
├── examples.py
├── make.bat
├── requirements.txt
├── setup.bat
├── setup.py
└── source
├── conf.py
└── index.rst
/.github/workflows/python-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will upload a Python Package using Twine when a release is created
2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3 |
4 | # This workflow uses actions that are not certified by GitHub.
5 | # They are provided by a third-party and are governed by
6 | # separate terms of service, privacy policy, and support
7 | # documentation.
8 |
9 | name: Upload Python Package
10 |
11 | on:
12 | release:
13 | types: [published]
14 |
15 | permissions:
16 | contents: read
17 |
18 | jobs:
19 | deploy:
20 |
21 | runs-on: ubuntu-latest
22 |
23 | steps:
24 | - uses: actions/checkout@v3
25 | - name: Set up Python
26 | uses: actions/setup-python@v3
27 | with:
28 | python-version: '3.x'
29 | - name: Install dependencies
30 | run: |
31 | python -m pip install --upgrade pip
32 | pip install build
33 | - name: Build package
34 | run: python -m build
35 | # - name: Publish package to TEST PyPI
36 | # uses: pypa/gh-action-pypi-publish@release/v1
37 | # with:
38 | # repository_url: https://test.pypi.org/legacy/
39 | # user: __token__
40 | # password: ${{ secrets.TEST_PYPI_API_TOKEN }}
41 | - name: Publish package to PyPI
42 | uses: pypa/gh-action-pypi-publish@release/v1
43 | with:
44 | skip_existing: true
45 | verbose: true
46 | user: __token__
47 | password: ${{ secrets.PYPI_API_TOKEN }}
48 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.stats
2 | *.pyc
3 | *.lnk
4 | Test/~$MathcadInterface.xlsm
5 | .pylint.d
6 | __pycache__
7 | build
8 | dist
9 | MathcadPy.egg-info
10 | COM_Info
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = source
9 | BUILDDIR = build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 |
--------------------------------------------------------------------------------
/MathcadPy/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | __init__.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | https://github.com/MattWoodhead/MathcadPy
7 |
8 | Copyright 2025 Matt Woodhead
9 |
10 | Requirements:
11 |
12 | Mathcad Prime ( https://www.mathcad.com )
13 | PyWin32 ( https://github.com/mhammond/pywin32 )
14 | """
15 |
16 | from ._application import Mathcad, Worksheet
17 | from ._application import _matrix_to_array, _array_check
18 | from . import __version__ as ver_file
19 |
20 | __author__ = ver_file.__author__
21 | __version__ = ver_file.__version__
22 |
--------------------------------------------------------------------------------
/MathcadPy/__version__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | __version__.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | https://github.com/MattWoodhead/MathcadPy
7 | Information about the current version of the MathcadPy package.
8 | Copyright 2025 Matt Woodhead
9 | """
10 |
11 | __title__ = 'MathcadPy'
12 | __description__ = 'A Python wrapper for the Mathcad Prime COM API'
13 | __version__ = '0.5'
14 | __author__ = 'Matt Woodhead'
15 | __author_email__ = 'ol9pzgqux@mozmail.com'
16 | __license__ = 'GNU GPL v3.0'
17 | __url__ = 'https://github.com/MattWoodhead/MathcadPy'
18 |
--------------------------------------------------------------------------------
/MathcadPy/_application.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | _application.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | https://github.com/MattWoodhead/MathcadPy
7 | Copyright 2025 Matt Woodhead
8 | """
9 |
10 | from pathlib import Path
11 | import pythoncom
12 | import win32com.client as w32c
13 |
14 |
15 | class Mathcad:
16 | """Mathcad application object"""
17 |
18 | _version_int = 0 # class variable for the Mathcad version
19 |
20 | def __init__(self, visible=True):
21 | # print("Loading Mathcad")
22 | try:
23 | self.__mcadapp = w32c.Dispatch("MathcadPrime.Application")
24 |
25 | self.version = "0"
26 | self.version_major_int = 0
27 | self.get_version() # Fetches Mathcad version and updates the above two variables
28 |
29 | self.open_worksheets = {}
30 | if visible is False:
31 | self.__mcadapp.Visible = False
32 | else:
33 | self.__mcadapp.Visible = True
34 | self._list_worksheets()
35 | except pythoncom.com_error as pcoe:
36 | try:
37 | if pcoe.args[1] == "Invalid class string":
38 | raise MathcadComError("Could not locate the Mathcad Automation API") from pcoe
39 | except:
40 | raise pythoncom.com_error from pcoe
41 |
42 | def __getattribute__(self, *args):
43 | """ Used to allow access to hidden attributes of class instances """
44 | # https://docs.python.org/3/reference/datamodel.html#special-method-lookup
45 | return object.__getattribute__(self, *args)
46 |
47 | def _list_worksheets(self):
48 | """lists worksheets open in the Mathcad instance"""
49 | ws_list = {}
50 | for i in range(self.__mcadapp.Worksheets.Count):
51 | ws_list[self.__mcadapp.Worksheets.Item(i).Name] = Worksheet(
52 | self.__mcadapp.Worksheets.Item(i), self,
53 | ) # {name: ws_object}
54 | self.open_worksheets = ws_list
55 |
56 | def activate(self):
57 | """Activate the Mathcad window. If visible, this maximises Mathcad"""
58 | self.__mcadapp.Activate()
59 |
60 | def get_version(self):
61 | """Fetches the version string from the attached MathCAD instance"""
62 | self.version = self.__mcadapp.GetVersion() # update the class variables
63 | self.version_major_int = int(self.version.split(".")[0])
64 | return self.version # return the version string to the function caller
65 |
66 | def active_sheet(self):
67 | """Returns the active worksheet name"""
68 | # TODO - should this be changed to return a sheet object?
69 | name = self.__mcadapp.ActiveWorksheet.Name
70 | if name == "":
71 | return None # Returns none if the current worksheet not saved
72 | return name
73 |
74 | def worksheet_names(self):
75 | """lists worksheets open in the Mathcad instance"""
76 | worksheets = []
77 | for i in range(self.__mcadapp.Worksheets.Count): # no. of open sheets
78 | worksheets.append(self.__mcadapp.Worksheets.Item(i).Name)
79 | return worksheets # Returns a list of open worksheet filenames
80 |
81 | def worksheet_paths(self):
82 | """lists worksheets open in the Mathcad instance"""
83 | worksheets = []
84 | for i in range(self.__mcadapp.Worksheets.Count): # no. of open sheets
85 | worksheets.append(self.__mcadapp.Worksheets.Item(i).FullName)
86 | return worksheets # Returns a list of open worksheet filenames
87 |
88 | def open(self, filepath: Path):
89 | """Opens the filepath (if valid) in Mathcad"""
90 | try:
91 | filepath = Path(filepath).resolve()
92 | if not filepath.exists():
93 | raise FileNotFoundError()
94 | if filepath.suffix.lower() != ".mcdx":
95 | raise ValueError()
96 |
97 | local_obj = self.__mcadapp.Open(str(filepath))
98 | # now we have opened a new worksheet, generate the list of open sheets from the API
99 | local_worksheets = {}
100 | # need to use a for-loop because the Mathcad API is shit
101 | for i in range(self.__mcadapp.Worksheets.Count):
102 | sheet_object = self.__mcadapp.Worksheets.item(i)
103 | # the api open method only returns a basic IMathcadPrimeWorksheet object
104 | local_worksheets[sheet_object.Name] = sheet_object
105 |
106 | # add the worksheet into the open worksheets dictionary
107 | self.open_worksheets[local_obj.Name] = Worksheet(local_worksheets[local_obj.Name], self)
108 | return self.open_worksheets[local_obj.Name] # return the worksheet object
109 |
110 | except TypeError as exc:
111 | raise TypeError(
112 | f"filepath expects a string or pathlib.Path object. Got {type(filepath)}"
113 | ) from exc
114 | except ValueError as exc:
115 | raise ValueError(f"The provided path is not a Mathcad Prime file: {filepath}") from exc
116 | except FileNotFoundError as exc:
117 | raise FileNotFoundError(f"The provided path does not exist: {filepath}") from exc
118 |
119 | def close_all(self, save_option="Discard"):
120 | """Closes all worksheets. Can specify save options before closing"""
121 | if save_option in ["Discard", 2]: # check for both "Discard" and its COM equivalent enum
122 | self.__mcadapp.CloseAll(2)
123 | elif save_option in ["Prompt", 1]:
124 | self.__mcadapp.CloseAll(1)
125 | elif save_option in ["Save", 0]:
126 | self.__mcadapp.CloseAll(0)
127 | else:
128 | print("incorrect save argument specified")
129 | self._list_worksheets()
130 |
131 | def quit(self, save_option="Discard"):
132 | """
133 | Closes all worksheets and closes the MathCAD instance.
134 | Can specify save options before closing
135 | """
136 | if save_option in ["Discard", 2]: # check for both "Discard" and its COM equivalent enum
137 | self.__mcadapp.Quit(2)
138 | elif save_option in ["Prompt", 1]:
139 | self.__mcadapp.Quit(1)
140 | elif save_option in ["Save", 0]:
141 | self.__mcadapp.Quit(0)
142 |
143 |
144 | class Worksheet:
145 | """Mathcad Worksheet object
146 |
147 | Either a filepath for a mathcad file can be supplied, or the
148 | filepath can be set to None (or similar) and the optional
149 | open_sheet_name argument can be used
150 | """
151 |
152 | def __init__(self, _worksheet_COM_object=None, _application_class=None):
153 | self.ws_object = _worksheet_COM_object
154 | self._app_class = _application_class
155 | # try:
156 | self.__repr__ = self.ws_object.FullName
157 | # except:
158 | # self.__repr__ = "__repr__error"
159 |
160 | def activate(self):
161 | """activates the worksheet object"""
162 | self.ws_object.Activate()
163 |
164 | def close(self, save_option="Save"):
165 | """Closes the worksheet"""
166 | if save_option in ["Discard", 2]:
167 | self.ws_object.Close(2)
168 | elif save_option in ["Prompt", 1]:
169 | self.ws_object.Close(1)
170 | elif save_option in ["Save", 0]:
171 | self.ws_object.Close(0)
172 | else:
173 | print("incorrect save argument specified")
174 |
175 | def save(self):
176 | """Saves the worksheet"""
177 | self.ws_object.Save()
178 |
179 | def save_as(self, new_filepath: Path):
180 | """Saves the worksheet under a new filename"""
181 | new_filepath = Path(new_filepath) # Cast to Path object incase they have used a string
182 | if new_filepath.suffix.lower() == ".pdf":
183 | if self._app_class.version_major_int > 4:
184 | # some versions of Mathcad Prime 5 had PDF export. 6 onwards had the functionality officially.
185 | self.ws_object.SaveAs(new_filepath)
186 | else:
187 | raise ValueError("Mathcad Prime 8 or newer is required to export as PDF")
188 | elif new_filepath.suffix.lower() in [".mcdx", ".rtf", ".xps"]:
189 | self.ws_object.SaveAs(new_filepath)
190 | else:
191 | raise ValueError(
192 | "Filename must include one of the following file extensions: "
193 | "'.mcdx', '.pdf', '.rtf', '.xps'"
194 | )
195 |
196 | def name(self):
197 | """Returns the filename of the Worksheet object"""
198 | return self.ws_object.Name
199 |
200 | def is_readonly(self):
201 | """Returns the worksheets read only status"""
202 | return self.ws_object.IsReadOnly # Always return state
203 |
204 | def is_modified(self, setmodfied=None):
205 | """Returns (and can optionally set) the worksheets modified status"""
206 | if setmodfied is True: # If readonly has been set to True
207 | self.ws_object.Modified = True
208 | return self.ws_object.Modified # Always return state
209 |
210 | # ~~~~~~~~~~~~~~~~~~~~~ Worksheet Operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~
211 |
212 | def pause_calculation(self):
213 | """Pauses worksheet calculation"""
214 | self.ws_object.PauseCalculation()
215 |
216 | def resume_calculation(self):
217 | """Resumes the worksheets calculation"""
218 | self.ws_object.ResumeCalculation()
219 |
220 | def inputs(self):
221 | """returns a list of the designated input fields in the worksheet"""
222 | _inputs = []
223 | for i in range(self.ws_object.Inputs.Count): # no. of open sheets
224 | _inputs.append(self.ws_object.Inputs.GetAliasByIndex(i))
225 | return _inputs
226 |
227 | def get_input(self, input_alias):
228 | """Fetches the curent value of a specific input"""
229 | if input_alias in self.inputs():
230 | try:
231 | result = self.ws_object.InputGetValue(input_alias)
232 | result_type = result.ResultType
233 | if result_type == 1: # ValueResultTypes_Real
234 | return result.RealResult, result.Units, result.ErrorCode
235 | if result_type == 2: # ValueResultTypes_String
236 | return result.StringResult, result.Units, result.ErrorCode
237 | if result_type == 3: # ValueResultTypes_Matrix
238 | return _matrix_to_array(result.MatrixResult), result.Units, result.ErrorCode
239 | # else
240 | return None, None, None
241 | except pythoncom.com_error as pcoe:
242 | raise MathcadComError("COM Error fetching real_output") from pcoe
243 | getinput = self.ws_object.InputGetRealValue(input_alias)
244 | return getinput.RealResult, getinput.Units, getinput.ErrorCode
245 | # else
246 | raise ValueError(f"{input_alias} is not a designated input field")
247 |
248 | def _get_real_input_units(self, input_alias):
249 | """
250 | Fetches the units of a specific matrix input. This is an internal function and no input
251 | sanitisation checks are performed
252 | """
253 | return self.ws_object.InputGetRealValue(input_alias).Units
254 |
255 | def get_matrix_input(self, input_alias):
256 | """Fetches the curent value of a specific input"""
257 | if input_alias in self.inputs():
258 | getinput = self.ws_object.InputGetMatrixValue(input_alias)
259 | return _matrix_to_array(getinput.MatrixResult), getinput.Units, getinput.ErrorCode
260 | # else
261 | raise ValueError(f"{input_alias} is not a designated input field")
262 |
263 | def _get_matrix_input_units(self, input_alias):
264 | """
265 | Fetches the units of a specific matrix input. This is an internal function and no input
266 | sanitisation checks are performed
267 | """
268 | return self.ws_object.InputGetMatrixValue(input_alias).Units
269 |
270 | def outputs(self):
271 | """returns a list of the designated output fields in the worksheet"""
272 | _outputs = []
273 | for i in range(self.ws_object.Outputs.Count):
274 | _outputs.append(self.ws_object.Outputs.GetAliasByIndex(i))
275 | return _outputs # Returns a list of output aliases
276 |
277 | def get_real_output(self, output_alias, units="Default"):
278 | """Gets the numerical value from a designated output in the worksheet"""
279 | assert isinstance(output_alias, str)
280 | assert isinstance(units, str)
281 | if output_alias in self.outputs():
282 | try:
283 | if units == "Default":
284 | result = self.ws_object.OutputGetRealValue(output_alias)
285 | return result.RealResult, result.Units, result.ErrorCode
286 | # else
287 | result = self.ws_object.OutputGetRealValueAs(output_alias, units)
288 | return result.RealResult, units, result.ErrorCode
289 | except pythoncom.com_error as pcoe:
290 | raise MathcadComError("COM Error fetching real_output") from pcoe
291 | else:
292 | raise ValueError(f"{output_alias} is not a designated output field")
293 |
294 | def get_output(self, output_alias):
295 | """Gets the value from a designated output in the worksheet"""
296 | assert isinstance(output_alias, str)
297 | if output_alias in self.outputs():
298 | try:
299 | result = self.ws_object.OutputGetValue(output_alias)
300 | result_type = result.ResultType
301 | if result_type == 1: # ValueResultTypes_Real
302 | return result.RealResult, result.Units, result.ErrorCode
303 | if result_type == 2: # ValueResultTypes_String
304 | return result.StringResult, result.Units, result.ErrorCode
305 | if result_type == 3: # ValueResultTypes_Matrix
306 | return _matrix_to_array(result.MatrixResult), result.Units, result.ErrorCode
307 | # else
308 | return None, None, None
309 | except pythoncom.com_error as pcoe:
310 | raise MathcadComError("COM Error fetching real_output") from pcoe
311 | else:
312 | raise ValueError(f"'{output_alias}' is not a designated output field")
313 |
314 | def _get_output(self, output_alias):
315 | """DEPRECATED: Gets the value from a designated output in the worksheet"""
316 | # TODO - add deprecation notice
317 | return self.get_output(output_alias)
318 |
319 | def get_matrix_output(self, output_alias, units="Default"):
320 | """Gets the numerical value from a designated output in the worksheet"""
321 | assert isinstance(output_alias, str)
322 | assert isinstance(units, str)
323 | if output_alias in self.outputs():
324 | try:
325 | if units == "Default":
326 | result = self.ws_object.OutputGetMatrixValue(output_alias)
327 | else:
328 | result = self.ws_object.OutputGetMatrixValueAs(output_alias, units)
329 | print(dir(result))
330 | return _matrix_to_array(result.MatrixResult), None, result.ErrorCode
331 | except pythoncom.com_error as pcoe:
332 | raise MathcadComError("COM Error fetching matrix output") from pcoe
333 | else:
334 | raise ValueError(f"{output_alias} is not a designated output field")
335 |
336 | def set_real_input(self, input_alias, value, units="", preserve_worksheet_units=True):
337 | """Set the value of a numerical input range in the worksheet"""
338 | assert isinstance(input_alias, str)
339 | assert isinstance(units, str)
340 | assert isinstance(preserve_worksheet_units, bool)
341 | if input_alias in self.inputs(): # Use inputs function to get list
342 | if preserve_worksheet_units:
343 | previous_units = self._get_real_input_units(input_alias)
344 | if units: # If units is not equal to ""
345 | try:
346 | assert units == previous_units
347 | except AssertionError as exc:
348 | raise AssertionError(
349 | "preserve_worksheet_units is True. The units argument "
350 | "does not equate to the units present in the Worksheet"
351 | ) from exc
352 | else: # No units are specified, but preserve_worksheet_units is True
353 | units = previous_units
354 | error = self.ws_object.SetRealValue(input_alias, value, units)
355 | # COM command returns error count. 0 = everything set correctly
356 | else:
357 | raise ValueError(f"{input_alias} is not a designated input field")
358 | if error > 0:
359 | print(f"\nWarning!\nerror setting '{input_alias}' value/units\n")
360 | return error
361 |
362 | def set_string_input(self, input_alias, string_value):
363 | """Set the value of a numerical input range in the worksheet"""
364 | assert isinstance(input_alias, str)
365 | assert isinstance(string_value, str)
366 | if input_alias in self.inputs(): # Use inputs function to get list
367 | error = self.ws_object.SetStringValue(input_alias, string_value)
368 | # COM command returns error count. 0 = everything set correctly
369 | else:
370 | raise ValueError(f"{input_alias} is not a designated input field")
371 | if error > 0:
372 | print(f"\nWarning!\nerror setting '{input_alias}' value/units\n")
373 | return error
374 |
375 | def set_matrix_input(self, input_alias, matrix_array, units="", preserve_worksheet_units=True):
376 | """Set the value of a numerical input range in the worksheet"""
377 | assert isinstance(input_alias, str)
378 | assert isinstance(units, str)
379 | assert isinstance(preserve_worksheet_units, bool)
380 | if input_alias in self.inputs(): # Check that the alias specified exists in the worksheet
381 | if preserve_worksheet_units:
382 | previous_units = self._get_matrix_input_units(input_alias)
383 | if units: # If units is not equal to ""
384 | try:
385 | assert units == previous_units
386 | except AssertionError as exc:
387 | raise AssertionError(
388 | "preserve_worksheet_units is True. The units argument "
389 | "does not equate to the units present in the Worksheet"
390 | ) from exc
391 | else: # No units are specified, but preserve_worksheet_units is True
392 | units = previous_units
393 |
394 | rows, cols = _array_check(matrix_array)
395 | temp_matrix = self.ws_object.CreateMatrix(rows, cols)
396 | for row in range(rows):
397 | for col in range(cols):
398 | value = matrix_array[row][col]
399 | try:
400 | temp_matrix.SetMatrixElement(row, col, value)
401 | except Exception as exc:
402 | raise ValueError(
403 | f"Error setting matrix element {row},{col}: {value}"
404 | ) from exc
405 |
406 | error = self.ws_object.SetMatrixValue(str(input_alias), temp_matrix, str(units))
407 | # error = self.ws_object.SetRealValue(str(input_alias),
408 | # matrix_array, str(units))
409 | # COM command returns error count. error = 0 -> everything set correctly
410 |
411 | else:
412 | raise ValueError(f"{input_alias} is not a designated input field")
413 | if error > 0:
414 | print(f"\nWarning!\nerror setting '{input_alias}' value/units\n")
415 | return error
416 |
417 | def PauseCalculation(self): # todo - duplicate of pause_calculation
418 | """DEPRECATED: Pauses worksheet calculation - may speed up routines the set many input values"""
419 | print(
420 | "Warning: the PauseCalculation method will be removed in a future version "
421 | "- use pause_calculation instead"
422 | )
423 | self.ws_object.PauseCalculation()
424 |
425 | def ResumeCalculation(self): # todo - duplicate of resume_calculation
426 | """DEPRECATED: Pauses worksheet calculation"""
427 | print(
428 | "Warning: the ResumeCalculation method will be removed in a future version "
429 | "- use resume_calculation instead"
430 | )
431 | self.ws_object.ResumeCalculation()
432 |
433 | def syncronize(self):
434 | """Syncronises (i.e. re-calculates) worksheet"""
435 | self.ws_object.Synchronize()
436 |
437 | def calculate(self):
438 | """Syncronises (i.e. re-calculates) worksheet"""
439 | self.ws_object.Synchronize()
440 |
441 |
442 | def _matrix_to_array(mathcad_matrix_obj) -> list:
443 | """converts a COM matrix object to a list of lists (row = sub list, column = value)"""
444 |
445 | rows = int(mathcad_matrix_obj.Rows)
446 | # print(f"rows: {rows}")
447 | cols = int(mathcad_matrix_obj.Columns)
448 | # print(f"cols: {cols}")
449 | matrix = []
450 | for row in range(rows):
451 | row_list = [mathcad_matrix_obj.GetMatrixElement(row, col) for col in range(cols)]
452 | matrix.append(row_list)
453 | return matrix
454 |
455 |
456 | def _array_check(matrix_array: list):
457 | """A helper function to validate that the array input is suitable to be sent to Mathcad"""
458 | rows = len(matrix_array)
459 | previous_cols = 0
460 | for i, row_list in enumerate(matrix_array):
461 | cols = len(row_list)
462 | if i != 0:
463 | if cols != previous_cols: # check that every row has the same number of columns
464 | raise ValueError("Inconsistent number of columns in input matrix")
465 | previous_cols = cols
466 | return rows, cols
467 |
468 |
469 | class MathcadComError(Exception):
470 | """Base class for all COM related exceptions for the MathcadPy module.
471 |
472 | If specified, the error code is automatically appended to the message:
473 |
474 | >>> # With an error code (it also works with a specific error):
475 | >>> error = CanOperationError(message="Failed to do the thing", error_code=42)
476 | >>> str(error)
477 | 'Failed to do the thing [Error Code 42]'
478 | >>>
479 | >>> # Missing the error code:
480 | >>> plain_error = CanError(message="Something went wrong ...")
481 | >>> str(plain_error)
482 | 'Something went wrong ...'
483 |
484 | :param error_code:
485 | An optional error code to narrow down the cause of the fault
486 |
487 | :arg error_code:
488 | An optional error code to narrow down the cause of the fault
489 | """
490 |
491 | def __init__(self, message: str = "", error_code: int = None) -> None:
492 | self.error_code = error_code
493 | super().__init__(message if error_code is None else f"{message} [Error Code {error_code}]")
494 |
495 |
496 | if __name__ == "__main__":
497 | mc = Mathcad()
498 | print(mc.get_version())
499 | print(mc.version_major_int)
500 |
--------------------------------------------------------------------------------
/MathcadPy/util.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | util.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2025 Matt Woodhead
7 | """
8 |
9 | import subprocess
10 |
11 |
12 | def list_installations():
13 | """returns the install location, program name, and version of all Mathcad instances"""
14 | # TODO - tidy format
15 | data = subprocess.check_output("wmic product where \"Name like '%mathcad%'\" get Name, Version, InstallLocation")
16 | data = [dt.strip() for dt in str(data).split("\\r\\r\\n") if "Mathcad" in dt]
17 | print("Warning: The output format of mathcadpy.util.list_installations() is subject to change")
18 | return data
19 |
20 |
21 | if __name__ == "__main__":
22 | print(list_installations())
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MathcadPy
2 |
3 |
4 | [](https://pypi.org/project/MathcadPy/) [](https://pepy.tech/project/mathcadpy)
5 |
6 | A Python wrapper for the Mathcad Prime automation API. See [the Wiki](https://github.com/MattWoodhead/MathcadPy/wiki/0.-Home) for the module documentation.
7 |
8 | ### Requirements
9 | - [Mathcad Prime 3+](https://www.mathcad.com/)
10 | - [win32com](https://github.com/mhammond/pywin32)
11 |
12 | ### Features
13 | MathcadPy is a python wrapper for the Mathcad Prime COM automation API. This allows a python script to interact with a Mathcad session, select worksheets that are already open or open worksheets from files, and send values to designated inputs and fetch them from designated outputs. The python script also has access to the worksheet units, and can even demand results in different units to those specified in a worksheet (e.g. calculation may output a value in meters, but the script wants the value in inches).
14 |
15 | ### Usage
16 | Install using: `pip install MathcadPy`
17 |
18 | See [the Wiki](https://github.com/MattWoodhead/MathcadPy/wiki/0.-Home) for the module documentation.
19 |
20 | See examples.py for some simple function examples including matrix operations.
21 |
22 | ### licensing and credits
23 | Author: Matt Woodhead
24 |
25 | MathcadPy is licensed under the GPLv3
26 | ```
27 | This program is free software: you can redistribute it and/or modify
28 | it under the terms of the GNU General Public License as published by
29 | the Free Software Foundation, either version 3 of the License, or
30 | (at your option) any later version.
31 |
32 | This program is distributed in the hope that it will be useful,
33 | but WITHOUT ANY WARRANTY; without even the implied warranty of
34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 | GNU General Public License for more details.
36 |
37 | You should have received a copy of the GNU General Public License
38 | along with this program. If not, see .
39 |
40 | For the full license, see the LICENSE file.
41 | ```
42 |
--------------------------------------------------------------------------------
/Test/test.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/Test/test.mcdx
--------------------------------------------------------------------------------
/Test/test_output.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/Test/test_output.mcdx
--------------------------------------------------------------------------------
/Test/test_output.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\deff0{\colortbl\red255\green255\blue255 ;\red0\green0\blue0 ;}{\fonttbl{\f0\fnil Tahoma;}{\f1\fnil Times New Roman;}}{\stylesheet}\paperw11906\paperh16838{\pard\plain\plain\pard\phmrg\pvmrg\posx75\posy307\absw8933\absh-314\cbpat0\brdrr\brdrs\brdrw50\brdrcf0\brdrl\brdrs\brdrw50\brdrcf0\ltrpar\itap0{\lang1033\fs22\f0\cf1\cf1\ql{\fs26\f0{\lang2057\ul\ltrch MathcadPy Interface Test Worksheet}\li0\ri0\sa0\sb0\fi0\qc\par}}}{\pard\plain\plain\pard\phmrg\pvmrg\posx925\posy914\absw921\absh-266\cbpat0\brdrr\brdrs\brdrw50\brdrcf0\brdrl\brdrs\brdrw50\brdrcf0\ltrpar\itap0{\lang1033\fs22\f0\cf1\cf1\ql{\f0{\lang2057\b\ltrch Inputs}\li0\ri0\sa0\sb0\fi0\ql\par}}}{\pard\phmrg\pvmrg\posx850\posy1641\absw2190\absh-480{\pict\pngblip\dn-27\picw2190\pich480 89504e470d0a1a0a0000000d4948445200000092000000200806000000f97921f0000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa8640000063049444154785eed9a778c14551cc7676f1754d4602226a22676057bc55e22c6965bb0c6aefc81622cb12b89a727e662d4608968e0b8d8b06b34168c62ef057b43d15850aca801eb811eebf733f37e97b9637677f66eee96c0fb269fbc793beded7bbff6ee363f72fca4d5571a3aa263deac173a022faf1e2a576c9a3aa5a3549ab6b063d1ec42213f6446cba9b3dd392fafd46a706d30a83070e680203f1cc3721f7979a556a7219582dc9ce92de31e2a05c126ee232fafd4ea34242f2f2fafba2bd7d8d43636970bd6717d2faf9a24db199ccb152604c58bdb2e759f7979d5acc6e6d661c5a6b6e37c8de4d52be583c5eddaaa15bc217965226f485e99c81b925726ea6f435a57bc234a62573e4829fe6d333f3af45a1ad5df863447344787c115ae4da3e7c5e5d1615d84113f1c1da6d67be2a3e8b0d73a42e07cc786bd6c3540dc222e087b4baadaf950f5486dbbbbf62dd7a6d138715574d8ef2a8ac1e28bb0974e6b88ad058e93850e75edfbaecd429b8b0fc5d3e204314cc455ed7c17d5c3907671ed13ae5dda6586ff8a6bd3683fd7beeddade6a4bf18bf82cec65a38f05cf25d210edbaabdaf92e4a3224feca3d4bfc28f825000b7e9788ffbce428f189b841bc215a84691b8125dfe4da99227e7eb8f84b90aeaae94ac1fdedc26a2a9ec502fd2a8e14cf8aabc5023146989e144411ae7d44dc21be143c73a0c030f89e4c187dc4b3e7092210e984ef7e9a60bc27891b4525ed20b887f1a011e2c1e83054a57963ecccd704f1aeeb5f271827d1e177c1f788a7b73dc463e2f8b0574f25fc657b9a384790dfff151b0af23dc718d9e9020b35af6381bf8d0e832d048b3e29ec05c189826beda7294c34fd17c35e65f1dc37c5f6c29ec18263e08dee330c651581be76a0fdc50cc13d5c67f99def459f7ae76e8151d13723e57d7f0a332c449f85ad45cc1d06197f4ea579231532bf766eaec0411086c37d9785bdaec22039c77cee267e10bc37091c2a2fba6b27f19fb839ec2da98ae747374f5eafd834754c5244fa4ddc2736154c2c8b3552f0f39285e25a8161e1f188fae5e5e83068130c9605429bb9f629d7eee9da34f511918b08601388e7b1ebc300887a88f7d8c2af2dbe116888e03a8c90688267a341ae5d5f4c14a3c54fc2c6c33b3f178bc25eb4d82b8b5a52146361ee883cf61c0ca5d2bc6d2c0a02c338451c28888888a883ccb0e2c2383712380e916ba8e05d4930177df62bd824433a4b6c2bf862aff381441af94a1042f99cc8444ac0132828893c4ce0ce02c3c3a310cfc19a890e682fd712a2ab89d4484ae51e169b67b0c8670b3348ce23269d7159babc53dc2aba1bc68eae257dac2058f0e982f37b0b8c869463dac7b5b6e069c4a23296b8b3549a37f4aa20f5ae25268b0f044681cc19b82649ccf73fd161fd54aed82e5760da8fde08b7e46d16f412c14290b61079de8421f145b712e709521f45e31f22cd76fe64c1e2de2fce15bc136120d46c4423748cc0606f1318104a8a267c86513e2a8846c88c842880889ed744879d86c7ce85b1a719737cee702ec65369de8816d451380e699a5d22dfe53081e2ce70863840982e145ccbbd6c627a92da3251394362500c90098feb25d7aeea5a84979102f140eef95b203c9c1483611d2ef0b60d0493c284ae28aa6994c01ba9e3ce1414d4a401de1937586a0b52c6d18248832c9ad84e87fa6835315e5884425657d9f5df8983a2c3d07888ae3f8bebc5f7a29a701e4404e51e6ac64af336561c2278172222928288943827ce4084e2faf345fc6f536c1e704ceac6d744dd525bb99f9110451858922860a945d89910a29f11560bb1d3c0e3c9f59c7b4e7c2aa817f0b67b040bc7e23231d5440d405ac563ad563a585060c6772f8f0b520569c38a6f0a6aaee35d8c9931b06b32f17ece314eb85d10e1f05cdbfdb1abe2fdecc48852f1e2b99c1817068f133e206c3ce5e68d7150cc33679ce3383e4e0c0be3c1e8d86464299cab556060d46f640d2b3f50b5f39dc5f6b2fc7b247644166dbcfa4895766dfda9a45c6ea429c8cbc9d21f5e9ca54835496335d8992d97aab72125e57283faa827c288ee8d0ec33f08da363a0b5107268dd56047b95caade86d417a298df4ee4047f7762c7e7d5c75a160dc9ab0ef286e49589bc217965226f485ebdd2e220bf662928cdcf8dbaa875df524383fd59dfcbab266947d3bea061eec4ff0101c2ab02f7ef1d8b0000000049454e44ae426082}\par}{\pard\phmrg\pvmrg\posx850\posy2208\absw3780\absh-480{\pict\pngblip\dn-27\picw3780\pich480 89504e470d0a1a0a0000000d49484452000000fc00000020080600000036571533000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa86400000a8449444154785eeddc078c6c7515c7f199f75654d4400258d0d81bf68ab14451882d94187b378a624b2c5840504451d8050ba246789a28b658838a51ecd8c5de50148dd80534a28880be5d7f9f997b60d8ccec2ebbefbd7deefebfc92f77ee9db9f7feeff99fff39e7ff9fd9ddb8f72127ec72f5ebedb9f9bc334fdfdc6b341a6b9afe7e879ff4b6cd7373275fb2f9d2b3a6a636ee7ada51cf3eab7bafd168ac313674dbde8e533b9c7195dec63d0480ee50a3d158635c36e0e77afd734e3deaa053e67abd5b76871a8dc61ae3b201df68341a8d46630dd1dff7f04d07f6fbbd1b74fb8d46630d9231bed305fda9437bfbbd7cd32bbb638d46638db2ff6127ee73c0119bf66a73f846631dd09fdaf05fdb36e01b8d75441bf08dc63aa20df846631db1ad07fc8da2ef4573d1bd1c58227eeefbf7e1cb35c9a72236619f85f872e473cf1decad2e6bbd4fd624db7ac09f131d317cd93ba6db2e852f45af1dbe5c1538f6c7862fb70adf8cde10fd69b037e4a8c8e0bec5606fc80bbbedf630e0c7f5c947a20b872f578ce7fe4f343dd85b395bb26dc56da2af46faeed4e8ece87ed176cb6a94f4f7e9b6dfe9b64be1a06866f8729bb35fb453f4abc1ded6e1c8c860be74b037e441d1bf2241b2b86fb7e564abcdb83ed1bedf0f5fae98474753d1cf067b2b674bb6ad30c8fd86e5a5d1bed1b5a34f47d788b64b5663c0dfb3db32ccff0315a0bed66db7157b44bf8c468340650f5380ed0d1979d7e8c783bd9573f76efbb96ebb12b674db0a81f7fce8aa83bd5eef924890bada606f3b64dc8017b1ce8cfe1cf9cb3903f37dd1e89fcd3e261279df1c7d2b527e16778a18f61dddf68c68f47d8e2c732909174339e7fc8ba39af3bbd677a3bf46b2c017a2d74517444f898acf44b2b2cf7e3c7a4ff4ebc83577880c60cff9d36e1fae7d5e24a33f32f2eccf89b4f7e9d15ba2c5503a7e3ffa4b54bf6054f2fd6ef872305895aab78bb4978d4c19644c7c20fa51244b6c8cb4a19edd39500db03d1b2cb5e41dd7aec7479ef7fed16e91b6fc26d277fafe9dd137227d5c369adf276ca58d15c0778fbc763d98c2b9ae2ac6fdf78a16e24591f3f78fb4f5edd1a111b4e1f591ebe9f35f44a36b41ef8eac7378cfbd6e1b2dd436b0a5e91abfbcb23c29ba5bf4cf68ef68e748ffe99709cce45ed309e2d3995eccc42767d2d7d3a976a763cfe9e3a3f8e5f42951ae319d807f70572d2cf7bc798cf9a5ddc91123fc24e298378b7ed0bde628e68fe6960f8cc0e0e5cc1c92239c30d8ebf59e1cf96cfdc92de3d8d7298be1badf8eee1ad53574b840a47c72cc80be66048e4a500e9f1639c7e75e12c173d9d7c1ef8f38affd721af733cf2be7867dceb3140409d730905cb7e6daeca36dae5bf73c3cd2fe5d22f710b88afaccc3077b4338a96382833e81731c5b8c49ed6203fbfacd40d26fb530c856a8feb61dd727059b3a56c104fac1317d2430f0a1d1732621233bef4383bdcbf1bcec587dee5a02020e89d8998d05b06a33c6b5ad90b8bcf7b2e8559100384982ec7cdc4b429414de1af5a3094ce7b333a9020ccc6373cfe904b4e95b0d07a7c13c382658f96c02d3603fbeb0dcf32ec7afec26fdd2ee6fd107a35c70d0b99c52f4f267b34a16d94a0090412133d59c7253242bd5cd2c6ae0b3ddb6e6a04b99bf8bb832aa4ec02723abd89c541501f7a9017afde8b711946f3ec73175c41b23ecd86d6f121d171d10c922d59ef9653407172955094bc1e0d5a6c7457ed924431aa81c4d25e1bae67be69202a3e07a58e41ea3035e39eb7c41aba8002b8bd57ac24d2373fcd100358ef9ed8ae30cb87da4249529b5477bd9403557ce5d55850430ae4f8a3b46da72ee606f482d38caaad642ee12c9e08b215040755118d006179be97383fec191c18c1b47ecacdff5ffada393228c6b5bc1976e1e1d1dbd22d25f93540164942f46eccad7657cc941593f86b95c638ecdbaecdb7f6fdc21b6decdb431637136ed3b571bbca76fc3dcd9cb3f6f0c137e4baf73122506517f94ca90a21d07960d743e8723effd3c2a040551bd227245dac5cabac23575aeac3eead4aeeb3a75ddca5ce588c5fcec5cf797390d66af2b436893fdd10c240b3b363a55580cedf4cc55c50888ae515586f7479f87bdaa7a2ad877d48ea86aa5b2fea42c3889f9edb2effcd1405315d8bb067b430c74eda9f6daceef1383c179a30100de3775134cbc5fc17931462b8fa22a0fc18eef09220f890af653ea7b469f2bfb4d6adb964002bad6f0e580fa7a75916f94a6ffd86561d3963093e9ce60fff4e1fed119b433790ee5fb6b2a6986e59eb77086c7a485aafae7180698f9918c2db2c85c9c058c5edc39d241778844761d28a398f32ce56bb66744a21aa73e38724f5416e240a8ccc55165298ccbce8ec9e89f886477547552cea31aa94037ba70a4ed4b69b3f25984af350a3680792fb4559bd84c7b5452069d05398176fe02939570c7542b9e51db7160b7e5c8f59985a8765535631f9edf3cdbc0a80a4cd682676673cf2f70c9a8e3faa4aa8fb2b5f512c7ad9d3c21b288a5b2719e6b2cc668e5c1b99f19dd305219e97bd7769d5abc64b737456ce41ed620d8f5bad1b8b68df2f9885ddde7ca94f4fc856fb3a7aa16ae03d5e604665251f463ebd9549e1755b0bd77b7f5f56cd898a9703f7dd5cf7463ea893927d5cd72cfbb229306bc95f451e72abed26d47a39ac8aaf4f7e0ceb928828c598efb8868f748b9a164163096b292a91394e4aa90e74516e6387645f342a7cafa8f8d6ac5f401dd96d3407562518511aa6447cdfbebf37f881e3a7c3970784ea614e45089b04ba68291721a556259043c76f87230f861fe58a56eb5834dd95060528e7274d9b6da2e90b08dc1f8b468f43bfc85a8afa6ac8340207a56c4b6f52d40ad8c1b6830fd3160dd7f5c9fd4372f8287b2575fb3b3a9a072193f8c7c76b4a29884c1ca4fc056b2b5f35574a37da7f2328d342d62375f8b799fad5501a6a7e3da368a855c49e01fd19529e9f5af6c6efe5eff00d6d4c11810702630bbcfe583f248760c73025598ed02d8dc3dba6da634fde7e7787ff9e75d9149035e843280478d8bcc1d7a2746e6f116099459b2aac5399fb5922df28a84a2a52c275a8b868c690593c139dbfce9c2386408eb063ad57c8cb35696af79282a031bf0da80cace32a172d8f144bdcb2a000b549c4a3b3d07a7624873d4fa5190d2d2bc5f3bac5bd49c7021d8e8a311e7700f01c87dcc3d1d97192bfb7f38e2682f8e043073769ff1f947459cfd61910ac9756add04da0403c82a76059849b8afc1fdd4c83d94d602996f26f4a1fe13480d940a0a9c99fdd9417f393eae4f7c4ec0f11cfa40f5c0e9d94cf6e50f8286b9f962ed846f14ae13a930055af61228056fd94c7f9aaab1cb0bba7d36d3c732b87b0a949e695cdb46710e7faf3e592a929f3e12008d07fbeec7d76bda34867e1700e7f45b02c631b1793fc96f3653a4f3057987334e66539af705e21cfbf7f1cb3f6f1e6bf8efe16b65bcd158f72c3687df568c9b27952a832d872afbbbc8b7c5b04e31aead25917eb518d79ed24a6cb9a5b1de30ae8d25eb1a8dadc46a0ff871f3a49252693918eca60ed8339a5fc2ad04d39c716d2d292f578b71ed292dd7965b03df568c6b63e9eb51632bb1da037e6b602ee7fb5e0b16be3659ead7568dc69a672d0ef846a3318136e01b8d75441bf08dc63aa20df846631db079f3ecceb3bdb98bfbfe5ff5dc860df553da46a3b10699ebcd5e78eaab0f3aee7fb1605ab9b3b055140000000049454e44ae426082}\par}{\pard\phmrg\pvmrg\posx850\posy2775\absw4980\absh-480{\pict\pngblip\dn-27\picw4980\pich480 89504e470d0a1a0a0000000d494844520000014c000000200806000000792f41ca000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa86400000dbe49444154785eeddd0794245515c6f1ee9d0504b36000731673c41cc1cc62ced983a2983d068e2c18587316f5086bc41c50540c98318b11038a19b362cea0cb787fd57d9737b5dd3dd5939859dfff9cef74557577d58bf7dd7b5fcfeeccde071dbeebcebbefb5e5d4938edfd2ab542a95ca58fa1b361ef9aa2db3b3479db6e5f493d7af9fd9edb84d079e3c7caf52a9542a05eb86afbd5dd6ef78c20ebd993d19d0e1a54aa552a9146c3598b3bdfe29c76e3ae098d95eef72c34b954aa55229d86a302b954aa552a9542a9525a1bfefc6cdfbf7fbbd8b0ccf2b954aa5d2a6df9be99f317b626fc3219b9f36bc54a9542a95316c3874f361358759a9542a5d98ed6da906b352a9543a520d66a552a974a41acc4aa552e9c84a19ccf387fe10fa4673b6721c10fa4f68537356596b5c3374adc1e1b271b6d0dd424f085dd485ed90a343e6c16f43e772610d72a9d0cd0787cbc20542e71e1cce399ec3420da60ef8fbe0b0137f091d1f7a4e73b672f8bbf8f7875ed79cad3cd3b61318f7d9d0659bb3c5f3e7d07b07874b8605f02ba1f30c8f3f333c9e8f0b875e30389c179f35663c67771796812b857e13ba6ee831a18f8718d0b5ce9343d7191c36dc25f4adc1e19ac558f844e88ecd5977f60a3d7170b895a784fe1b7a7373d6ebdd2cf48bd0af43d70b7d7f786c0cce61a106f326210fe8cae9a13b87ded69cad1c9f0a79ee8f9ab39567da76c2ad43ff089dd29c2d8e0d212be552d7df02f4e21063fcec9081e7783e6e1cda6770382fbf0c31ae4f0ff18c9683bb87b48f71c9bbf467c1ff0ead75ee1dbae4e070bbe1a9a157863ed69c75e70e2146b0e482a19990c51edf190a3cd95c5c6e387cddca420c26cf67b7d05a5fb1969b85b6d39ea11f842c328be546c3d7cf0d5f970206668fd03b9ab35eef6aa1770e0e27c2733b6870d819c6d2ef84cf68ce968f5387afdb030f0e5d7170b85df1dad02342d3446cfe20477bb4c9c5fd4fc357fd7f8dd05743a2520b3b6ff66ba1394c32986f0c7d3af4c2d0d743c2970f0f0593c6b14279102f46e8f7bed0ab43bf0ab1e0c2520f96c34c8bfea5d0b74342b9c7878e0d1d13fa71a8fd5747de67749487ab4cb7094dc23d7c47993ee442708390e76aac8d21e5e4256920654cb8e72785781afee5a62f84bc9f657b60c8bdd5e79121ec18fa79e815210665543b65ddc7f1f6d03743670f59fd7c479971e9106fd9b5a342ea912893fe794d88a7a4ac72723e6b80f1561f1252b66497903e3a32b4b30b5370a1d01542ff0c59bd954d58eb787de88321f77e564858a33c5674f5f33d9e9cb2298f7ba9b3f0e89321ed6ea17874e8f92193437ae2e2a1db857e1af2efb61e12f21c7da3ddcbf4056fe2c490e7f21a3e10725ffd5786dbc2561e268cad97851868fdfafb9009a35ec6873652b7b784be18f239f9f86784a07ec699367943e82321f535211f17e291933961a171af12b9396da5aedf0d691f6de8fbca897b84cc199ff95988f72364341f4c7861a6b922fc747f3959f729bd24e3ca7d8d7bedd62e8b68419bb9974556bbec10ba6a489beaa797843e1a32673df7f6a151185bfa405f71008cd184b7680e3d33f4d950fe0b69c26ef38e3df972e8b410aff26121fda2eefaac1c1bfa637388add22e99f396ff7e5388d3223da12dd40bb997f2c3e12bee19523fe5d466fadc9899cb98bff4e10968508640672a581a0746d1791a369fd509795dbe4443397e6b88f7c1c8e43d1c1f17f21dd7bc8271705efef37299cfbb557376e6773c631206bbcf982c92ddeae1f8a121f5722defe979ee99c6c924d4e8ae99a0e708c1f7748a8e53771de63910fafafc8b9ab301ed76eac27343edfaf93e236f2226cac5b04379f33d4633eb0b652c076a62f1fb57c80437191863837f9cda218d671acc770d312279fcd89089900bf19342c642f2c7507be34f599483c1c85cd2a12198d0da83c10443e5dcf8f18cab87d4e3e52158ac3c83c182e7fb3c6373ff50db41c8fba5e1443ed36466e4be17da35e4ba3449e66a85bcdad7e750d62373ae8c8c7bdda7391b7cd6f9b59bb3b9dc29e43d8e43d97eae317ec8676aff84e12abda8517502a7c575c607edb230fe16d70ce519527df1aee6ecccf2597ccc09ef33e88c671b6997df85b2ad2c76e9adbd34648c5ebf391b1846e7176bce06fda71d6f1ab2787010d0ae57f653b62d3e1ff2ddcc3d669f946310e6ba315b7e57fac7660fb4cd367973b6729c8779899089cae0b1d03c032b068460068e0601abcc925f39a4816db23c20e43b563f9e04a3ea73068355de8ae03e3ac824831501be031e99d5d504cb0920bfe03e26cc244c72464547f93eafc535497df562e8f29ef256eec9d3815547fdf1ee90010ae556461d6840f004d3608e0a7ddbedd4052b61bb7e161c86e0e0e66c60e895c5e0808ee5dd89044c70f5515f834219add66d7811da8177a8de0c95f61e27ab7889c1be53c864922fcb63865d38c853d83f645c64ffce0743cb702b577a6ee3d007c27413cda4c9c1adeebce79f346703cf061685fc4e57de137a50c838e609ef1bb2f86438e7192218f52c779e79ff8c2678c3fa3fc79abe85713c0e7d93e5941b36feeedb9c0d9ea98d2c605709316e970919a75d50767310655918bf03433caacc9d7bff8490c53b172c98dfcae47d6d6f7cb4b1c9ab4d1876fdaf4eee632167a4d4c3661ecca5cb877887093b627c4b4f59e826c1434d18519ea1ba4c421dcd91f21f4bb728e55c35d7b20fe730ce60f2ecb8fffb851482b7e4011a47e36900e760999d6b7893cf750daa305c6fe18d0661b834048fcee4e21df87c1aa45b0e5f3d0ff70be948a15a629018a4f99d71f02872f55076f06c73c381e14ceca2a96bded3735d431ac0cc479a80422c9d68c0084fc08038379830aa9dbad0ae9f016672580d1951834cf9840c795f118255543826c5f1a8106e317c2d0754094f79e4a05804af0f31768c8c45d1c06474baf0b7e16b1718ca513068c2e80cd12d04da32c7d43458601386d8446cff372ece7925e76dce068cfaaf5ef4df42b0f1a5ae168434ca4254638d3321e5223591467c3e8c1963a58df969a151f67251f11cf8154192d726c16b64b4dcd342ce79392c94cf5186ec43c6b51dfa96ef4f431a7be36f12d9ae651f776294c1145ecae7084b7928c23c15b5ca66189b5e0b0f02edeb2519ca9b40424ec6c440660cd3736118f60e3108bc386183418a345a420746abccdf4dc2ee380f9697ecb9c89f5a18646044d591cbfebc504eb4b6a7c700235d7b06b5346ccacce8f2ea18ea71ed3489f62691f2c845423e4c78a10d184ccf867a31cc7b847cd7c0b3338facab5d45debf9c62228f68e7594ecdf7a60dc9c7a19d8451fa5838265c7b78e89ca13642b4d273590af499458ae1d46626278f5768bc18b4156363cc96084d19ab851ac4f9105aca21eaa71c6bc6ae2848ee90777f78681cc2e876383a0a8e0c0322c759da8434d2dbe6f226637e4863e85ff38b91bf5748ff788e7e51afa526c79334ca2844af59a7f385d2c0766694c1e48ef24eac9c0689ce3108e51632efc06b61084d54e40f4a2556dbf01c799bbc3aa1ba15e5b621a431e4856858e1bb24b11580b75492b997d2e31c07c3a2f184a89e99f911139fc79b61bf019746d57136204fcfe70c52c65cd865d2316249baef161865e72d4bb81b08e3da6912e9115a9d2d28c26ce1b8f2196025268124b51c975c0f788cca24cf8a4c91b8660134e9127de03dd78455d386e4e3609c8c1f6de019c26079aefca98ebae4a43471ba782bd3a2ed7999f2a0a29fbf86168bf0501ba413010b92712574f7bca522173ac8b933ca47844acfcfb8b62089da32fd90e4ceaf3e902ae9527f7d65ac59b433ff270dc4f019c3dbec16cf837b08718d1d7dcf59b2e8b021f6123c47ca2a31d717fa070a694b20f2f38cdc07b198f19a2d74a42cc69d4d458b1c433e1d23367d785d26ad242bcf885193eb020fca24e339b86e15811c8d09989b0d2512f23c2213d92487dd5c95c9cf6b5813dee7ca4d1fc73c2e46d2a034b9e5b8e6c37d1930cfa42cbf6764880e7f09c4285a41d32bd4999ee3b3763ed59381cacd1ff0ecbcaf7ceecfebb5aa79f5ec71ed34096dc090f3b2b57ffe3444eec760f32cb92ade53e675ec625aa40c4ef9229fc93695565146efdb8c1ad5374b8d316371f44c1ead7a64bb428a8691b45164916270b49f41adac7276b9932de464ecf5855c9a055368e79c176b4129bf6bb10263e233a5a41e2c2025bce1f27e3613dacf2c374e944b99736e70226c0e08d5198876592c521608f7928232afcae7958611b9a9a2af19616d610c19a36d1833464e8ebe8d71e439221e86de73cab2c8bbb7dbd26718147f58621cdb4d567fe3cbd8cdb495cfcb356a17e9a70cf1cb5f60405d187263525b2947d6c373e451452e9e2302cabe2bef69eee4a651bbaf94579a25cf79d9e68db9511a62e833753787a5056031d557b92fd389c656aee27f0f9357564e720d46cb8d5ca08ec8544265e9e9e2712f047dc7c8e4a61de4b3fcc2217f5eb65a4983d92584b6d923dd3329ac655419f3d5cc6252326930dbbf061805232df5b42826ed929fd5f0f284c719e2335e1a37770385c6ed3c5b291ede42c910377713970a61cda8b2126ff8ff09466d39306efccca8dccce231319826d75ac6661eafc89f70f2d4794ec2cb71f040b5c56a66ea1ce20211d548b12d9e55ea6166482def69c56554e4eb963bac14464a15985c5d7faa51593df024fc458870d9effdf4a7d052e8d5252d72565186bc657aa1c4a61f0323bc97d35cadcece4a50a64e46a5379685d51e92572a95caaa613587e4954aa5b2eaa806b352a9543a520d66a552a974a41acc4aa552e9427f76a7fe7e071fb1cfecba75f98f47542a954aa54dbf37b3ae3f7bf4ff0003c7d6a538a151910000000049454e44ae426082}\par}{\pard\phmrg\pvmrg\posx850\posy3501\absw3030\absh-765{\pict\pngblip\dn-27\picw3030\pich765 89504e470d0a1a0a0000000d49484452000000ca000000330806000000d6f89779000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa86400000acd49444154785eeddd079064451dc7f199bd3d2468a9059462ce8a62562c232a6639cc594b29b1500c252650ef3811b0ee0e53194a0115c59c1131a0289e59cc19b40c28c6d3523114a0b7ebeff3e6f539acb3bbb3ecce6c0df4b7ea57336ff6bd79fd5ef7bffbffff77bfd935fb1ff1dadd77d96bdfeddb7eb4757ba752a90ca4bb6efd096fdc3e3b7bf285db2f3a677a7acd1ea71f73e839eddf2a954acb54fbdad9757aa7b3d676d6eccd70da8f2a954acb0e4399ed74cf3ded98434e99ed746ed47e54a9545a76184aa552a9542acba27bc0fa130fee763bd768b72b954a1fb18ddd66bb9de33beb369cf892f6b34aa53287fd369eb4f3811b4e585f63944a6501b61e75d005b39dee7435944a6508aaa15456929b44ff8c665b7d3fea46e3e49d51393f3d215a36d5502aa3604bc4406e1e69ace3e47191731fd06cad10d5502a9521a88652590dacfef86a74bd666b78ee17fd38fa64745e747674eb68e45443a98c938dd157220dfd76d15ed1b05c277a6bf4d088c1ec1ded167d39ba6a3452aaa154c6c951d11da3339bada5f1c8e82a91601d7f8f3e1fed1c3dd707a3a41a4a6552787dc4488e6eb67aecdabefeab7d1d19d5502a9382b4f3e3a30f375b9dce95a37b467f8cdee08351520da532a9bc27ba287a44f47b1f8c926a289549e44d91ccd99d2371cac8a9865299345e10ddacd54fa24dd1b3a291322986f2aac80caf6176a5f844e43bafdd6c55260146f2f4e8e3d1a1d1f3a203a3df462365350ce586d1bfa3cdcdd6707c377a47a471af1426bc18e0ef9aadf1f3d7e823bdb743f39de807bdb7cb46a7a3a3b0e4635c58d2a271df2ab2cce4a0e839d1eed162dc3b3a36ba56f4d2e8b85637887e1e8d94d530944745d39119d66131d16471db3f9aad95414e5f250908c7cdbae88ad1cf9aade1d833ba65746eb3b57c4cdc4127342e2c927c7974db684d7470f4cae8cfd1627c3a5a1b31b07eed147d2b1a29ab6128b76f5fcf685f2f8bdca57dfd52fb3a0cf7695fbfd9be2e17bdfb9f227e7e651106198ac782dd3cae016b9786d3a3ebfd3e183d2cfa542477fd87e8ee518175db4703e026c9487c2d8221d7d2053ea5e3642e5e183d2352f9ce674875cce7226e91efd60b49ffd92e38c77b23aec80722fb9c1efd305286857852647fe73bc407e1984819f46c46bccf46af88fe16d9bff0bac87df8557472745ae438e581d76f47aeaf3c5ecdb5d916dd23e2eeb807fc6cf3024f894ca42d84a51e8e511eec1b7da8f7b6e1d191d159d9dc6bd75228d76af4542edbaf8ed48f60f8fce8d4a8dffdba45e4b367365b4bc3da2bcb4a0e6fb656978f45469cb7375bf3b2f14a8902ce8ccee974b6a4ad6f4ebcb3f901ed1fffc780478135002e8906c1872dcb950552b635a2d218cb76a1f8d0976fb67a33a6bfecbd6d109f38e6fdcd560f8bdb0cc53eff7a54f6f15e19ae1fa980f23d629b723cc3b2effac8b9c53e0b3dffcf7df19d7c626e5cb91686e83a7d97bf97f23b6739af635d9b7b63bfb74560ccb6c51bcaacd1d9d601e0dd91ed7d9aad1eceade12e05e76670fd1d8173f8ee32dadc29fa75ef6d535ef7a3fccd7d2e7555cae8fecd6543e46f0cccf3258e73de41522f969014ecefda2cb35f6d1e18b98e459e47d99cfad97c41c29f9ba6d84724ecc9319bd8c00ed8c8a011c51a1a952e68fa42a4d74459a5f9fc885faf52502a2627697c6823909ba5c1ef12693c85fbb6af16c6819fcef2f59a60003f8dac2a7d6ac43dbb6b74e3a81ce3a75ff590703e18f1f68fe4d655ec7ce82ddd8417477a3e0d47d64b63166082212abf0679f5c8e801d7a37cc5751448e20aed2b4370ec63a3ff44a74498ebe2b86fcebd14174a59dc03234789a9188251560761848711f28bbdb74d79c582461af7f2fe51c91abaa7e8efe40a96885880a89c0c41c7e35c83c430d2c8269a5cdfd4e512fe64e499cd087b51ea6bdbd3dabfed6090a1700b625dcd4dfe860f5a4a85eb69f0a0f6b52c702bc35569209617a03470982042a958ae8dca2dee9bb41f7e116948fe562af75dedeb8ba292f9d1381986650cdc26c72dc4672246a6ac1a330363988745778b50cee3bcee01371056a93a766ec32ff18675485c163db86b562e0d9c8be39e95065eee4b69d0c3a083995b1f7a4a9f69c85c4e2eab40ff89119457a6f06a1137f97b5159ad6b04e7fad96710be478779196026753a9376339b4e772a6ef0dad4cb9e96c75c8cf982f9d2f3f38d31a8c20d6d6eb61841833302f537a0d2f819c549bdb7176b6462153d1de636be82f36a787e0f59c57135b8455c273d9a9147035026fb3e395a0c3da5de596fba5f240305cbb69dc76882323270b15c1f06f5ec1abefd4e888a7195065d8c9c515862aeccfdc90c86feb2666b61fa837f65509ef28b9edc2875c3d08f8c94cb79c4316f8edc2fd7a88ce24bb8561d847dc52296ad17a46c7dceab907a5d8aeb35616c7a764c20b1f3ccbdb211e3988d07d58d97d3d52e2ec67c867287881194deb4bfc20b2a676b9493350bd4e4b2554669b496536bfc19d69af7d0c85410b82e6eb47de71a6141a56978920a46ba045e4dc59d153154941f15e732b8e0c5600030324930809ba2672ea3251828237f4ce41a507af63272e90cb88dcad7eff295f725be535ec3b911b47f147c4d34cc6459717b252c1cc3dde116a3b87e700d5c5d69d78744252e12e47359b9d1cacbf5d3c1d89f2bdd3f37e3dad49b72a953fb14576bae26d8f53a2c614137e142376ee8543aafc3d311cffe26fa4b0ca7df0bea31cfef7ab949fdfeab7d048686ec82ac9621dacd1470bba1def3f79d482c20b324c7fdf008e217c1b2cad4f0a1e2045d629cb9f84e65d1bbc9a3eb1d1d2fae113b70cf04c5cea53194207c21346e0d56591cc7501f1c29437ff6a75c1fb7a67caf18c47ecae4c7cc8d2c921c05dfa51c1a9e1e5d164c064c1c51265865a5b889466b06e698c5502e65fe68e43b4b7994c17d9011e37a712db9cdee9bfb223ef137ef65c70aa58cea61259f2ddf23d201991c5c6d8cb8da6d896307b0695302f8c4d85b8e4ff5a4d3df9cfafcff8c57632313fa037846a6d258f8e0d7edbd1d391aa30e6398c67d59a4fc0a4be914e6a253d489f226b89e3a9afece772948041995e773b787cc7a2dce7c59af49a03f96d0bbf707f146b041fe34713796c36d223df15c177139683c83ca5ad43f7f34c970597902dc67ee9e9e5b0c74499e76d46e7d17f76f2c4caaa12c84c63cd7972e921ebea4184df8f6d78c4a6cb31208fc0795b54846eed28018c968c2edb414456f7f61c4806c2f0513d54b79de7ed95c1a0d6554c82a99e9e5875baf54591a0c432c2883c77d95f534cf26236a7b58c43f924b6f69b6c6443594cab8913cb0fcc81c8f58a52475864186cff327e6f096625ccba61a4a65dc48515b4fc745f6eb29e68686e57d91f9aa955a413d34d5502ae34476529c07192fe96913c0c3c47c6235b18cb93d59cff20c8b9f301af9c377d5502ae3c25c9079b632510a13d49020590ccfcd987bb2ca80ca922329e961269a97453594cab8b0a45fe6ab2c7b97ed32392af3354c606e025c12a5a82c77b23ac4529d91520da5322eac2af03c8c09400ddd824cf344d6ca2de5294b6bcb8c2c6544b13262e4fff2bd1a4a659cc87409e2c5241e40b33873be15ccf3616d99459ce21de97af14a595c3b32aaa1542a43500da55219826a289551501e1bf7d802f7689c947f4d579ecc5d11aaa1545612cf179927611ce4813c8d769c484397f3d3223f2e311cd5502a9521a88652a90c4177dd91271edddd3eb3b53b3d5566492b954acbcccccc3edd99ced953e777cf3b6a667ae27f72a6521909535333a79d7aec2167fc175cba99fa614e8bf10000000049454e44ae426082}\par}{\pard\plain\plain\pard\phmrg\pvmrg\posx925\posy4599\absw921\absh-266\cbpat0\brdrr\brdrs\brdrw50\brdrcf0\brdrl\brdrs\brdrw50\brdrcf0\ltrpar\itap0{\lang1033\fs22\f0\cf1\cf1\ql{\f0{\lang2057\b\ltrch Outputs}\li0\ri0\sa0\sb0\fi0\ql\par}}}{\pard\phmrg\pvmrg\posx850\posy5201\absw5865\absh-765{\pict\pngblip\dn-27\picw5865\pich765 89504e470d0a1a0a0000000d49484452000001870000003308060000007c32c4a9000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa864000012f549444154785eeddd09b86d6559c0f1bdcfbd883238515650468ea83935883984455a22909a64933c961486f9a46485c2e576852b9d6be1000ed7eb548943ce86258503866983393452d22451a60d525e082ee7f8fef6de2facbbef9ecedee7dc7b0efbfd3fcffbecbdf6b0d6b7bef57deff47ddf5a2d9cb0e5d5c79eb865e7f38e3be3e2c33a1f34b8ff295b6fd77b5b144551cc09ed13cfde797aabb57cd44deda54b0e6a6f7ae99e3d379c7ad3f2c2d2077ff5d9ff79fc59171d71c841b7bb70f74d379e69bbf79fa2288ae236ce426ba1fd984bb73ff3dccbce3fe3aae5a5a5c54d9b6fffd443361fbcdd97f95a144551cc170b1135ecc9d4d1427bd3d1eda5d64d9d6f92e5f6f51535144551cc17ed13cedef9888585d679ede5f69561098ebdfaaa6b4fbec77d8fbc34bebaaad55adadd6eb50f5d5e6a7df8d2179dfecede7f8aa2288aa2288aa29837da279eb3ebb476bbf58dbdeda2288a629e692f1fdc6ab75fd73a69cbae5fe97d54144551cc39c76dddbaf9e42daf3967a1b75d14455114ad2bb66ddbb3dc6a6f2ee350144551ec431987a228e699a342fe2b64b927ff14b2d1f4e21b42b2fce4f4909929e3501445d16aed0a69871c1db2e4830dc44f8628fbf775b65689320e455114c53e9471288aa218cfdd43fe30e4219dad5b3924e4f7427cf7ca907f08f9819049f9ee90bf0ef940c83f87f8ffc3439243433e14f291905785f8fe7b42d69c320e455114c3794ec81f87fc41c8a342fad784bd2984e1f8fe9033427e33c4dd24be25641c5f13e2b73f16c2a0dc2b041f0fb14ff8fe2e218f0bf9d9907785fc4ec8dd42d694320e455114c37969c8b121efed6ced0da54da9ff55c86e1f041f0d71afba9fe96c8de6941006e2ad9dad56e7be769777dfb6ce0ef19d7184bf08b931041f0eb943c8aa0c3a8fa28c435114c5743c34e4a090e6cd4aff3bc480f6033b5ba3796dc86f856ceb6c7591460263c32819686eee3f6f82fae0deeb9a51c6a1288a623a8e0cd9dc7dbb0f93a47d28fd5343ded2d9ea1a9ac7877c39e4c210a9a5613afaeb7aaf6b461987a2288af5c16f87d0c94f0df9bc0f0e24651c8aa228a6e3ba909bbb6ff7e10bbdd74979798834d223432ef341f03f21c3d65cac74ff2ba68c435114c57498be6aa0f84e9dad2e06a9e9d5ab3a5b9361969329adf70d31b87d6e88016933a4ac786eeeff88deebdff45ed78c8d621c5e12a2928cee17c56af1a010de5f7a6aab8194c00d213cc1e2b68dc167b38bbe35a4f334cd809267300c364f02c3704ec8bb43cc407a5ec85342ae0df95288f50dcdb515d6385c1ff29aced61a72208cc3bd430cc42c76b626e33321e6135b6cb25e98e63c56829072d0f4b9517c3ae42fbb6f67862166907fbcb3b531b822e4ef43b2a38ee3df4374bed5bc865787fc6e88db311c0828a5af84dcb9b33519cf0d911e692ebe9a05f9f20f76dfae98e3435cc7c33b5bb762768ef66df0d63cff3f0dd91fcfa1b1f680c27e4467abbb26c1b6c168fc4888fb317130b423df1b64fedb9071a86f5365bf21c4a3135edc13339dfe2e043f18f2c590df0ff9b59093437e3464edc7240ec0f31c58494ae7e99dad8dcb5a9ec74921f66dc6c2a47c6d88ffbcbfb3353b3aa1fdf18a360294e1ff8550f6f38c15b4ff187270676b32a42f1894d59801b352cf39b1788c51a0084dd76c96e5b01046df6f4ced84327f366425e73988bcf1de9a7be2fb0186559f9d790d04bb70202287efecbde6628f8dca5a9e879598f858ef7512aca0c4277bafb3c27b11d6a607b3def9ae90db87f02ee7956f0af9fa105eebfffb60423800ff129273e867c1a0aa299956f9ae04def671218372f5b97af88f42283f58b5ac8d663f2c569941c641a84621486bf05cadde7b638870d952ee1f0a11e2b8cf8711f3c78424c279bfa1d4a480ac167411211473ff106191fff12c9e1ff27321149ae3bd30c47f787fc619ecdbea40e1bfedc431de164211bc23c46f84750673264929f044ec4303e68dc8ef51aefeabecee75d2dcd7f9213c1a0343c3ce03ea453d399ff7854885f1e4326de1989f0af1bf0c89a56dec5b2e512ac7be9f15c293fbe99057848ce23b42fce7d73b5badd6c3422cb14f84bd06af2e0e712d9c4b22ea517716e128976d61ae3a7840887cbcf368a6961c4f583fc90ad07eb4a56b421cf31742d497e97bff1ac2e39446bb2084a2ea3f6f75e1babc3ac4ffa51a298dfb858896787e9b42283af95bb72fd03e84dfaeb17dbf3944db761d1975dfbb3eee8f036d5b3d589844c1fa8fbafdb710e1fd28cc6b97eab07f1eb0b218d350e7ff11a20d5c12e2fe3bca2ef59473e4d5a974a0c8e7752194a07a11011c13a25cce59bb794108fcd775fd8d100ba7de13c29bb67af6ae21ca7d8f9051bc3e445b655028dd4b431e1b02864619a587fceecf42b29e9cab326adfea567b10ed3aa6f259c065ec456a4d3dcc4ae6dc739530e80bcc9a0ad3f6d4d734ed79bde15a89ac7676b686b2787848b4951dd15677449f5c0cfd77c1937a5fdeca80b4928b7d660825a7c19c18825f0ab1ed2650a934733bd1d93472ca171a897c5c224fef3f6fef6c75a12cbe3dc4e73a57fec67b65b867888e9afbd1c9f2ff8c89df4af138b63180717948df6b58f691e72185a263529cde3b86fd669e51597c9fbf1f741eeeadc240515ebe535f5097b6edd37e285adb8c2206a56f1c8b925a09ea9d91c932c231ec3ba30ae793b94a6928f595dfb90e792db38ceab71fcadb7794854eab7339ee20a1d07891e0d97f22441dfb3fa3ced3a7ccfe378421fab610306e7e93333318128ac1022150debe7f4267ab0b83263de0960360e4183d9f3b4f1e26a5ed3dc5cbd9c8d4a0fd6867da98fc2fe5c738abd35f0cf11bb9e05128f33342284cc7b01feffd9fa3e1b31f0ec18b429ae5e74851ca163fa9cf4ca9f81fe5ed866c0c0d2395ced6a0f40d27ce7e57b27a36cf4fd913e7cf61728d328d2385930a4479393a502f79be5046466bd8e2b0715c19d29f56629c94f1a73a5b5d38693e739d136519d40e9bc2f1482387394c2b2d463b59bc2124fadbe2cf47b5c57f1639dbb7302cada4a3f298f22e84bc09582a0e8d49a34cc599cae6ac108d927748b951a03a3e859850a0c8909307c7ebe33981b2955be4f13c338477f7e81053bcf23f06ce72b97976029d42c5dc2784921b8563f0b40cc2a5274211f84c0734e8c34be4a55180e09d2a57febeff3c402951f40c9dfd65a3cd86c8a367200c58ed09e1e9a13f7da35e956525e92106411de9945946ca9f02643479e8d068743eb83e3ab088425d53bc391b4c9da369f8135192eb230560df3a97630d12e7467140fd703cee1fe2fc297cb37a286d7963caf5cf432085a0fe35746309a6f6a91f9e311cdf4c915494cec37e4501991ad1065d0fd78e92752d5d57f5448179400ae3e9f78c1665241af69d6ba84cda9f3ad4aeb6848c42bfa1409f1c2235421151f614e93787286b3a13a20175909307b459ed447ff17be70edb7ecb2367bcd4a9c81a83d2378c2ba54e014e0aa3ad2ccdf4a86884b23f2fc435d0265dbf3cb66bce985d14a2ff669dea3fa6728a8cecb31f6d5e7b10754c6b3c464137f5b7c17ea1d7f23e48734a3b1ce405ed3b8cee72e8d33d71dd76379d832e4306a4070d88f67ba6e95de780ac86633b3d608ac836cf3919e42563d8e7d0f87ca74cfd882c18a7a6b73c0a8dc3befabd7206cce7a20a1dc1fbf4c8a4b66c8b089251e5edf7fa195abf951a504e9d233b996ddf3595f03403dd83ae57462cae19e5e8982281665df1c095d7ef489e4f7fa4b49af40f98ead08e9d8d533a43e7cd81e5a785f8bee921f3f428fbf46a870d828e1a1c9516a4c0a444fae17c38a6d4c84a3037ddff9a5186ebcea1d9ded9ea32c8bb1e560ff93bc653db616820ddd7f4d8a71d90efbf1e8e258a3366218dc749918e637c13e7c40039afe6b5e164d87627d37ef42ddfa50c7b30cda0c881a3e53f832207afb3308791c305d12f163f1712ed5fd4b023aef7057ba520470d48a767cc63012521072d4d909ea99098872cf4e4b9b3c84d0f38c72278adbc3434bd649d5363c2b0c14fc795f6e089f1cc787a5256d20d14bd13e2ad2993dfee6bfdf686b70cff49ec477a84b2e1c1656e393dec4c65f05a53f90e3b8f415ebfcf78829410cf5ce7cb88243d75c7da1aa22ccd816eca5a0a621ccd016cf5e07af0762145e4da51943c7075e538948dfcb6fa645c284a9d1ecd48e9d921cdfbd39b974d290943d5c3a46925d82f652642c80153518a63cb6fc318098f9997a9bcea17e9213b0f6516b5680fda59d38b56bf72ddea61d4e028e32b1f6e3d02a11c53f1ba664d03a54d8c4b578231f13fe924ce93fd2b837e966b299c8ffa1791cbcf6744deefc1eb5feac1ef7cee7bedd3f81bb493e8e09db115edbe7f405ede39d3bbc3e81fc056dfa649aa3bc765104451a25d8602222891befeae1f8a121cdbb966fedf9d43453a4d23a9ec1c25e7c27992959894ec8bc606929caa9bd126a6492bcd193b9e15cd31dadd72f4f9dd51874be198b60f8fcfbeb7f7835b18661c34688a3f3b47538925148e1c2e2f4128c90371e153516b3014a84ee73d849f940e5c488dd26ffb0d4fe2f1773a3ba56c905683d0c8fe2424f3b539bb41083cee3179c259e7d56c1c1483cf28a52639c6919546099ed07d3bf03c90bf4d23c77b576629b7e6b93907e4788ef371af76690806c1f70631954d9a601ca9602820ff91aec9ced79c2f4ec1890a4e0b913fce4841ca83174821e8f80c1c03eaf73cda4c7f8097e9ba2a978864d2b412a4a228b0a6624825a7e3425ba16045538caedfba8500af18ea2c15fe4f84f82e0daa0139ed805255dffd86a709a3c2988a3e181ccad435d7ae945bfd1b9ba2e45e1662e1d128183ece87d4917d53acead4ed10a4c052b92a33452c6ad3be3305c441713c5eb336afbd6b57ce27e1e1faaf7aa428edd3ef5c638a9982ce7ad1a7b483514875ea9f14acebce91d00694b75f81cafb6b37c6d29c9f322aaf2848bf72aed2bc1c21d1bc7e9183c6c913435c3be9af740e268193eada30da091de5fca504934a2b8d64abbe4717457b5f883eb34d9f8a6bb51c7a67595fd89b2169251dbf99eaf01b9d9c1791c88de6938b74208ac47b29170d547e59e3d0f0acf883f108a9200a4aa38646291452e87eec5359781c3c779e90ff4b35e9543c745e88635170e33c25f08eedd3ec1ea9160650f913c7a4dc7d4732f5e25899ea19741ec81492ff4b434909348d0e43a89c942dcfdda09ecec4dbe369c2802d05a143308afe330e9d9a61119dd867d68332a8a73c57ca93d2728eeacd7883efbc6f9633cbe8fcd280ad068e2565417181d76abbb9608cf7ed33f56b5c0239abc6b9a97bed4e9973c054e4c3606993d22d9c15f88dbaa5c8fab11f5eaf4e217f2ee54601d966909441d446016544350ac7a024b57d75cdc080316de6f39be7974e57a690287fd78850d239b80e292b06545d291f61543916770c91ef577e5ebb72d8e738382eea473db9d68c05448ada8db10711a2efa52ad4b5d956fa2223a1ef88523913a09c9551dbd5f628a349e1584911718c180efd80c394e92e8647bfd216e8186dd478ccaca8bb5f0e1994b6de68c8a4d0d539863b80c568e73bc2202cbe365e43c7ef08076491d1de8b8e5d18621cd63b3cf7548047864cf2d4a5fd018f29238e62e321cfcd7042f4a19dad44c14d4b8eab3000c5fe65dc9803674ac6c4b807e78b4116b925222c4e09633dcd63429b88aa38aee91481e1e5a833c4e31e13bae117c1ad06524999665099bcb344a492f9c57e698e35ac36520a140b0f6c35e1050c3a9794e6fa8f6236447199f29346d2ce32356396d6a0fa4fc994e334e8d4102dac26b9e278908888e638f73e31ae89282ca30ba92991513aa7c697a4aaa6794c683f8c4c4e3048ec4b246cecb51e133a23f299fd79c614a1f75ac030e43c61a179a60b560383d783ce25c594dc62edb1be6350fda70c1ad7980483d2397e268d2562592d78b883ca4a78c4739a7b5f11a206c634d35b525e5288224a4a5b9460ec2deb524a512a78a58bea8cdd1edd7d7b0bd28af598d00d8ec16946494ed68c97e6e2b8a218058340596b3b8cc4b881ef62ffe2b61ea277e344223ce33416511ae39af531a189c904a20263804d0cba6b17cdfde73a9e952c749c8a320e455114a3313bcb5a0f931dace9301b0cc63b074d76c0a4691fc6c55805c7a07f069774d5301ddd5c07b2269471288aa2188dc1606b3d4c57164998bd45a9af06a210f7dc32d0bdae28e3501445311c69e25c2b647aaf3105291d539fa59aacef1844de0265146e2629c230e86d665c461bc61a0c685b0a508f092d8aa25867186cb61ec5a4904c1f59540953604d5f35503ced63422d72740761b3a0484e51b55ec1ec27eb634c4dadc784164551ac234c97e7b95b74974641d4e0bd5bcfccfa9850c6c58d3e537215bd858d16119a2525a535378f092d8aa2d80898c6ea36ebbc7a8be028733387dc6fcd1a12b8b38085afd33c26b489a9d079fb7ceb25ac3c87fb7a3112ee51779b7f4c685114c57a610eefca3a9e8dbc42ba288aa25843ca3814455114fb50c6a1288aa23bad544ac6f8c146d38b9e97a3eccdbbffce4c1987a228e619cf69f16c0cb7a920ee6f346c6dc17ac57341b2fcc4b34966a68c43511445b10f651c8aa2288a7d689f74eeaef3da372f5dd1debc908b3c8aa2288a39657969f998d6d2f2e716ae6b5fb36d69f3d867cd1645511473407be1e60fbc6ffbe9977f15721c29b6a860be6b0000000049454e44ae426082}\par}{\pard\phmrg\pvmrg\posx850\posy6176\absw7605\absh-480{\pict\pngblip\dn-27\picw7605\pich480 89504e470d0a1a0a0000000d49484452000001fb0000002008060000001505d18a000000017352474200aece1ce90000000467414d410000b18f0bfc6105000000097048597300000ec300000ec301c76fa864000014c549444154785eeddd09b8e5755907f073ee0c2e48662e59e0829ae2feb453a66942a904b84be646a562142d844b0ee3882c33f7628a82e9800b5a6ea56882b94b85ed6969695199b4d1ae628026c3bdbd9fff9cf7993f87ff59e6ce99bbcdfb7d9ef739e7bf9cdff2fedefdf7bb333d3866ebeb8e3c76ebced31e7ef2058734375ab8ff93b7dd62f0b55028140a85c23a44ffd82d3b4feaf5960ebba1bff8d683fa9bcedbb5eb6bcfbc61696ef1633b4ef99fa35e74fe1d0e3ee816afb8fe86af9fea7af09b42a15028140aeb0873bdb9fe232e3bfb792ff9d059275fb9b4b838bf69f3ad4e3878f32dcff6303f0b8542a15028ac5fcc4556bf2b4bf573fd4d87f7177b37344f124bfdaf56565f28140a85c2fa45ff982d3b1f3237d73bb3bfd4ff4478f6233f7fe5d5c7dff388432f8b4757f67a8bd7f77bfddb2c2df62ebfec9c93de3df84da15028140a8542a15028140a85b582feb1a75ff4ec7ebf7797c175a15028140a858d827e6fd3a52f7bced6de715b2f7ae9e056a15028140a850d0409fde3b75d7897b9c175a15028140a850d867e6f69d762efc6cde5ec0b8542a150d8e028675f28140a85c2064739fb42a1502814363856dad9df3de853414b410f71a370c0a11ff4c620ff78d3abdc98121704dd18747c7355586d9c1cf4ef419f6daea6c30f077d2de8e2e66ae3e1f0a02f06fd7e73351a8f0bfa7cd07f077d931bab888dbe26850156dad9ff63d0b6dd5f7b3b069f2b817b07712ef3cdd56cb1dcb6bf1cf45bbbbfee33ce0a124019cb5a87713e37e89aa0e7051d14340dfe3ce82d411f6bae561ed6ea4bbbbf4e0d324136eed95ced1bf089ccfc4673b5faf8d5a03f0aba7fd04fba3105ae0ab27ee735572b8f9f08da15b4bf02468efe7782ce6dae766373d0e782feb8b9da8df706fd6ed01d827ede8d5544d79adc26887efe7a73b5ef7845908042b2b7af98f5d89e13f4b741af0efa749044649c5f24ef9f0cfacda04b8224aff7084a3c21e80f83f8b93f1b7c170426263ddf7f58853fbd6300197c02b052383d489f273657b3c572da3e2e68963cf8d3a06b83d6cbff50f8c020f3ff4c73b5f6c160cbc2f676bc0c810061da80661c9e188467db9babd5079e5c19c488af87201338d9951eefbd82acdb3b9bab3df893a0ff0b3ab2b95a5b786a9031cfc237709cf4e6bf8266a107b31cdbc383be1ac401c3370719e7f9cdd5cd717090c0cd5a66407059d05f07dd3ae8db82fe37e80341f03d4182cbbf6aae263fdf2f38eef40b4f7cecb6d71ebed2993d7cffe0f38383cf9500a6c247079fb3c472da7ee8e07352b96f5adc2fe8ef82bede5cad7dfce8e05366b81e70df2059d8de387b86ed3e41b2869bfe7f13cbc30f04d9c6f883e66af5a1fc6c7eaa75b2c3b50ec1093df9cfa0951cefd1834fce3d213b7d40d07f040908d71a6cb17242b3d04f4e50c023309c851ecc726c2a8c82bfd46bb2f18520db2cc63d8c470491217d2fba119099b30f0f0bf27bd5011538be553047676f39b89ef47cbfa2ab03ff9a9ee8c57edceb8238e5b70559acc48f058966eca32a4f292327be3de82f83de30f824e4ede798755d9072d7342028de15418988fe61704f16cb591aab7dc3cc6af5253afbc6a0d3828c5fd98e62bd3ee89783e0c341f6cd9464de17a42ca46d95877d6d7b149e1ce4373f1384074a48af094abc2008cf7e258893785a5042d9c7b3338294b4099e0893a0321e9b82b4dd3e0b7154d06f079dd05c4d0ffbea1f0922984a4d1706bd3d88226470c3d02b45be3f08ef3e1194b855d07b827e2fc8987cb69f7f771065b9bcb91a0f7b8ae688c7b95522222777b2663cb77eaa2478669c895f0c728f92ed0c320641994f6b8acfaa22ca829c297c67903566083878e3d7bef12ab799affba340a794da1971eb4291c9ed347cd3beb5bd28481be622933106e3b93e88ec4c5b06274fe4db7cfc0f961f0fd2df99412053217ffa7c65109dfe8ea0c48b83641d64fb2f82c8433e4f27e6fe24237edb2076802ea573c3176ba8cf0f05e94b59145fdcbb73101c11440fadb57d65c6953d1264c88a8f0932ae7f0bcaad41819679bf2b882c9ba379e3bd4ceed2a0c7078d83ec9fbe9179ed80319b03bb98fbf3e640f7c8085efc6b904048406fddd80cfc21c7c60ddf1b84f7644a09ddff3bf22f41d364f95de302550bba0aec8a71c9229f1d641c0b4174e82541d0b526cf08b216b665d8a75f087a7910789f1eb3396c3b3d1a97a9d32fa56e7d982b628b527e94c3af08c23772deb605e64826e92cded8be1b37b6e5222b3ced2409cfe8f7dd9aab9b22c7de96f7dcdab3765f09b2ee74d6daaae0920d7ed2f5a4e71dd811be663ed67b21fa9c0f195f78477cc67acd4772371f7dcfbf74f7f542c8f4fcb541b1d6dbba03878e323ec69e1a44c94d8a634d851608fc6c9032ca8f0401e7f2cfbbbf36e559915296419e15e45dca018cbc6b42330d3834fdb64b978cb3b151224292db02e9e4864bda16d4738297785410c1312ecf1845306fd7f66797dbf634d006616ec358dcc76fc0e7e493f1eae7902081069e244f738ccabcc3b0ffe419c7cdf10be018fe2e12ada6901042cacc818a3cb704e9c7f7e707d9a3129d0a0280c0ca96384c6d70cee6c7d931089c14a70b9e33548caee7e3a05d150be52fbfcf36182f468c81246f3f14048c10de70ac3239efab22e0411aa76f185c0b1e8d8373779d87050553e64921131c1083f0adcdd574c03b19085e26c6f10d18c67cf6e6207c3366443618f0692133313f8191f9099873ae0cabbe05b41c2b430c749fd307e36754d3c0714a3291bc265bf8f453cdd578988be098cc661b821686fcad41dac97e53d6392710f4d86bb7d6b652d208e3d5df0791b547074946382ea043da6897ce4f0a72ef979aabc9b0e63f17242960a4adc1b141da3056ce8f1df2cc561e7e9893b9704c905b1dff14e4f709f64c3b820ef7b5e59ae39b84ae71596bff33a900c7f5df04b19ddaa4f3c93355216b0a5d6b0274d23bed2014d8387d8280a1fd9b71e00be8a4354a08e004d89c1c08a2e88120887d107ce4330152ce73d4d840e0de65d7da24406c67ecf483b36e3b76728e6f59816ec33915cfd8e68483aaeea53d063a21b0a1bf5dfa31e9790b3b2299598800722174ffdce867217cd0b6dbc7fdd013d7f3d1c6c2600b7921e6e7def6ac9c361857c617ad52300bc2b9c97e390a51b10526e89c7f2e3c254ae6cb481891ccc0446fc0d9c00f0e3e33029d8488621a21ce437dc049288171b822bbc7068958b3cde19236e3013282c41d8338f3ef0a223c9929a5d1639497dbf624081c082dc54c68071f6580f86d6e4f094a1e6704cac9711e8c3645058e8d5311bc0c4314ecb77e4388bf25e84e23e8fb8232ba1454bc29489586f1c29fad41e6ef200b238a57b92e8f09b2ee0cb0c0c0fa5052bc254714cc33307759113ea6e11905efe101676e1e8c954cedea208eeab020b295598177f04226684e9e3120e69581806009f0902c7324e698fb680252d7597932af070531149ccdb4d08efe64d389717cf3697d9e14c4d1c96ae88f360403f8d6a5371c0a7d3466ce3a619e9c071907f2ce883a2c688f52904f1665ed8c0e9d10180882bc734a907109daf421d0a70bb9bf28b037b64981bb79b11bf8cb09ca7cb5a14d993adeb239e406c89cf5e224d92746da776b4d86394ef7558f1869368a4d609fc8047495cef190de76398a61181b27a93ae5777e93eb80cfae39a017054974aca9b948168c25f5f6764178998953c29ae089aa94fbe958e8fe380c8f8b0df17b72120ea0a97078071fd281917b3ce350dd4b87d7b52620f3341f7c6d03ffd96f4e981e5affe184a50be62a204f39b17664918dcb0a13e764cdb5c7a9db3b573d16140916c888798e1a1b08e2866dda303920687df637f05cc5e99941f45860d5c6a4e76d04bf962e09ba73b028646f317ceb19f485bd869081eb42efb7b395a1f38bd6d57adf1c230ee8710ea295e1036499f9524051b4057c599085439e892a1384de22711e2063f68ea87312720cc359734669fa63acbcc3604146b3ed288b60b9473887319c61e7f864c9fbdaf628741de8d3877b0c07be326a22c684b9723e94c67bedea025eb4793e2b301a5d87d23233a634c64af1183ac2060c8135b78f05a2600632e7c3b9fa7d7bfb621204329c783b3bc80a932c071889aeec77382bcffe95d039228a21f0f07bd732c8ac200027e77d06765a74f16e12df40b54220e33d9415adae6a43c2d650be8ff4d3c6a843691ca136cd5d59189f04f520b0d356da066d5a53d908648625a8c2b76920ebd566562e20db4de708bee35196f161382bcffe336316e430725906572d709d992707632de8cab4e3851706e151665f5704098c381cf05c460f1cb631b6cbd1d6abcd47e074c9588e1dbab2df71181e97f5729d1505302e726f2f19385d63c9f142d79a9039ba365c293436c188f751bb6a320aed8a4382d3f57b7ca407e4d098dad9f54f07d996c9be927fa3c6b65c90fbaecc9e1dc944b58dacc87465f6d6809ca942e6baba165c79ae123ee9f9089c1d635908799fbf26e2a3c15f3428db3799fe20519d8fb56f32fdd067a5ff3d9874404f040519292744cf602f59f626d253d221543219c0c0046523200f0e9289728a8ca07d917382c621ff4ca31dc5c98065204ab2fa94794346eb322590d165a0222ad427036e7fdd9f7b415786ed9eec45796d5fda1e87f6813efcc087fcd32c9933be32ba4a46e05a86f6f420d90c45376ecac780e347f25c46d836ea94847270ac8f0c9ab68c0fa30ea565a6f86b41c6663e02176538ce9273d45e6629b24551bbc050e54744ca30e1e3b88836c12118bb723383c8f0037933b77414c6c0b8d8c7f4a74f786a3cc359b9885aff9c3d7edf3528332fd7321806882135377bad400ef1679a310ff3ce78f2c46f17dfc03b329a4383383af7f10edad506992fe79f1084c8e8f0826367a812820e731a3e94c6e1e847199c51c323d91543075921c94350cad7dac217fa2e23e1f03cf7a763e950c681cde0803996dc32313fede6a143d9a98c55bb9ee90786b372baa67f952e8632f74b552eb4875ff4d86feced920ba57d1502ebcc164d33667aa80dd50e3c53f11390735440360449c0415923599bcaa67d7bf624f928cb9728d00f32965ba3c6cbd0dbde618bdac9c4281897dfd2293017e3b43e922f605b94ca730dede3fb8de449d50ebad6847e7b0fafc9282726c862fff0d0bcac5757997b18ed8a0328b55b3be0e0e981ca9b0aa4e0877eb1ad745e708e4feee7365dd7d812cb29e3d34febdabea76f7cd3ef30047bd0feb711f2bba491bd153c4b0281dd434076263d1f81834217fae4fd0b214e217fcd9e7cd80199fed2a072d8570986e04dff82884b6e76266594b3b7908494d36b23278b2109c2cb102a31fa4d2a824c381d91d224e3c2009b2c21e3b8c621cbd2591500fbf40ed111dc36d290710aa02cc5a88332b23e8141cd2c38dfcd2c4ed582422acd519cc472da1e074a28b2678095c4657219d0e83f817f8c8cf1506e1121501cc26891734c7eef7d010a814ee095c89a93f7feb4657cc8d25a96b313024059556637a0b4cee9504afc220794d23b0c31452333be733eda558a9a66cfcfb90f724a9945d4f637f5c7486837830a5914838f67e48d51663038736b663ce48fd132568e22610d40960c8ceef38304a5199cd8aae1d8da19e728580b607c19727d0a4246f1edc78338a0dce6221be6e6209fb9339a6406cf44f2e693c06b01806c8182737e098648809e8e25c1c0cbcae956fbbe2cc5d6868c4b3b193870f6fae14c8d959106064e35827c8d83b5679c3946bf15fc83e05dbbe990043f8c2f8747eecd7360d89a35604b04701cb8673e1378632e0215eb4c176d45d0a93c10870f745650deaede8c033e90030e01591720c7644120aeca2638e13c048ee408ef8cdb98d84dce543bb9c5606d419bc64b3f55a9da8e641cf083aec9e2e811e7c42e999f64009f33b8313e32887ff8a19ad4b526def37b6dd1258e97fdb0166c0d191394d09769b62e3358556d2343da7008b35d1d016baaaa4ab61caacd64935c09d2d9a0aeb1d1f18480a4cbaeb569b88c2f30d3b7a00c04db9c2ebf67fdd276901beb641cec7d3bd0f19d2c79e637745c65098c57bfaa14ecd2a4e7a330e0633fecfc19613b0f2657c61a7ea0cfc640ac5f53c2d747d8817efae13d1851c66740472d2645c470c65764291bc89207651551dbd7f14c498bd2c9ca18167bf0041473040993c001132c990c4175a0a7edfcb5a12d7d215993c932d6c602fa341f0e51d92a91257bbf372763b44f94d897b6c741c04281381b024b8891fd33fde12bde9babec90e3d0befbf88a0f59ae24287e23d0f24eaec32c602fc97cbb0ea539dd4f115f1bc459e109450586449041a0650032688698a310d5e31d65f51b27cc2781f29101592b1e3164b2216d3a5b92100868d77a642690257bca2423b7c6aa1f5946e36cb5cb68c8767c7768078f33faa668fa574160a0652a9380678c0245e4c828358ce29b7138e3c0f00a32acbfd26e8ed329734e46002c6bccfb93800f9c42976ccad2f46f4e2a2e1cb7322523cc003278e45ee95e999c5e7bdfd873ef179fda27c247417bec8479e107630574d0dae47cc80eddb08679d23a4bf6caad57049101bad32ebd0a523cb71da60f553332687ce62380307646db9aa4c39d048183b1e813efc934b93336b62de701fae65cf1cc9f6e81a4c4fb78c87e180bbd329facc0e18d3560178db73daf51e0d4c924fbc391925b4ed1fc24138893cf7310a05f6bc81eeb63d49ab033de23ef6c15db44fe04f964132fd8a6b6b31e05fde09ff6d9829cb32a253d50bd3476f64b666a4cb60704502a987e27f84cf9181edbb47a300e74832c3b478397b6d6d2c770f6f82af8cd7b6c2c1ed20964ec19bc0a4c9dc320632ab6026afc4dfd9ff47c04e683770ee26d1fd8d8850826e723485e8800234fdecf87bd68ee4530b310fabce7447e96f10fe4ffcf9e81cfacbdb0314171193d194c617d224fc0e7e9fc42a1b01758cd7f54a70dd9ca289ae6cf50960b11666e3fcc12f69ebae69294fbcd853db0ce5dbc42edac6f6fd12ef5cb7866053aa3bde1b126c9200f34a8aa74f122a9eb60e1b4c8527ffbaf1a66019593aeb1227237cd16d3fec0fee4e52c21e3cf438f5d242b2fac251c80993d47afa42c5b50bec97ddac2c60147af6c2aab5732759ea2b0fee08c8472afad08a5eef6165ea15098026b25b35f0dd84bf537d61c82031b7bfb0fe214d63e0472fe0c4955c09eafbdc6c2fa83436d0e95dacb7576c2199242a1b00c1c88cebe5028140a85030ae5ec0b8542a150d8e028675f28140a85c2064739fb42a1502814362afabddbddd89bbbb67ffc969d472fcdcde5bf585428140a854261a36069e9aa4bcf7aeec5ff0fee09804a80aca9c90000000049454e44ae426082}\par}}
--------------------------------------------------------------------------------
/Test/test_output.xps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/Test/test_output.xps
--------------------------------------------------------------------------------
/Test/test_units.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/Test/test_units.mcdx
--------------------------------------------------------------------------------
/Test/units_test.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | units_test.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2024 Matt Woodhead
7 | """
8 |
9 | from pprint import pprint
10 | from pathlib import Path
11 | from MathcadPy import Mathcad
12 |
13 |
14 | # First, create a new instance of the Mathcad class (the window can be set to hidden with visible=False)
15 | mathcad_app = Mathcad(visible=True)
16 |
17 | # Open a worksheet in Mathcad and set it as the active worksheet
18 | test_ws = mathcad_app.open(Path.cwd() / "test_units.mcdx")
19 | test_ws.activate()
20 |
21 | print("real_output_test:")
22 | # Fetch the output value
23 | value_1_a, units_1_a, error_code = test_ws.get_real_output("real_output_test")
24 |
25 | # get the same value as the previous result, but this time in foot-pounds torque
26 | value_1_b, units_1_b, error_code = test_ws.get_real_output("real_output_test", units="ft*kip")
27 |
28 | value_1_c, units_1_c, error_code = test_ws._get_output("real_output_test")
29 | print(f"{value_1_a} {units_1_a}, {value_1_b} {units_1_b}, {value_1_c} {units_1_c}")
30 |
31 | print("real_output_test2:")
32 | # Fetch the output value
33 | value_2_a, units_2_a, error_code = test_ws.get_real_output("real_output_test2")
34 |
35 | # get the same value as the previous result, but this time in foot-pounds torque
36 | value_2_b, units_2_b, error_code = test_ws.get_real_output("real_output_test2", units="ft*kip")
37 |
38 | value_2_c, units_2_c, error_code = test_ws._get_output("real_output_test2")
39 | print(f"{value_2_a} {units_2_a}, {value_2_b} {units_2_b}, {value_2_c} {units_2_c}")
40 |
41 | print("real_output_test3:")
42 | # Fetch the output value
43 | value_3_a, units_3_a, error_code = test_ws.get_real_output("real_output_test3")
44 |
45 | # get the same value as the previous result, but this time in foot-pounds torque
46 | value_3_b, units_3_b, error_code = test_ws.get_real_output("real_output_test3", units="ft*kip")
47 |
48 | value_3_c, units_3_c, error_code = test_ws._get_output("real_output_test3")
49 | print(f"{value_3_a} {units_3_a}, {value_3_b} {units_3_b}, {value_3_c} {units_3_c}")
50 |
51 | #test_ws.close()
52 |
--------------------------------------------------------------------------------
/documentation/Examples/matrix_example.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Examples/matrix_example.mcdx
--------------------------------------------------------------------------------
/documentation/Examples/matrix_example.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | matrix_example.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2024 Matt Woodhead
7 | """
8 |
9 | # Standard Library Imports
10 | from pathlib import Path
11 |
12 | # External library Imports
13 | from MathcadPy import Mathcad
14 | import numpy as np
15 |
16 | # create an instance of the Mathcad class - this object represents the Mathcad application
17 | mathcad_app = Mathcad()
18 | mathcad_app.Visible = True
19 |
20 | mathcad_worksheet = mathcad_app.open(Path.cwd() / "matrix_example.mcdx")
21 |
22 | print(mathcad_worksheet.inputs())
23 |
24 | print(mathcad_worksheet.outputs())
25 |
26 | # print the value of the input before we interact with it - for debugging purposes only
27 | print(f"Old input 1 value: {mathcad_worksheet.get_matrix_input('input_1')}")
28 | mathcad_worksheet.set_matrix_input(
29 | "input_1",
30 | [[1, 3],
31 | [2, 4],
32 | ],
33 | ) # change the value in Mathcad programmatically
34 | # print the value of the input after we interact with it - for debugging purposes only
35 | print(f"New input 1 value: {mathcad_worksheet.get_matrix_input('input_1')}")
36 |
37 | # MathcadPy can also use Numpy arrays
38 | matrix_2 = np.array(
39 | [[1, 0],
40 | [0, 1],
41 | ],
42 | )
43 | mathcad_worksheet.set_matrix_input("input_2", matrix_2)
44 |
45 | # fetch the output value now we have changed the inputs
46 | value, units, error_code = mathcad_worksheet.get_matrix_output("output")
47 | if error_code == 0: # Good practice to check for errors when you retreive a value
48 | print(f"Output value: {value} {units}")
49 | else:
50 | raise ValueError
51 |
52 | # fetch the output value now we have changed the inputs
53 | value, units, error_code = mathcad_worksheet.get_matrix_output("output_2")
54 | if error_code == 0: # Good practice to check for errors when you retreive a value
55 | print(f"Output value: {value} {units}")
56 | else:
57 | raise ValueError(error_code)
58 |
59 | mathcad_worksheet.save_as(Path.cwd() / "matrix_example_output.mcdx")
60 | mathcad_app.quit()
61 |
--------------------------------------------------------------------------------
/documentation/Examples/matrix_example_output.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Examples/matrix_example_output.mcdx
--------------------------------------------------------------------------------
/documentation/Examples/simple_example.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Examples/simple_example.mcdx
--------------------------------------------------------------------------------
/documentation/Examples/simple_example.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | examples.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2022 Matt Woodhead
7 | """
8 |
9 | # Standard Library Imports
10 | from pathlib import Path
11 |
12 | # External library Imports
13 | from MathcadPy import Mathcad
14 |
15 | # create an instance of the Mathcad class - this object represents the Mathcad application
16 | mathcad_app = Mathcad()
17 |
18 | mathcad_worksheet = mathcad_app.open(Path.cwd() / "simple_example.mcdx")
19 |
20 | print(mathcad_worksheet.inputs())
21 |
22 | print(mathcad_worksheet.outputs())
23 |
24 | # print the value of the input before we interact with it - for debugging purposes only
25 | print(f"Old input value: {mathcad_worksheet.get_input('input_1')}")
26 | mathcad_worksheet.set_real_input("input_1", 2) # change the value in Mathcad programmatically
27 | # print the value of the input after we interact with it - for debugging purposes only
28 | print(f"New input value: {mathcad_worksheet.get_input('input_1')}")
29 |
30 | mathcad_worksheet.set_real_input("input_2", 4) # change the value in Mathcad programmatically
31 |
32 | # fetch the output value now we have changed the inputs
33 | value, units, error_code = mathcad_worksheet.get_real_output("output")
34 | if error_code == 0: # Good practice to check for errors when you retreive a value
35 | print(value, units)
36 | else:
37 | raise ValueError
38 |
39 | mathcad_worksheet.save_as(Path.cwd() / "simple_example_output.mcdx")
40 | #mathcad_app.quit()
41 |
--------------------------------------------------------------------------------
/documentation/Examples/simple_example_complete.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Examples/simple_example_complete.mcdx
--------------------------------------------------------------------------------
/documentation/Examples/simple_example_output.mcdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Examples/simple_example_output.mcdx
--------------------------------------------------------------------------------
/documentation/Images/Example_000.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/Example_000.PNG
--------------------------------------------------------------------------------
/documentation/Images/Example_001.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/Example_001.PNG
--------------------------------------------------------------------------------
/documentation/Images/Example_002.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/Example_002.PNG
--------------------------------------------------------------------------------
/documentation/Images/Example_003.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/Example_003.PNG
--------------------------------------------------------------------------------
/documentation/Images/Getting_Started.md:
--------------------------------------------------------------------------------
1 | # MathcadPy - Getting Started
2 | How to get started with MathcadPy
3 |
4 | ### Requirements
5 | - [Mathcad Prime 3+](https://www.mathcad.com/) Ensure that you have got PTC Mathcad Prime installed. This wrapper has been tested with Mathcad Prime versions 3, 4 and 5.
6 | - [win32com](https://github.com/mhammond/pywin32) MathcadPy uses the pywin32 package to interact with the Mathcad COM api. This should automatically be installed when you use pip to install MathcadPy, but you can also install it before hand or use an existing installation.
7 |
8 |
9 | ### Installation
10 | MathcadPy has been released on PyPI, so installation is simple as follows:
11 |
12 | pip install MathcadPy
13 |
14 | Thats it!
15 |
16 | ### Testing the link to Mathcad
17 | Start a fresh python script, and type the following:
18 |
19 | from MathcadPy import Mathcad
20 |
21 | mathcad_app = Mathcad() # creates an instance of the Mathcad class - this object represents the Mathcad window
22 |
23 | print(f"Mathcad version: {mathcad_app.version}") # Check the mathcad version and print to the console
24 |
25 | Save and then run the script. You should see an output similar to the following in the terminal window:
26 |
27 | 
28 |
29 | Note that there may be a slight delay whilst Mathcad loads if you do not already have it open.
30 |
31 |
32 | ### Designating an input or an output in the Mathcad worksheet
33 | Now we have verified that the link between your Python script and Mathcad is working, we are ready to start interacting with Mathcad. First, you must designate inputs and outputs in the Mathcad worksheet you want to interact with. Select the value you want to designate as an input:
34 |
35 | 
36 |
37 |
38 | Go to the ribbon interface, and navigate to the input/output tab. Then select "Assign Inputs"
39 |
40 | 
41 |
42 | Assigning an output is completed in the same manner, but using the command "Assign Ouputs". You can view all designated inputs and outputs in the worksheet using the "Show As List" button in the ribbon. The list is formatted with the worksheet name in the left column, and the alias you will use in your python script on the right.
43 |
44 | Note that input alias values deafualt to the worksheet name, and output alias values default to "out", "out1", "out2" etc. It is worth changing these to more meaningful names to make your python script simpler to understand.
45 |
46 |
47 | ### Sending and Fetching worksheet values from Python
48 | TODO
49 |
--------------------------------------------------------------------------------
/documentation/Images/simple_example_001.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_001.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_002.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_002.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_003.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_003.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_004.png
--------------------------------------------------------------------------------
/documentation/Images/simple_example_005.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_005.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_006.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_006.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_007.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_007.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_complete_001.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_complete_001.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_complete_002.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_complete_002.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_complete_003.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_complete_003.PNG
--------------------------------------------------------------------------------
/documentation/Images/simple_example_complete_004.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MattWoodhead/MathcadPy/9f774263296ad1d9e67248e8fbbc5d4ef40ad6e0/documentation/Images/simple_example_complete_004.PNG
--------------------------------------------------------------------------------
/examples.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | examples.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2020 Matt Woodhead
7 | """
8 |
9 | from pprint import pprint
10 | from pathlib import Path
11 | from MathcadPy import Mathcad
12 |
13 | # Try and import numpy - not a prerequisite so fail gracefully if not installed
14 | try:
15 | import numpy as np
16 | NUMPY_IMPORTED = True
17 | except ModuleNotFoundError:
18 | NUMPY_IMPORTED = False
19 |
20 | # First, create a new instance of the Mathcad class (the window can be set to hidden with visible=False)
21 | mathcad_app = Mathcad(visible=True)
22 |
23 | # Check the mathcad version and print to the console
24 | print(f"Mathcad version: {mathcad_app.version}")
25 |
26 | # Open a worksheet in Mathcad and set it as the active worksheet
27 | test_ws = mathcad_app.open(Path.cwd() / "Test" / "test.mcdx")
28 | test_ws.activate()
29 | print(f"Worksheet input names: {test_ws.inputs()}")
30 | print(f"Worksheet output names: {test_ws.outputs()}")
31 |
32 |
33 | # Set some input values
34 | test_ws.set_real_input("real_input_test", 11)
35 | test_ws.set_real_input("real_input_with_units_test", 3, "mm", preserve_worksheet_units=False)
36 | test_ws.set_string_input("string_input_test", "string from python script!")
37 |
38 | if NUMPY_IMPORTED:
39 | matrix_to_send = np.array([1, 2, 3, 4]).reshape((2, 2))
40 | else:
41 | matrix_to_send = [[1, 2],
42 | [3, 4],
43 | ]
44 | test_ws.set_matrix_input("matrix_input_test", matrix_to_send, "s", preserve_worksheet_units=False)
45 |
46 |
47 | # Fetch some output values
48 | value, units, error_code = test_ws.get_real_output("real_output_test")
49 | print(value, units)
50 | value, units, error_code = test_ws.get_real_output("real_output_test", units="in") # get the previous result, but this time in inches
51 | if error_code == 0: # Good practice to check for errors when you request specific units
52 | print(value, units)
53 |
54 | matrix, units, error = test_ws.get_matrix_output("matrix_output_test")
55 | print(matrix, units)
56 |
57 | # Save the worksheet under new filenames, and then close it
58 | try:
59 | print("Trying to save MCDX")
60 | test_ws.save_as(Path.cwd() / "Test" / "test_output.mcdx")
61 |
62 | print("Trying to save RTF")
63 | test_ws.save_as(Path.cwd() / "Test" / "test_output.rtf")
64 |
65 | print("Trying to save XPS")
66 | test_ws.save_as(Path.cwd() / "Test" / "test_output.xps")
67 |
68 | if mathcad_app.version_major_int > 4:
69 | print("Trying to save PDF")
70 | test_ws.save_as(Path.cwd() / "Test" / "test_output.pdf")
71 | except Exception as exc:
72 | print(exc)
73 | pass
74 |
75 | test_ws.close()
76 |
--------------------------------------------------------------------------------
/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=source
11 | set BUILDDIR=build
12 |
13 | %SPHINXBUILD% >NUL 2>NUL
14 | if errorlevel 9009 (
15 | echo.
16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17 | echo.installed, then set the SPHINXBUILD environment variable to point
18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
19 | echo.may add the Sphinx directory to PATH.
20 | echo.
21 | echo.If you don't have Sphinx installed, grab it from
22 | echo.https://www.sphinx-doc.org/
23 | exit /b 1
24 | )
25 |
26 | if "%1" == "" goto help
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | pywin32
--------------------------------------------------------------------------------
/setup.bat:
--------------------------------------------------------------------------------
1 | python setup.py sdist bdist_wheel
2 | set /p PAUSE=Hit ENTER to continue...
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | setup.py
4 | ~~~~~~~~~~~~~~
5 | MathcadPy
6 | Copyright 2024 Matt Woodhead
7 | """
8 |
9 | from pathlib import Path
10 | from setuptools import setup
11 |
12 | # get key package details from MathcadPy/__version__.py
13 | about = {} # type: ignore
14 | here = Path(__file__).parent
15 | with open(here / 'MathcadPy' / '__version__.py') as f:
16 | exec(f.read(), about)
17 |
18 | # load the README file and use it as the long_description for PyPI
19 | with open('README.md', 'r') as f:
20 | readme = f.read()
21 |
22 | # package configuration - for reference see:
23 | # https://setuptools.readthedocs.io/en/latest/setuptools.html#id9
24 | setup(
25 | name=about['__title__'],
26 | description=about['__description__'],
27 | long_description=readme,
28 | long_description_content_type='text/markdown',
29 | version=about['__version__'],
30 | author=about['__author__'],
31 | author_email=about['__author_email__'],
32 | url=about['__url__'],
33 | packages=['MathcadPy'],
34 | include_package_data=True,
35 | python_requires=">3.5",
36 | install_requires=['pywin32'],
37 | license=about['__license__'],
38 | zip_safe=False,
39 | entry_points={
40 | 'console_scripts': ['py-package-template=py_pkg.entry_points:main'],
41 | },
42 | classifiers=[
43 | 'Development Status :: 5 - Production/Stable',
44 | 'Intended Audience :: Developers',
45 | 'Programming Language :: Python :: 3.6',
46 | 'Environment :: Win32 (MS Windows)',
47 | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
48 | ],
49 | keywords='Mathcad, automation, COM, windows'
50 | )
51 |
--------------------------------------------------------------------------------
/source/conf.py:
--------------------------------------------------------------------------------
1 | # Configuration file for the Sphinx documentation builder.
2 | #
3 | # For the full list of built-in configuration values, see the documentation:
4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
5 |
6 | # -- Project information -----------------------------------------------------
7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8 |
9 | project = 'MathcadPy'
10 | copyright = '2025, Matt Woodhead'
11 | author = 'Matt Woodhead'
12 | release = '0.5'
13 |
14 | # -- General configuration ---------------------------------------------------
15 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16 |
17 | extensions = ['sphinx.ext.autodoc']
18 |
19 | # Include both modules and classes
20 | autodoc_default_options = {
21 | 'members': True,
22 | 'undoc-members': True,
23 | 'private-members': True,
24 | 'show-inheritance': True,
25 | }
26 |
27 | # The name of the module you want to document
28 | import MathcadPy
29 | autodoc_mock_imports = ['win32com'] # If your module depends on third-party packages
30 |
31 |
32 |
33 | # The path to your Python module's source code
34 | import os
35 | import sys
36 | sys.path.insert(0, os.path.abspath('../MathcadPy'))
37 |
38 |
39 |
40 | templates_path = ['_templates']
41 | exclude_patterns = []
42 |
43 | # -- Options for HTML output -------------------------------------------------
44 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
45 |
46 | html_theme = 'alabaster'
47 | html_static_path = ['_static']
48 |
--------------------------------------------------------------------------------
/source/index.rst:
--------------------------------------------------------------------------------
1 | .. MathcadPy documentation master file, created by
2 | sphinx-quickstart on Sat Feb 25 13:54:14 2023.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to MathcadPy's documentation!
7 | =====================================
8 |
9 | .. toctree::
10 | :maxdepth: 2
11 | :caption: Contents:
12 |
13 |
14 |
15 | Indices and tables
16 | ==================
17 |
18 | * :ref:`genindex`
19 | * :ref:`modindex`
20 | * :ref:`search`
21 |
22 | .. automodule:: MathcadPy
23 | :members:
24 | :undoc-members:
25 | :private-members:
26 | :show-inheritance:
27 |
--------------------------------------------------------------------------------