Scenario 1: Two lines simply connected, end-to-end, via a common SketchPoint.
Dim oLineOne As SketchLine = oSketch.SketchLines.AddByTwoPoints( oTransGeom.CreatePoint2d(0, 0.75), oTransGeom.CreatePoint2d(5, 0.75))
Dim oLineTwo As SketchLine oLineTwo = oSketch.SketchLines.AddByTwoPoints(oLineOne.EndSketchPoint, oTransGeom.CreatePoint2d(5, 5.75))
Dim oProfile As Profile = oSketch.Profiles.AddForSurface(oLineOne)
=> Works fine. ExtrusionSrf created by profile by AddForSurface(oLineOne), gives "L" shaped surface.
Scenario 2: Added a third line, making a "T" like shape as below.
Dim oLineOne As SketchLine = oSketch.SketchLines.AddByTwoPoints( oTransGeom.CreatePoint2d(0, 0.75), oTransGeom.CreatePoint2d(5, 0.75))
Dim oLineTwo As SketchLine oLineTwo = oSketch.SketchLines.AddByTwoPoints(oLineOne.EndSketchPoint, oTransGeom.CreatePoint2d(5, 5.75))
Dim oLineTwo As SketchLine oLineTwo = oSketch.SketchLines.AddByTwoPoints(oLineOne.EndSketchPoint, oTransGeom.CreatePoint2d(10, 0.75))
Dim oProfile As Profile = oSketch.Profiles.AddForSurface(oLineOne)
Only surface corresponding to oLineOne is created. Does not even for both oLineOne & oLineTwo as done
in Scenario 1. Stops at a branch point. Why? What is the resolution?
By some logic if it does so, now the issue is, Lines like oLineTwo and oLineThree are left out. How to identify
such lines which are not part of any profiles so far?
Is there any identifier/attribute that differentiates SketchLies which are consumed in a profile so far, and the ones which are not consumed?
Or exhaustive search is needed?
Basically given a sketch having multiple-connected lines, it would be nice to have all the connected paths possible
as a list then one can iterate over that list, create profile for each of the paths.
Same behavior as from the User Interface. Seems to be a limitation of Inventor. I couldn't even build a stitched surface from 3 independent extrusions.
Regards,
Philippe.
Thanks for the reply.
Is there any suggestion on how to find SketchLines not consumed by any of the profiles?
I don't think there is a direct way: the sketchline doesn't know about the profile. You will need to go the other way around: from the feature, access the Profile, iterate each ProfilePath inside (Profile[idx]), iterate each ProfileEntity from the path, use ProfileEntity.SketchEntity to access the sketch entities used by that path.
You could store all used entities and compare that with all entities in the sketch.
Hope that helps,
Philippe.