Thanks Brian.
The problem is, I don't know the name of the source sketch occurrence (Source:1) or the name of the sketch (Source) that the user will select.
I also don't know the name of the occurrence the new sketch will be on.
I get the correct components (A Plate and B Plate), but not the occurrence name (A Plate:1 and B Plate:1).
My code below:
selFace: adsk.fusion.BRepFace = _inputSelectFace.selection(0).entity
selFaceComp = selFace.nativeObject.body.parentComponent ## A Plate (correct)
selSketch: adsk.fusion.Sketch = _inputSelectSketch.selection(0).entity
selSketchComp = selSketch.nativeObject.parentComponent ## B Blate (correct)
selSketchComp = selSketchComp.occurrences ## This line comes up 'count 0' no occurrences? (a test)
selSketchCompOcc = adsk.fusion.Components.itemByName(selSketchComp.name) ### Problem line
newSketch: adsk.fusion.Sketch = selFaceComp.sketches.addWithoutEdges(selFace.nativeObject)
sketchPoints = selSketchComp.sketches.itemByName(selSketch.name).sketchPoints
sketchCurves = selSketchComp.sketches.itemByName(selSketch.name).sketchCurves
[newSketch.project(p.createForAssemblyContext(selSketchCompOcc)) for p in sketchPoints]
[newSketch.project(c.createForAssemblyContext(selSketchCompOcc)) for c in sketchCurves]
Been messing with this for about a week now.
Probably just having senior moments, but still frustrating me.
Thanks for the help.
Brad Bylls