Message 1 of 2
Trying to project 3Dsketch lines on to a 2D sketch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
I am trying to project singular 3Dsketches on to a 2D sketch.
I am creating the sketch through iLogic and I was trying to use the
AddByProjectingEntity function but i could not get that to work.
here is the code I currently have.
' Get the current document and its component definition Dim oDoc As PartDocument = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition Dim NODE_COUNT As Integer = GoExcel.CellValue(EXCEL, Excel_Sheet_Name, Node_Count_Excel_Cell) Dim ROW_COUNT As Integer = 0 Dim oNode As String ROW_NUMBER = 5 Do Until ROW_COUNT = NODE_COUNT oNode = GoExcel.CellValue(EXCEL, Excel_Sheet_Name, "C" & ROW_NUMBER) Dim oWorkPlane As WorkPlane = oCompDef.WorkPlanes.Item(oNode & ": XY Plane") ' Add a new sketch to the selected work plane Dim oSketch As PlanarSketch Try oSketch = oCompDef.Sketches.Item(oNode & " Sketch") oSketch.Delete Catch End Try oSketch = oCompDef.Sketches.Add(oWorkPlane) ' Optionally, you can give the new sketch a name oSketch.Name = oNode & " Sketch" ' oSketch.Edit ' oSketch.AddByProjectingEntity("NR1_01 UCS_WP") ' oSketch.ExitEdit ROW_COUNT = ROW_COUNT + 1 ROW_NUMBER = ROW_NUMBER + 1 Loop
As you can see I've commented out the AddByProjectingEntity as It would not let me do that.
the name in the parentheses is the name of a workplane that does intersect with this sketch plane.
If someone has a good solution or tips for how I can solve this I'd appreciate that a lot.
The