Zobrazit plnou verzi p°Ýspývku: Inventor - programovanie vo VBA

Vlado
19.10.2004, 07:56
Vie niekto poradit ako sa vytvorit plech s dierou a nie extrud
Public Sub SheetMet()    Dim oPartDoc As PartDocument    '           ;           ;           ;           ;       Dim oPartDoc As SheetMetalComponentDefinition    Set oPartDoc = ThisApplication.ActiveDocument        If oPartDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then        MsgBox "A sheet metal document must be open."        Exit Sub    End If        Dim oSheetMetalCompDef As SheetMetalComponentDefinition    Set oSheetMetalCompDef = oPartDoc.ComponentDefinition        Dim oTransGeom As TransientGeometry    Set oTransGeom = ThisApplication.TransientGeometry        Dim oSketch As PlanarSketch    Set oSketch = oSheetMetalCompDef.Sketches.Add(oSheetMetalCompDef.WorkPlane s.Item(3))    Dim oRectangleLines As SketchEntitiesEnumerator    Set oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle(oTransGeom.Create Point2d(0, 0), oTransGeom.CreatePoint2d(100, 50))        Dim oProfile As Profile    Set oProfile = oSketch.Profiles.AddForSolid            'Call oPartDoc.ComponentDefinition.Features.ExtrudeFeatures.AddByD istanceExtent(oProfile, 1, kPositiveExtentDirection, kJoinOperation)    'Call oPartDoc.ComponentDefinition.Features.ExtrudeFeatures.AddByD istanceExtent(oProfile, 1, kPositiveExtentDirection, kIntersectOperation)    End Sub