Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have an ilogic rule that creates a sweep. But there is a problem when it is executed several times, a bunch of sketches are created. How to do a test I would check if a sketch was created and would give an error if there is one.
' a reference to the currently active document. ' This assumes that it is a part document. Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument ' a reference to the component definition. Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition Dim oPartDef As PartComponentDefinition oPartDef = oPartDoc.ComponentDefinition 'a reference to the transient geometry object. Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry 'Create a sketch containing a circle. oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes("Плоскость XY")) oSketch.Name = "Профиль трубы" oOrigin = oSketch.SketchCircles.AddByCenterRadius(oTG.CreatePoint2d(0, 0), ((D_/10)/2)) oOrigin2 = oSketch.SketchCircles.AddByCenterRadius(oTG.CreatePoint2d(0, 0), ((Dy / 10) / 2)) 'Create a profile. Dim oProfile As Profile oProfile = oSketch.Profiles.AddForSolid Dim oSketch2 As Sketch3D = oCompDef.Sketches3D.Item("3D эскиз1") Dim oPath As Path = oCompDef.Features.CreatePath(oSketch2.SketchLines3D(1)) ' Create the sweep feature. Dim oSweep As SweepFeature oSweep = oCompDef.Features.SweepFeatures.AddUsingPath _ (oProfile, oPath, kJoinOperation)
Находите сообщения полезными? Поставьте Нравится (Like) этим сообщениям!
На ваш вопрос успешно ответили? Нажмите кнопку 'Утвердить решение'
Рогов Сергей/ Rogov Sergey
Инженер-конструктор
Solved! Go to Solution.