08-07-2022
10:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-07-2022
10:53 AM
Thank you for your detailed answer.
I've created some "Frankenstein's Monster" that consists of different pieces of code and I can`t place sketch on plane what I piked, only on WorkPlanes.Item(1)
filename="F:\Work\DesingsHome\iLogic Rules\BOM\01.01.01-02 Деталь.ipt" PartDoc=ThisApplication.Documents.Open(filename,False) PartcompDef=PartDoc.ComponentDefinition ExtFeature=PartcompDef.Features.ExtrudeFeatures.item(1) Dim ExtDef As ExtrudeDefinition = ExtFeature.Definition ExtProfile=ExtDef.Profile Dim osketch As PlanarSketch oSketchToCopy=ExtFeature.Definition.Profile.Parent ThisDoc.Document.Activate Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oPlane As WorkPlane '-my additional WorkPlane for sketch oPlane = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter, "") '-pick the WorkPlane Dim Sketch2 As PlanarSketch Sketch2 = oDoc.ComponentDefinition.Sketches.Add(oDoc.ComponentDefinition.WorkPlanes.Item(1),False) 'Sketch2 = oDoc.ComponentDefinition.Sketches.Add(oDoc.ComponentDefinition.oPlane) '-here I tried to place sketch in WorkPlane but I didn't find the wright way to do it
oSketchToCopy.CopyContentsTo(Sketch2)