Message 1 of 3
Not applicable
02-26-2019
12:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I have an ilogic script which export my part to a STEP file. Which works great by the way. The problem is that when I order the parts, to be made by a laser cutter for example, the diameter of the coutersunk holes are lasered according to the largest diameter of the hole. Is there a way to suppress countersunk holes when exporting? Or even better, change them to a regular hole with the same diameter? I do the same with chamfer features and that works but I don't know how to separtate a normal hole from an countersunk hole.
Thanks in advance!
Below the ilogic rule I currently use for exporting the stp file
'Set path
oJaar = "20" & Left(ThisDoc.FileName(False), 2)
oPath = "\\10.135.4.60\dxf-pdf\" & oJaar & "\" & Left(ThisDoc.FileName(False), 6) & "\" & Mid(ThisDoc.FileName(False), 7,3) & "\"
'Open document
curDoc = ThisDrawing.Sheet("sheet:1").View("VIEW1").ModelDocument
If curDoc.DocumentType = kPartDocumentObject Then
oDoc = ThisApplication.Documents.Open(curDoc.FullFileName, True)
oCompDef = oDoc.ComponentDefinition
'Supress all chamfers
Dim oEachF As PartFeature
'iterare each feature
For Each oEachF In oCompDef.Features
'if it is a chamfer or fillet
If TypeOf oEachF Is ChamferFeature Or TypeOf oEachF Is FilletFeature Then
'suppress it
oEachF.Suppressed = True
End If
Next
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
' Set application protocol.
' 2 = AP 203 - Configuration Controlled Design
' 3 = AP 214 - Automotive Design
oOptions.Value("ApplicationProtocolType") = 3
' Other options...
oOptions.Value("Author") = iProperties.Value("Summary", "Author")
'oOptions.Value("Authorization") = ""
oOptions.Value("Description") = iProperties.Value("Project", "Part Number") & " " & iProperties.Value("Project", "Description")
oOptions.Value("Organization") = "Madolex-Somatech"
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium
'Set the Step target file name with revision
' If iProperties.Value("Project", "Revision Number") >"0" Then
' oName= ThisDoc.FileName(False)& "-REV_" & iProperties.Value("Project", "Revision Number")
' Else
' oName = ThisDoc.FileName(False)
' End If
'Set the Step target file name without revision
oName = ThisDoc.FileName(False)
'Export Step
oData.FileName = oPath & oName & ".stp"
oPath2= oData.FileName
oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
End If
'Unsupress all chamfers
For Each oEachF In oCompDef.Features
'if it is a chamfer or fillet
If TypeOf oEachF Is ChamferFeature Or TypeOf oEachF Is FilletFeature Then
'suppress it
oEachF.Suppressed = False
End If
Next
ThisApplication.ActiveDocument.Close
End If
Solved! Go to Solution.

