
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to access the replace face tool from the solid body modification tools from the API.
The top surface of the strut should be replaced by the inclined surface of the second part (see figure). This works perfectly fine by manually executing the replace face feature and selecting the faces in the GUI.
Using the following code snippet for the replace feature leads to a runtimeError:3
repFaceFeats = rootComp.features.replaceFaceFeatures
# source is the strut face as result of a loft feature
source = adsk.core.ObjectCollection.create()
source.add(loftFeat.startFace)
# target is a BrepFace of the target body
target = face[0]
repFaceInp = repFaceFeats.createInput(source,False,target)
repFace = repFaceFeats.add(repFaceInp)
Error:
RuntimeError: 3 : invalid target faces, it should be surface face or body
The target face is of type BrepFace and I can confirm that it is the desired face of the body. Selecting the same face using the UI.selectEntity() method and using the returned entity as target face for the replaceFaceFeatureInput leads to the same error.
Any suggestions on what might be my mistake here?
Thank you all in advance!
Solved! Go to Solution.