Imports System Imports NXOpen Imports NXOpen.UF Imports NXOpen.Selection Imports NXOpen.Features Module create_associative_circle Dim sess As Session = Session.GetSession() Dim wp As Part = sess.Parts.Work Dim sm As Selection = UI.GetUI.SelectionManager Sub Main() Dim dpl As DatumPlane = sel_dplane() If dpl Is Nothing Then Exit Sub Dim udm As Session.UndoMarkId = sess.SetUndoMark(Session.MarkVisibility.Visible, "Circle") Dim aab As AssociativeArcBuilder = wp.BaseFeatures.CreateAssociativeArcBuilder(Nothing) Dim pl As Plane = wp.Planes.CreatePlane(dpl.Origin, dpl.Normal, SmartObject.UpdateOption.WithinModeling) pl.SetMethod(PlaneTypes.MethodType.Distance) Dim pl_geom() As NXObject = {dpl} pl.SetGeometry(pl_geom) aab.Associative = True aab.Type = AssociativeArcBuilder.Types.ArcFromCenter aab.SupportPlaneData.SupportPlane = pl Dim cp As Point = wp.Points.CreatePoint(pl.Origin) aab.CenterPoint.Value = cp aab.Limits.FullCircle = True aab.EndPointOptions = AssociativeArcBuilder.EndOption.Radius aab.Radius.RightHandSide = "75" Dim arc_obj As NXObject = aab.Commit() aab.Destroy() End Sub Private Function sel_dplane() As DatumPlane Dim mess As String = "Select Datum Plane" Dim title As String = "Select a Datum Plane" Dim scope As SelectionScope = SelectionScope.AnyInAssembly Dim action As SelectionAction = SelectionAction.ClearAndEnableSpecific Dim incl_feat As Boolean = True Dim keep_hl As Boolean = False Dim mask(0) As MaskTriple Dim obj As NXObject = Nothing Dim cursor As Point3d Dim sel_resp As Response mask(0).Type = UFConstants.UF_datum_plane_type mask(0).Subtype = UFConstants.UF_datum_object_subtype sel_resp = sm.SelectObject(mess, title, scope, action, incl_feat, keep_hl, mask, obj, cursor) If sel_resp < 4 Then Return Nothing Return CType(obj, DatumPlane) End Function End Module