FreedCAD 0.12: Part WB Box H/L/W
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 17
- Joined: Mon Jan 09, 2012 2:40 pm
FreedCAD 0.12: Part WB Box H/L/W
For a Box added In the Part WB, where does the Data tab get its Height, Length, Width dimensions from?
If I try:
obj = FreeCAD.ActiveDocument.GER026
shp = obj.Shape
print shp.Height
I get an error as 'Part.TopoShape' object has no attribute 'Height'.
There is a 'Length' attribute but according to the TopoShape API, it's the total length of the edges of the shape.
Brian
If I try:
obj = FreeCAD.ActiveDocument.GER026
shp = obj.Shape
print shp.Height
I get an error as 'Part.TopoShape' object has no attribute 'Height'.
There is a 'Length' attribute but according to the TopoShape API, it's the total length of the edges of the shape.
Brian
Re: FreedCAD 0.12: Part WB Box H/L/W
simply:
The shape is simply another property of the object. In fact the object contains code that recomputes the shape whenever a parameter changes
Code: Select all
obj = FreeCAD.ActiveDocument.GER026
obj.Height
Re: FreedCAD 0.12: Part WB Box H/L/W
For most primitives such as a box we have a parametric and a non-parametric version. The topo shape you're talking about is the non-parametric version. For the non-parametric object you can only change the whole shape itself but no parameters. Here are some examples to illustrate this:
Code: Select all
# non-parametric
import Part
obj=App.ActiveDocument.addObject("Part::Feature")
obj.Shape=Part.makeBox(10,10,10)
# replace shape
obj.Shape=Part.makeBox(20,10,10)
Code: Select all
# parametric
obj=App.ActiveDocument.addObject("Part::Box")
obj.Length=20.0
obj=App.ActiveDocument.recompute()
obj.Length=10.0
obj=App.ActiveDocument.recompute()
Re: FreedCAD 0.12: Part WB Box H/L/W
bhorton111 wrote:For a Box added In the Part WB, where does the Data tab get its Height, Length, Width dimensions from?
If I try:
Werner, I think he means he hit the create box icon on the tool bar in Part WB? If so he would have the parametric shape, unless I am confused .
I just tried it (and all that you two guys put here) and it all works as you two have said, as would obviously be the case.
So Brian, if you mean you clicked the box icon on the tool bar in Part WB, then you will have the parametric version. If that is what you mean, follow Yorik's suggestion or Werner's parametric, but if you used "Part.makeBox" from the command line then you have the NON-parametric version that Werner talks about.
Jim
Re: FreedCAD 0.12: Part WB Box H/L/W
Or maybe look at the 'data' tab in the 'combo view'
Re: FreedCAD 0.12: Part WB Box H/L/W
Yes, but not very helpful or useful, when he would appear to be trying to write a script.shoogen wrote:Or maybe look at the 'data' tab in the 'combo view'
-
- Posts: 17
- Joined: Mon Jan 09, 2012 2:40 pm
Re: FreedCAD 0.12: Part WB Box H/L/W
Thanks for the clarification. Is there any automatic way to covert a non-parametric shape into an equivalent parametric one?
Brian
Brian
Re: FreedCAD 0.12: Part WB Box H/L/W
In general not. You can do it for a handful of geometries like cylinder, cone, plane and a few others but for composed objects like a box it gets much harder.bhorton111 wrote:Thanks for the clarification. Is there any automatic way to covert a non-parametric shape into an equivalent parametric one?
Brian
-
- Posts: 17
- Joined: Mon Jan 09, 2012 2:40 pm
Re: FreedCAD 0.12: Part WB Box H/L/W
Thanks. Why is a box more complex than a cylinder or cone? I would've thought it would be simpler...
Brian
Brian
Re: FreedCAD 0.12: Part WB Box H/L/W
This may be a good explanation, it's quoted from another current topic:
wmayer wrote:FYI, OCC terminology distinguishes between geometry and shape. A geometry is a point, a curve (circle, line, ellipse, ...) or a surface (plane, cone, cylinder, ...). And a shape tells something about the topology. They have vertex, edge, wire, face, shell, solid, compound and the rarely used compound solid. The three shapes vertex, edge and face are the direct topological counterpart for geometries point, curve and surface. For edge and face you can also set the domain if needed. Then wire is a set of connected edges, shell a set of connected faces, a solid is a closed shell and a compound is just a container for arbitrary shapes.