Message 1 of 2
ilogic project part sketch into assembly sketch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to project a sketch from a part in an assembly to an assembly sketch. I have the below code started but get an undefined error, any help would be appreciated.
'Get the assembly component definition Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oMatrix As Matrix = oTG.CreateMatrix Dim oOccurrence As ComponentOccurrence Dim compOcc1 As ComponentOccurrence = oAsmCompDef.Occurrences.ItemByName("HANDHOLE RIM - J025938:1") ' Get the X-Y work plane.'Dim SketchPlane As Inventor.WorkPlane = compOcc1.WorkPlanes.Item(2) Dim SketchPlane As WorkPlane SketchPlane = compOcc1.Definition.WorkPlanes("XZ Plane") 'Create the proxy planes / points / axis Dim oproxySketchPlane As WorkPlaneProxy = Nothing compOcc1.CreateGeometryProxy(SketchPlane, oproxySketchPlane1) ' Create a new sketch. Dim oSketch1 As Inventor.PlanarSketch oSketch1 = oAsmCompDef.Sketches.Add(oproxySketchPlane1, False) oSketch1.Name = "aCutout" 'Sketch.Edit() 'Get Part sketch Dim oSketch2 As PlanarSketch = compOcc1.Definition.Sketches("CUTOUT") Call oSketch2.CopyContentsTo(oSketch1)