export sketch on a developed sheet metal with ilogic

export sketch on a developed sheet metal with ilogic

m.nake
Contributor Contributor
362 Views
1 Reply
Message 1 of 2

export sketch on a developed sheet metal with ilogic

m.nake
Contributor
Contributor

I put a sketch on a developed sheet metal part. It is controlled by "Project geometry" and differs somewhat from the developed sheet metal part. With the right mouse button on the sketch I can export it as .dxf.

Now I would like to have the whole thing done via ilogic, but I just can't get to this sketch.



my attempt with:
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition 
Dim oSketch As Sketch = oCD.Sketches.Item("Skizze_Abwicklung")
If oSketch Is Nothing Then Exit Sub
oDoc.SelectSet.Select(oSketch)

is dismissed with the error message "wrong parameter".

Even in an .idw, I cannot display this sketch in isolation.

Does somebody has any idea?

Thanks in advance!

 

Martin

 

Martin

 

 

0 Likes
363 Views
1 Reply
Reply (1)
Message 2 of 2

JhoelForshav
Mentor
Mentor

Hi @m.nake 

Is your sketch sketched on the flat pattern? If it is and it's the first sketch on the flat pattern, try this 🙂

Dim strPath As String = ThisDoc.Path & "\"
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oFlatPattern As FlatPattern = oPartDoc.ComponentDefinition.FlatPattern
oFlatPattern.Sketches(1).DataIO.WriteDataToFile("DXF", strPath & oPartDoc.PropertySets. _
Item("Design Tracking Properties").Item("Part Number").Value & "_FlatPatternSketch.dxf")

You can change how you want to name the sketch. In this case it will be saved in the same folder as the part with the name partnumber_FlatPatternSketch.dxf