Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Perplexing question

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
MichaelT_123
320 Views, 6 Replies

Perplexing question

Hi TF360,

 

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

return = bRepFace.deleteMe()

doesn’t exist?

 

Curious

MichaelT

MichaelT
6 REPLIES 6
Message 2 of 7
OceanHydroAU
in reply to: MichaelT_123

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 ?

Message 3 of 7
MichaelT_123
in reply to: OceanHydroAU

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
Message 4 of 7
PinRudolf
in reply to: MichaelT_123

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.

 

 

Message 5 of 7
BrianEkins
in reply to: MichaelT_123

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
Message 6 of 7
MichaelT_123
in reply to: BrianEkins

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
Message 7 of 7
BrianEkins
in reply to: MichaelT_123

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report