Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error using SplitFeatures with TrimSolid [iLogic]

0 REPLIES 0
Reply
Message 1 of 1
elias.utria
85 Views, 0 Replies

Error using SplitFeatures with TrimSolid [iLogic]

I am trying SplitFeatures with TrimSolid in iLogic, the objects by function are (SplitTool As Object, Body As SurfaceBody, [RemovePositiveSide] As Boolean), when use 2dPath and sketchLine to be ContainingSketchBlock not working and closes Inventor

I try used CreatePath and CreateSpecifiedPath functions by SplitTool but put error.

 

How do I do TrimSolid with curves in SketchBlock in illogic or macros?

 

I am trying with the next code.

 

Dim oCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection 
Dim opartdoc As PartDocument = ThisApplication.ActiveDocument

Dim curve As Object = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchCurveFilter, "Select sketch line")

If curve.type = ObjectTypeEnum.kSketchLineObject Then
	If curve.ContainingSketchBlock Is Nothing Then 
		Logger.Trace("ContainingSketchBlock: false")
		Dim path1 As Path = opartdoc.ComponentDefinition.Features.CreatePath(curve)
		opartdoc.ComponentDefinition.Features.SplitFeatures.TrimSolid(path1,opartdoc.ComponentDefinition.SurfaceBodies.Item(1),True)
	Else
		Logger.Trace("ContainingSketchBlock: true")
		oCollection.Add(curve)
		Try
			'Dim path2 As Path = opartdoc.ComponentDefinition.Features.CreatePath(curve)
			Dim path2 As Path = opartdoc.ComponentDefinition.Features.CreateSpecifiedPath(oCollection)
			Logger.Trace("---Path Count> " & path2.Count)
			opartdoc.ComponentDefinition.Features.SplitFeatures.TrimSolid(path2, opartdoc.ComponentDefinition.SurfaceBodies.Item(1), False)
		Catch ex As Exception
			Logger.Trace("---Error Message> " & ex.Message)
		End Try
	End If
Else
	Exit Sub
End If

 

Labels (1)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report