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.
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.
Inventor and Fusion 360 API Expert
Mod the Machine blog