Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Perplexing question

MichaelT_123
Advisor Advisor
790 Views
6 Replies
Message 1 of 7

Perplexing question

MichaelT_123
Advisor
Advisor

Hi TF360,

 

Why it is possible to delete bRepFace via UI but the API equivalent:

return = bRepFace.deleteMe()

doesn’t exist?

 

Curious

MichaelT

MichaelT
Reply
Reply
0 Likes
Accepted solutions (2)
791 Views
6 Replies
Replies (6)
Message 2 of 7

OceanHydroAU
Collaborator
Collaborator

Are you using C or Python?

 

Undoubtedly you already know, but just in case not, you can set breakpoints in your code, and then use Visual Studio to manually explore the object hierarchy ... you never know - perhaps it's there with some other name?

 

Other thoughts to consider... are you creating this in the first place, from the API?  Maybe you could put it inside something else (e.g. its own sketch) which you *can* delete ?

 

Maybe there's some way to set attributes on this thing which can help?  (does the object returned from the original create have a deleteMe() on it?)

 

You could possibly use some other thing instead of a bRepFace (e.g. some sketch splines and a surface loft on them) which would then let you delete them all later.

 

It sounds exciting - what are you making ?

Reply
Reply
0 Likes
Message 3 of 7

MichaelT_123
Advisor
Advisor
Hi Mr OceanHydroAU,
 
This is the error:
    
bFace.deleteMe()
AttributeError: 'BRepFace' object has no attribute 'deleteMe'
 
It is consistent with the API reference. deleteMe() method is not the part of 'BRepFace'  object.

There is TrimFeature Object which is the closest in the functionality I can find. It is however overwhelmingly complicated for such a simple task.

 
Regards
MichaelT
 
 
MichaelT
Reply
Reply
0 Likes
Message 4 of 7

PinRudolf
Advocate
Advocate

That is unexpected.

 

Could you use Covert to create a new body and delete that? Or will it just copy the face?

 

newBody = brepFace.convert(2)
newBody.deleteMe()

 

I've never tested this, might be very wrong.

 

 

Reply
Reply
0 Likes
Message 5 of 7

BrianEkins
Mentor
Mentor
Accepted solution

If the SOLID tab is active when you try to delete a face using the UI you'll get an error.  However, if you delete a face when the SURFACE tab is active it will allow you to delete a face.  However, notice that the result in the timeline is a new delete face feature.  Deleting a face actually creates a new feature.  To do the same thing in the API you need to create a new DeleteFaceFeature.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Reply
Reply
2 Likes
Message 6 of 7

MichaelT_123
Advisor
Advisor

Thank you, Mr Brian Ekins...

 

for pointing me up to the DeleteFaceFeature.

I have not noticed it scouring API, perhaps dementia setting in ☹️.

I use TrimFeature encapsulating it in pseudo_deleteMe() method.

It works.

DeleteFaceFeature, with its aftereffect, is not suitable for the case.

SurfaceDeleteFaceFeature seems to be the better candidate.

Still the perplexing lingers in some of my synopsis, although as the mild itching only.

 

Why there is no such bRepFace.deleteMe() implemented directly, keeping the consistency of API's vernacular?

 

Regards

MichaelT

 

MichaelT
Reply
Reply
0 Likes
Message 7 of 7

BrianEkins
Mentor
Mentor
Accepted solution

The BRepBody and its various child BRep objects are all read-only.  They provide a way to interrogate an existing model but they don't support creation or edit. Editing of the B-Rep is done using features.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Reply
Reply
1 Like