Export Sketch as DXF using iLogic

Export Sketch as DXF using iLogic

Anonymous
Not applicable
1,743 Views
3 Replies
Message 1 of 4

Export Sketch as DXF using iLogic

Anonymous
Not applicable

Hello,

I have a Sketch (Skizze) at Assembly level and I would like to export the sketch as .dxf file using iLogic. 

The iLogic snippet,"Export DXF from IDW" which has an DXFAddIn.SaveCopyAs can not be used because I do not have any drawing sheets.

Bild.PNG

 

 

 

 

 

 

 

 

 

 

(Please excuse me as the picture is in German)

Any ideas or suggestions are much appreciated.

Thank you,

Yatish.

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

mcgyvr
Consultant
Consultant
Accepted solution

How about this.. Simply exports the first sketch to the C:\Temp folder

     AssyDoc = ThisApplication.ActiveDocument

     ' Get the first sketch in the assembly.

     Dim sketch As PlanarSketch

     sketch = AssyDoc.ComponentDefinition.Sketches.Item(1)

     ' Write the sketch out as DXF.

     Call sketch.DataIO.WriteDataToFile("DXF", "C:\Temp\Sketch1.dxf")
	 MessageBox.Show("Sketch Created", "Sketch Creation Notification")

  



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 4

JelteDeJong
Mentor
Mentor
Accepted solution

You can try this.

Dim fileName As String = "c:\temp\Skizze.dxf"
Dim doc As AssemblyDocument = ThisDoc.Document
Dim sketch As PlanarSketch = doc.ComponentDefinition.Sketches.Item("Skizze")

Dim sOut As String = "DXF"
sketch.DataIO.WriteDataToFile(sOut, fileName)

 

Edit:

i didnt see the solution by @mcgyvr when i replyed but it is the same as mine

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 4

Anonymous
Not applicable

@mcgyvr Thank you. The Solution has worked. 

0 Likes