- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Since my original post I have approached this at a different angle. In place of creating a dxf file of the idw we are currently creating dxf's from the part files. We do this 2 different ways (depending on who needs it). We have an assembly level iLogic rule that basically opens all parts and if there is a flat pattern then it exports the dxf to a network drive and names it the same as the part file name. The only issue that one has is if you have been in Inventor for a period of time then I am assuming the cache fills and causes Inventor to crash. Once the software is restarted it runs perfectly. Our internal dxfs are fine for our programmers. The other is a macro with a button on the ribbon that we fire when needed at the sheet metal part level. We typically use this method for vendor dxf files.
Our vendor has again requested a change and I cannot figure out how to do what they want. I am reaching out to the community for help. I will attach our current macro code which is fired by a custom button placed on the ribbon. I will also attach 2 dxf files, 1 from ACAD (the old way), and 1 from Inventor (the new way). The vendor has asked us to remove all internal circles (holes) and just leave the center point. They state that they have to open all dxfs and manually delete all this geometry prior to importing it into their CAM software. The way we capture this now in ACAD is a question is asked during the dxf creation via lisp what the largest hole dia to be drilled is. The routine then places a center mark on all holes with a diameter equal to or smaller that value. For simplicity this could be a static value of 1 1/8" dia. All help will be appreciated.
Jason Mayes
Sub VendorExportDXF()
'config
'Change values located here to change output.
Dim strPath As String
strPath = "R:\email\" 'Must end with a "\"
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2004" _
+ "&OuterProfileLayer=OUTER_PROF&OuterProfileLayerColor=255;165;0" _
+ "&InteriorProfilesLayer=INNER_PROFS&InteriorProfilesLayerColor=124;252;0" _
+ "&FeatureProfileLayer=FEATURE&FeatureProfileLayerColor=255;0;255" _
+ "&ArcCentersLayer=CENTERS&ArcCentersLayerColor=135;206;235" _
+ "&IV_Arc_Centers&InvisibleLayers=IV_Tangent;IV_Bend;IV_Bend_Down;IV_Bend_Up&IV_Arc_Centers&InvisibleLayersColor=135;206;235"
'/config
Dim oPartDoc As Document
Set oPartDoc = ThisApplication.ActiveDocument
Dim oFlatPattern As FlatPattern
'Pre-processing check:
' The Active document must be a Sheet metal Part with a flat pattern
If oPartDoc.DocumentType <> kPartDocumentObject Then
MsgBox "The Active document must be a 'Part'"
Exit Sub
Else
If oPartDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
MsgBox "The Active document must be a 'Sheet Metal Part'"
Exit Sub
Else
Set oFlatPattern = oPartDoc.ComponentDefinition.FlatPattern
If oFlatPattern Is Nothing Then
MsgBox "Please create the flat pattern"
Exit Sub
End If
End If
End If
'Processing:
Dim oDataIO As DataIO
Set oDataIO = oPartDoc.ComponentDefinition.DataIO
Dim strPartNum As String
strPartNum = oPartDoc.PropertySets("Design Tracking Properties").Item("Part Number").Value
Dim strRev As String
strRev = oPartDoc.PropertySets("Inventor Summary Information").Item("Revision Number").Value
Dim oDXFfileNAME As String
oDXFfileNAME = strPath & strPartNum & ".dxf"
Call oDataIO.WriteDataToFile(sOut, oDXFfileNAME)
MsgBox "DXF has been created in R:\email"
'Toggle this on/off to open output folder during output.
'Call Shell("explorer.exe" & " " & strPath, vbNormalFocus)
End Sub