Code: Select all
FreeCAD.getDocument('Unnamed').getObject('Pad').Profile = FreeCAD.getDocument('Unnamed').getObject('Sketch001')
Thought I would answer my own question (with an approach) in case folks are interested.If I have a sketch (attached to a face) and the face gets renumbered the sketches placement will change. I can put the sketch back where it was (placement wise) and the next logical step is to find the new face number at that placement.
That I think is "marching". I offset the sketch in the Z-direction, recompute and look for an error. This could fix a multiple solid error. Once the error is corrected the backup placement will be updated. This is certainly solver territory.chrisb, 1) It would be interesting to see how you check for a sketch being "close" to its previous position.
2) My thinking/writing was wrong about error handling. I will watch for a FreeCAD (topo-error or multiple solid) error and then try to relocate sketches. So normally FreeCAD would update sketch placements if a cube was moved.chrisb, 2) Imagine a cube, with sketches attached to each of the six sides. Now you move the cube quite a bit and you turn it.
That is a problem, hopefully the logic behind every change in placement can be resolved.chrisb, Please note that toponaming errors often occur without a formal FreeCAD error.