Cant Copy Sketch in Sheet Metal Environment

Cant Copy Sketch in Sheet Metal Environment

Anonymous
Not applicable
469 Views
3 Replies
Message 1 of 4

Cant Copy Sketch in Sheet Metal Environment

Anonymous
Not applicable

I am working in Sheet Metal Environment. I wish create a new sketch copy copying contents of existing FaceFeature and then suppress the FaceFeature.

 

I tried two methods:

  1. Creating a new workplane by giving PlanarEntity of FaceFeature's sketch and then copy contents from facefeature->sketch to the new sketch. This works but then it appears that it keeps some kind of association. SO, when I suppress the FaceFeature, this new feature created using new sketch also gets suppressed.
  2. Creating workplane using new workpoints by giving workpoints created using 3 facefeature-sketch's points. Workplane is created fine, but it errors at the sketch creation. Don't know why? As the attached picture shows, the new workplane as decent data.

 

CantCopySketch.png

 

Any clues?

 

I just wish to create a brand new sketch using existing sketch, but without any association (i.e. Deep copy and not shallow copy).

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

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

Both ways seems to work for me in Inventor 2016.

And when I select the PlanarEntity of the sketch to create the new sketch there is no dependency.

 

I select Sketch1 and run this VBA code:

Sub CopySketch()
  Dim pd As PartDocument
  Set pd = ThisApplication.ActiveDocument

  Dim scd As SheetMetalComponentDefinition
  Set scd = pd.ComponentDefinition

  Dim sk As PlanarSketch
  Set sk = pd.SelectSet(1)
  
  Dim sk2 As PlanarSketch
  Set sk2 = scd.Sketches.Add(sk.PlanarEntity)
  
  Call sk.CopyContentsTo(sk2)
End Sub

And I get this where I can suppress the face feature without affecting the new sketch:

CopySketch.png

 

Could you provide a non-confidential part file to reproduce the behaviour?

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 4

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

There is some confusion here. It's not the FaceFeature you have issues with, it's the ContourFlange and because its sketch is based on the face geometry created by the FaceFeature:

SketchIssue1.png

 

As you can see when I suppress the Face feature the copied sketch and the extrusion based on that is working fine:

SketchIssue2.png

 

Sketch8 is based on Sketch1 which is dependent on a global workplane >> no issues with suppressing anything, but Sketch9 is based on Sketch2 which is dependent (because of its PlanarEntity) on face geometry, so of course it will get suppressed when the Face is suppressed.

 

I hope this explains.

 



Adam Nagy
Autodesk Platform Services
Message 4 of 4

Anonymous
Not applicable

You are right. Taking hint from your answer, I created a workplane using face information, then the dependency got borken.

 

        Private Function GetWorkPlane(planeorig As Object) As WorkPlane
            GetWorkPlane = Nothing
            If TypeOf planeorig Is Inventor.Face Then
                Dim fc As Face = planeorig
                Dim pt1 As Inventor.Point = fc.Vertices.Item(1).Point
                Dim pt2 As Inventor.Point = fc.Vertices.Item(2).Point
                Dim pt3 As Inventor.Point = fc.Vertices.Item(3).Point
                Dim wpt1 As WorkPoint = m_compDef.WorkPoints.AddFixed(pt1, True)
                Dim wpt2 As WorkPoint = m_compDef.WorkPoints.AddFixed(pt2, True)
                Dim wpt3 As WorkPoint = m_compDef.WorkPoints.AddFixed(pt3, True)
                GetWorkPlane = m_compDef.WorkPlanes.AddByThreePoints(wpt1, wpt2, wpt3, True)
            ElseIf TypeOf planeorig Is WorkPlane Then
                GetWorkPlane = m_compDef.WorkPlanes.AddByPlaneAndOffset(planeorig, 0.0, True)
            End If
        End Function

Seems to work fine. Thanks a lot.

0 Likes