Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to insert a DFX file into a sketch of a part file, Unfortunatly not everything in my DFX file appears.
I think some layers are missing or something.
Here is my DFX when i open it
Here is the result in the Part file
Code;
Dim oLaserTemplateLoc = "Partfile.ipt"
Dim oPart As PartDocument = ThisApplication.Documents.Open(oLaserTemplateLoc, True)
oPart.Activate
Dim oPCD As PartComponentDefinition = oPart.ComponentDefinition
Dim oDXFTranslator As TranslatorAddIn
oDXFTranslator = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
Dim oDataMedium As DataMedium
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
oDataMedium.FileName = "DFX Location"
Dim oTranslationContext As TranslationContext
oTranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oTranslationContext.Type = kFileBrowseIOMechanism
Dim oPlaneXZ As WorkPlane = oPCD.WorkPlanes.Item(2)
Dim oSketch As PlanarSketch
oSketch = oPCD.Sketches.Add(oPlaneXZ)
oSketch.Edit
oTranslationContext.OpenIntoExisting = oSketch
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Add ("FileUnits", "Millimeters")
Call oDXFTranslator.Open(oDataMedium, oTranslationContext, oOptions, oPart)
oSketch.ExitEdit
Solved! Go to Solution.