cqparts parameter access
See original GitHub issueI’d like to use a class parameter as the template param of the render_props function and defined it as following:
class Case(cqparts.Part):
# Parameters
color = String("green", doc="color-coded position")
print(color)
_render = render_props(template=color)
Unfortunately, it is not accessed like a str as it is expected by the template param and can be seen with the print statement (it prints: <cqparts.params.types.String object at 0x000002602F2ACBE0>
). If I call render_props(template=color.default)
it works but uses the default value and not the passed value. How to access the value passed as the class parameter?
In cqparts/tests/t_cqparts/test_params.py
only default and casts are tested.
BTW: Using native types like str
do not work as parameters.
CadQuery 1.2.0 cqparts 0.2.2.dev1
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
cqparts package — cqparts 0.2.1 documentation
Parameters : recursive ( bool ) – if set, iterates through child components and builds those ... The outcome of this function should...
Read more >Use parameters in queries, forms, and reports
This article explains how to use forms in Access to enhance your use of parameters in queries, forms, and reports.
Read more >Part placement · Issue #26 · cqparts/cqparts - GitHub
Place parts with translation : vector (easy) rotation quaternion angles need to look at how this is done conventionally.
Read more >CadQuery – a parametric CAD script framework - Hacker News
Also check out cqparts which builds on cadquery and add the concept of parts, assemblies and mates to cadquery.
Read more >Source code for cadquery.occ_impl.geom
[docs] def __getitem__(self, rc: Tuple[int, int]) -> float: """Provide Matrix[r, c] syntax for accessing individual values. The row and column parameters ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works now as expected. Many thanks!
OK @tolot27 , your 2nd code example should work after fix #140. Thank you for letting me know!