Is there a way to auto constrain end points with ILogic. When I pull in Step files and redraw them the ends aren't constrained. It seems like it is only an issue with arcs to lines. (lines to line are already constrained.)
I use the auto dimension too and turn off dimensions and leave constraints on but it doesnt attached the arcs to lines.
Is there a way to auto constrain end points with ILogic. When I pull in Step files and redraw them the ends aren't constrained. It seems like it is only an issue with arcs to lines. (lines to line are already constrained.)
I use the auto dimension too and turn off dimensions and leave constraints on but it doesnt attached the arcs to lines.
You can merge sketch points in sketch using iLogic. Here is the sample without error checking, but it is start point how to do it
'Planar sketch must be active
Dim oSketch As PlanarSketch = ThisApplication.ActiveEditObject
Dim partDef As PartComponentDefinition = oSketch.Parent
Dim selectionFilter As SelectionFilterEnum() = New SelectionFilterEnum() {SelectionFilterEnum.kSketchPointFilter }
Dim tolerance As Double = 0.1 ' 1 = 1cm
For Each oSketchPoint As SketchPoint In oSketch.SketchPoints
Dim nearSketchPoints As ObjectsEnumerator = partDef.FindUsingPoint(oSketchPoint.Geometry3d, selectionFilter, tolerance)
For Each nearSketchPoint As SketchPoint In nearSketchPoints
If nearSketchPoint Is oSketchPoint Then Continue For
If nearSketchPoint.Parent.Name <> oSketch.Name Then Continue For
oSketchPoint.Merge(nearSketchPoint)
Next
Next
You can merge sketch points in sketch using iLogic. Here is the sample without error checking, but it is start point how to do it
'Planar sketch must be active
Dim oSketch As PlanarSketch = ThisApplication.ActiveEditObject
Dim partDef As PartComponentDefinition = oSketch.Parent
Dim selectionFilter As SelectionFilterEnum() = New SelectionFilterEnum() {SelectionFilterEnum.kSketchPointFilter }
Dim tolerance As Double = 0.1 ' 1 = 1cm
For Each oSketchPoint As SketchPoint In oSketch.SketchPoints
Dim nearSketchPoints As ObjectsEnumerator = partDef.FindUsingPoint(oSketchPoint.Geometry3d, selectionFilter, tolerance)
For Each nearSketchPoint As SketchPoint In nearSketchPoints
If nearSketchPoint Is oSketchPoint Then Continue For
If nearSketchPoint.Parent.Name <> oSketch.Name Then Continue For
oSketchPoint.Merge(nearSketchPoint)
Next
Next
@Michael.Navara Thanks for your input. I'd like to figure out what the DWG import tool's "Constrain End points" actually does. If I export the sketch as a DWG, delete the geometry and then import that DWG it allows me to click that checkbox and then everything is connected once the import is done. The only problem is that there is a high change of Inventor crashing. (What else is new? 😁)
@Michael.Navara Thanks for your input. I'd like to figure out what the DWG import tool's "Constrain End points" actually does. If I export the sketch as a DWG, delete the geometry and then import that DWG it allows me to click that checkbox and then everything is connected once the import is done. The only problem is that there is a high change of Inventor crashing. (What else is new? 😁)
In my opinion the check box has similar effect as my code mentioned above.
If the Inventor crashes during this operation, it is a question to Autodesk. I have no idea.
In my opinion the check box has similar effect as my code mentioned above.
If the Inventor crashes during this operation, it is a question to Autodesk. I have no idea.
Can't find what you're looking for? Ask the community or share your knowledge.