hello
trying to code the generation and placement of a revolved object from a sketch
tried coding a few different ways
1. generated the sketch[ok], used placement to move[ok], then used revolution, did not work, when sketch moved back to original position, revolved part appeared
2. generated the sketch[ok], used revolution[ok], then used placement on sketch, did not work, [sketch moved, but revolved part stayed put], had to used placement on the revolved part also
both the sketch and the revolved part have some type of error[red exclamation point]
also tried cutting a previous solid[box], with the revolved part, got an error message about: an OCC exception occurred [no other details] and that the resulting solid would not be created. a solid was created with a hole[as wanted] but the sketch and revolved part still had errors which i cannot figure out what they are
does revolution only work along a major axis?
must a sketch and revolved part be moved together as detailed above?
using the python console and report view, but no errors were printed on either
are those errors logged? or available somewhere?
..."Sketch").Placement; ..Revolution.Placement
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: ..."Sketch").Placement; ..Revolution.Placement
Try this..
The first vector defines any translation. The second vector defines your axis of rotation, followed by your degrees of rotation. The last vector identifies the origin of your axis of rotation.
Hope this helps.
Code: Select all
doc=FreeCAD.newDocument()
box=doc.AddObject("Part::Box","myBox")
doc.recompute()
App.getDocument("Unnamed").myBox.Placement=App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(0,0,1),25),App.Vector(0,0,0))
Hope this helps.