Reply
Enthusiast
33 Posts
25 Kudos
4 Solutions

Merge profiles

60 Views, 2 Replies
2 weeks ago

Hello there,

 

I am wondering, is it possible to merge profiles, to make one profile?

 

For example, I have draw some complicated geometry sketch via code, and in fufure I will work only with whole sketch (I don't need inner lines).

 

May be it is possible to delete all inner lines (or modify them to the constructions lines), or some like that?

Right now I use such code:

profs = adsk.core.ObjectCollection.create()
        
    for prof in sketch.profiles:
        profs.add(prof)

 

It works, but this is not what exactly I need.

Merge.JPG

 

 

Highlighted
Autodesk Support
1257 Posts
353 Kudos
369 Solutions

Re: Merge profiles

2 weeks ago in reply to: copypastestd

Profiles represent closed areas within a sketch.  The creation of profiles doesn't change the sketch in any way.  It's common that the curves in a profile will not have a 1-to-1 correspondence with the sketch entities.  In the example show below I drew two overlapping circles.  This results in three profiles with each one defined by two arcs.  The arcs don't exist in the sketch but were calculated as a result of the profile analysis.  The API provides access to each of these arcs as a ProfileCurve object along with the real sketch circle that it was extracted from. I think you could do some geometric analysis to find all of the profile curves that are geometrically identical to another profile curve and ignore those.  That should leave you with the outer shape.  There isn't a simple way to geometrically compare them so it would take a fair amount of code to implement something like that.

 

Profiles.png

 

 

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Enthusiast
33 Posts
25 Kudos
4 Solutions

Re: Merge profiles

Friday in reply to: ekinsb

Tnx for your reply.

 

I was thinking about some algoritm which find all inner lines and trim them from sketch.

 

trim.jpg