Having Extrude problems !

Having Extrude problems !

Anonymous
Not applicable
402 Views
2 Replies
Message 1 of 3

Having Extrude problems !

Anonymous
Not applicable
Hello,

I am very new at programming. I have been trying to get the below code to work. The code first opens a new part file. It then opens a sketch. It then creates a work plane .5 inch away from plane 3. It then draws a rectangle 2 X .2 inches and finally tries to extrude it. Everything seems to work except the extrude part.

Thank you for your time
WailGM


Private sub UserButtonz1_Click()

Dim oDoc As PartDocument
Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject))

Dim oPartCompDef As PartComponentDefinition
Set oPartCompDef = oDoc.ComponentDefinition

Dim oSketch As PlanarSketch
Set oSketch = oPartCompDef.Sketches.Add(oPartCompDef.WorkPlanes.Item(3))

Dim oWPlane As WorkPlane
Set oWPlane = oPartCompDef.WorkPlanes.AddByPlaneAndOffset(oPartCompDef.WorkPlanes(3), (.5 * 2.54))
Set oSketch = oPartCompDef.Sketches.Add(oWPlane)

Call oSketch.SketchLines.AddAsTwoPointRectangle(oTg.CreatePoint2d(0, 0), oTg.CreatePoint2d(.2 * 2.54, 2 * 2.54))

Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid

Dim oExtrude As ExtrudeFeature
Set oExtrude = oPartCompDef.Features.ExtendFeatures.AddByDistanceExtent(oProfile, 1 * 2.54, kPositiveExtentDirection, kJoinOperation)

End sub
0 Likes
403 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I have found the problem extend vs extrude.
0 Likes
Message 3 of 3

Anonymous
Not applicable
extrude and extend are not the same way ,hehe
0 Likes