Merge profiles

Merge profiles

copypastestd
Advocate Advocate
1,171 Views
2 Replies
Message 1 of 3

Merge profiles

copypastestd
Advocate
Advocate

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

 

 

0 Likes
1,172 Views
2 Replies
Replies (2)
Message 2 of 3

ekinsb
Alumni
Alumni

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
0 Likes
Message 3 of 3

copypastestd
Advocate
Advocate

Tnx for your reply.

 

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

 

trim.jpg

0 Likes