tomate44 / CurvesWB

Experiments for a FreeCAD Surface workbench
GNU Lesser General Public License v2.1
112 stars 24 forks source link

Changes to handle curveOnSurface on linked objects. #90

Closed edwilliams16 closed 1 year ago

edwilliams16 commented 1 year ago

Aloha Chris This alters the selection process to allow curveonsurface to work on linked objects. I tested it on the enclosed with

tests = [('Box001', ('Face2', 'Edge7')),
    ('Array', ('0.Face2', '0.Edge7')),
    ('Array', ('1.Face2', '1.Edge7')),
    ('Array', ('2.Face2', '2.Edge7')),
    ('Part', ('Box002.Face2', 'Box002.Edge7')),
    ('Link001', ('Box002.Face2', 'Box002.Edge7')),
    ('Link', ('Face2', 'Edge7'))]

Gui.activateWorkbench("CurvesWorkbench")
doc = App.ActiveDocument
for test in tests:
    Gui.Selection.addSelection(doc.getObject(test[0]), test[1], True)
    Gui.runCommand('cos', 0)

I didn't test the elif obj.getTypeIdOfProperty(prop) == "App::PropertyLinkSubList": branch. I'm not sure how those occur.

I was also trying to fix the BlendSolid tool, in the same manner, but failed to debug it.

This PR does not contain the one-line change to the BlendSurface tool, mentioned in the forum, which passes the tests I tried.

blendsurftest.FCStd.zip