Message 1 of 3

Not applicable
04-14-2015
04:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have some problem with ILogic. I'm trying to do some rule to generate .dxf files of flat pattern form each sheet metal parts. I have rule that works in single part document but i cant create it for assembly.
I would like to run this rule manually when i finish each project. And i want to all those .dxf be in one folder called "DXF" just like my rule.
Here goes my code for single .ipt
i = MessageBox.Show("Czy chcesz zapisać rozwinięcie blachy?", "Zapis .dxf", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If (i=6) Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument ''ThisDoc.Launch(ThisDoc.PathAndFileName(True)) Dim oCompDef As SheetMetalComponentDefinition oCompDef = oDoc.ComponentDefinition If oCompDef.HasFlatPattern = False Then oCompDef.Unfold Else oCompDef.FlatPattern.Edit End If Dim sOut As String sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" Dim sFname As String sFname = ThisDoc.FileName(False) 'sFname = Left$(sFname, Len(sFname)-4) & ".dxf" oPath = ThisDoc.Path oFolder = oPath & "\" & "DXF" If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If sciezka = oFolder & "\" & sFname & ".dxf" oCompDef.DataIO.WriteDataToFile( sOut, sciezka) oCompDef.FlatPattern.ExitEdit ''ThisDoc.Document.Close End If
It works great for me.
Can someone can help me with this?
Solved! Go to Solution.