BoundaryPatch with open 3D-profile

BoundaryPatch with open 3D-profile

frank_willing
Contributor Contributor
191 Views
2 Replies
Message 1 of 3

BoundaryPatch with open 3D-profile

frank_willing
Contributor
Contributor

Hello,

 I want to create a boundary Patch with a 3D-line , that is connected to 2splines.

With this I want to create a boudary patch:

- manually this functiions in Inventor: I choose the 3d Line as boundaryloop then the 2 splines as rails. Inventor creates the boundary patch as desired.

 

Now I tried to do this programmatically:

- The Guide-Rails are no Problem

- But Inventor does not accept the 3d Line as boundaryloop, I already tried to use it as path, collection or profile3d.

Attached you will find the ipt.

Can somebody help?

 

frank_willing_0-1738764235934.png

 

 

Regards Frank

 

 

 

0 Likes
Accepted solutions (1)
192 Views
2 Replies
Replies (2)
Message 2 of 3

frank_willing
Contributor
Contributor

I just tried to buid it again in VBA:

- I "stole" the patchloop object from the existing(manual built) BoundaryPatch

- then I tried to rebuild it with VBA

- But the code crashes in the line I add the patch loop to the BoundaryPatchDefinition

I there any way to built the BounderyPatch or another way to create a Surface fitting to the Splines an the 3DLines?

 

Public Sub test()

Set obj = ThisApplication.ActiveDocument

Dim opatch As BoundaryPatchFeature
Set opatch = obj.ComponentDefinition.features.BoundaryPatchFeatures.Item(1)

Dim Patchloop As BoundaryPatchLoop
Set Patchloop = opatch.Definition.BoundaryPatchLoops.Item(1)

Dim Spline1 As SketchSpline3D
Dim Spline2 As SketchSpline3D
Dim osketch As Sketch3D

Set osketch = obj.ComponentDefinition.Sketches3D.Item(1)


Set Spline1 = osketch.SketchSplines3D.Item(1)
Set Spline2 = osketch.SketchSplines3D.Item(2)

 


Dim BoundPatchDef As BoundaryPatchDefinition
Set BoundPatchDef = obj.ComponentDefinition.features.BoundaryPatchFeatures.CreateBoundaryPatchDefinition

Call BoundPatchDef.GuideRails.Add(Spline1)
Call BoundPatchDef.GuideRails.Add(Spline2)

Call BoundPatchDef.BoundaryPatchLoops.Add(Patchloop)


Dim Kurvenfläche2 As BoundaryPatchFeature
Kurvenfläche2 = odoc.ComponentDefinition.features.BoundaryPatchFeatures.Add(BoundPatchDef)

 

End Sub

 

 

Thanks and regards Frank

 

0 Likes
Message 3 of 3

frank_willing
Contributor
Contributor
Accepted solution

Hello together,

 I solved the problem in another way:

- I Closed the 3Dsplines

- I put the outer-spline to a collection1 and the innerspline to a second collection

- then I added these collections as boundaryloops and created the boundarypatch

 

Dim Spline_innen As SketchSpline3D
Spline_innen = drei_D_skizze.SketchSplines3D.Add(Punkte_innen)

Spline_innen.Closed = True

Dim Spline_aussen As SketchSpline3D
Spline_aussen = drei_D_skizze.SketchSplines3D.Add(Punkte_aussen)

Spline_aussen.Closed = True

drei_D_skizze.ExitEdit()

objColl1.Add(Spline_aussen)
objColl2.Add(Spline_innen)

BoundPatchDef.BoundaryPatchLoops.Add(objColl1)
BoundPatchDef.BoundaryPatchLoops.Add(objColl2)


Dim Kurvenfläche1 As BoundaryPatchFeature
Kurvenfläche1 = oDoc.ComponentDefinition.Features.BoundaryPatchFeatures.Add(BoundPatchDef)

 

regards Frank

0 Likes