Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have found an example which shows how to offset an rectangle by offset using point option.
Here is a code:
' Create a rectangle Dim oRectangleLines As SketchEntitiesEnumerator Set oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle(oTransGeom.CreatePoint2d(1, 2), oTransGeom.CreatePoint2d(5, 5)) ' Create a new object collection Dim oCollection As ObjectCollection Set oCollection = ThisApplication.TransientObjects.CreateObjectCollection ' Add the first sketch line of the rectangle to the collection oCollection.Add oRectangleLines.Item(1) ' Offset Dim offsettedentities As SketchEntitiesEnumerator Set offsettedentities = oSketch.OffsetSketchEntitiesUsingPoint(oCollection, oOriginSketchPoint.Geometry, True, True)
All that I need now is to adapt code for other type of sketch entity, for example for the arcs.
I tried with folowing code but I am getting error type missmatch.
Dim oArc As SketchEntitiesEnumerator 'I know this declaration makes a problem but if I declare variable as SketchArc I can't add to collection Set oArc = oSketch.SketchArcs.AddByCenterStartEndPoint(oTransGeom.CreatePoint2d(0, 0), oTransGeom.CreatePoint2d(-5, 0), oTransGeom.CreatePoint2d(5, 0), True)
' Create a new object collection
Dim oCollection As ObjectCollection
Set oCollection = ThisApplication.TransientObjects.CreateObjectCollection
' Add the first sketch line of the rectangle to the collection
oCollection.Add oArc.Item(1)
' Offset
Dim offsettedentities As SketchEntitiesEnumerator
Set offsettedentities = oSketch.OffsetSketchEntitiesUsingPoint(oCollection, oOriginSketchPoint.Geometry, True, True)
Can someone help me with this.
Regards
Danijel
Inventor 2018/Windows 10 x64
If this information was helpful, please consider marking it as an Accepted Solution by using the Accept as Solution. Kudos are also gladly accepted.
If this information was helpful, please consider marking it as an Accepted Solution by using the Accept as Solution. Kudos are also gladly accepted.
Solved! Go to Solution.