Hallo Inventor-Gemeinde,
ich habe ein Problem. Unser Fertigungsbetrieb benötigt von uns dxf-Dateien der Abwicklungen (Blechteile). Nun wollen wir das ganze automatisieren. Und zwar so dass die dxf-Datei den gleichen Namen erhalten und am gleichen Speicherort liegen wie die IPT-Dateien. Das habe ich auch vom Code her hinbekommen (Der Suchfunktion sei Dank). Ich habe folgenden Code als 'Modul' über das VBA eingebunden:
'The sample code below writes a sheet metal file out as DXF. DWG is also supported. There are several optional arguments that can be specified as part of the format string. Below are the names of these arguments and their default values. The output will use these values unless you override them as part of the input string.
'TangentLayer = "IV_TANGENT"
'BendLayer = "IV_BEND"
'ToolCenterLayer = "IV_TOOL_CENTER"
'ArcCentersLayer = "IV_ARC_CENTERS"
'OuterProfileLayer = "IV_OUTER_PROFILE"
'FeatureProfilesLayer = "IV_FEATURE_PROFILES"
'InteriorProfilesLayer = "IV_INTERIOR_PROFILES"
'AcadVersion = "2000" (Can be "R12", "R13", "R14", or "2000")
'The following sample demonstrates creating an R12 DXF file that will have a layer called "Outer" where the curves for the outer shape will be created.
Public Sub WriteSheetMetalDXF()
' Get the active document. This assumes it is a part document.
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
' Ermitteln des Standortes und des Names der IPT.
' Die Abwicklung (DXF-Datei) wird in den gleichen Pfad geschrieben, wo die IPT steht.
' Sie hat den gleichen Namen wie die IPT - nur die Extension ist .DXF .
sDisplayName = oDoc.DisplayName
sFullName = oDoc.FullFileName
sName = Left$(sDisplayName, Len(sDisplayName) - 4) + ".dxf"
sPath = Left$(sFullName, Len(sFullName) - Len(sDisplayName))
' Get the DataIO object.
Dim oDataIO As DataIO
Set oDataIO = oDoc.ComponentDefinition.DataIO
' Build the string that defines the format of the DXF file.
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2000&OuterProfileLayer=0&BendLayer=BIEGELINIE&TangentLayer=H&InteriorProfilesLayer=0&ToolCenterLayer=H&ArcCentersLayer=H&FeatureProfilesLayer=0"
' Create the DXF file.
'oDataIO.WriteDataToFile sOut, "c:\test.dxf"
oDataIO.WriteDataToFile sOut, sPath + sName
End Sub
Dieser wird von einer AutoSave Prozedur aufgerufen.
Aber...von da an ging es bergab
. Speicher ich das Ganze als Vorlage kann ich wenn ich über diese ein Blechteil erstellen will keine Laschen mehr erstellen. Es kommt die Fehlermeldung keine Biegezone gefunden.
Hat jemand eine Idee wie ich das Problem in den Griff bekommen kann? Ich stelle hierfür die Vorlagendatei ins Netz.
Für jede Hilfe bin ich echt riesig dankbar
.
Gruss Headde
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP