Message 1 of 11
Not applicable
09-18-2015
04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to SWEEP a profile and a path. It fails as both are bit apart (not intersecting). So I wish to bring path upto profile. I am trying that by offsetting curves of path, upto point projected from profile.
Here is the code:
' project first point on to path's sketch plane, and then offset the path to that point so that SWEEP's profile and path will intersect
Dim oStartPointProfile As SketchPoint = oProfiles.Item(1).Item(1).Item(1).StartSketchPoint
Dim wpt As WorkPoint = oCompDef.WorkPoints.AddFixed(oStartPointProfile.Geometry3d, True)
' Get path's sketch
Dim pathSketch As PlanarSketch = path.Item(1).SketchEntity.Parent
' Make a new sketch by copying evrything from path sketch
Dim newPathSketch As PlanarSketch = CreateNewSketch(pathSketch, True)
' Get a point to offset the path to
Dim newProjectedPoint As SketchPoint = newPathSketch.AddByProjectingEntity(wpt)
Dim oCollection As ObjectCollection = _invApp.TransientObjects.CreateObjectCollection
oCollection.Add(newPathSketch.SketchLines.Item(1)) ' Is SketchEntities better than SketchLines, hmm. crashes!!
Dim offsettedentities As SketchEntitiesEnumerator = newPathSketch.OffsetSketchEntitiesUsingPoint(oCollection, newProjectedPoint.Geometry, True, False)
Dim newPath As Inventor.Path = oCompDef.Features.CreatePath(offsettedentities.Item(1))Offsetting does not work. It appears that one line has got offsetted but others did not follow. I do not want two copies, but just one offsetted closed loop path.
Solved! Go to Solution.
