Reply
Solved! Go to solution

Etch on flat pattern

Hi again,

I use this code to etch what is in the given sketch, but I have a sketch i the flatten mode and I want the etch to be in the flatten part only. This works when done manually but with this code it creates the etch outside the flatten part in the ordered environment even if the sketch is in the flatten environment. Does anybody know how to do this?

    Sub Main()
        Dim objApp As SolidEdgeFramework.Application = Nothing
        Dim objDocs As SolidEdgeFramework.Documents = Nothing
        Dim ObjDocP As SolidEdgePart.SheetMetalDocument = Nothing
        Dim objPart As SolidEdgePart.PartDocument = Nothing
        Dim ObjSketchs As SolidEdgePart.Sketchs = Nothing
        Dim ObjSketch As SolidEdgePart.Sketch = Nothing
        Dim objModels As SolidEdgePart.Models
        Dim objModel As SolidEdgePart.Model
        Dim objetches As SolidEdgePart.Etches = Nothing
        Dim ObjEtch As SolidEdgePart.Etch = Nothing
        Dim objSelecSet As SolidEdgeFramework.SelectSet = Nothing
        Dim objProfileSets As SolidEdgePart.ProfileSets = Nothing
        Dim objProfileSet As SolidEdgePart.ProfileSet = Nothing
        Dim objProfiles As SolidEdgePart.Profiles = Nothing
        Dim objProfile As SolidEdgePart.Profile = Nothing
        Dim objRefplanes As SolidEdgePart.RefPlanes = Nothing
        Dim ObjRefPlane As SolidEdgePart.RefPlane = Nothing

        Try
            ObjSketchs = ObjDocP.Sketches
            ObjSketch = ObjSketchs.Item(1)
            objProfiles = ObjSketch.Profiles
            objProfile = objProfiles.Item(1)
            objModels = ObjDocP.Models
            objModel = objModels.Item(1)
            objetches = objModel.Etches
            ObjEtch = objetches.Add(objProfile)
            objSelecSet = objApp.ActiveSelectSet
            objSelecSet.RemoveAll()
            objSelecSet.Add(ObjEtch)
        Catch ex As Exception
        End Try
    End Sub

Thanks  , I know I ask a lot of questions but I think this can be useful for everyone

 

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.
1 REPLY
Solution
Solution
Accepted by topic author Pedneault75
‎08-26-2015 04:32 AM

Re: Etch on flat pattern

[ Edited ]

Hello Pedneault75,

Use the ObjModelP.FlatPatternModels instead of objModelP.Models to access the flattend Model.

 

 

Regards Jürgen

regards

JB
VS2015, SE ST10