Say we have a named selection containing vertices, and we want to automatically define body to ground springs using scripting?
Below is a script that can do that (it assumes we have a named sel. containing all vertices). dir = 1 # direcion of spring : x=0,y=1,z=2 offset=0.1 # offset for ground point Lst=100 # Strength model = ExtAPI.DataModel.Project.Model analysis=model.Analyses[0] ns=DataModel.GetObjectsByName('Selection')[0] # chnage as needed con=model.AddConnections() nId=ns.Location.Ids for ver in nId: v = ExtAPI.DataModel.GeoData.GeoEntityById(ver) xx=v.X yy=v.Y zz=v.Z spring=con.AddSpring() spring.LongitudinalStiffness=Quantity(Lst, "N/m") spring.Scope = SpringScopingType.BodyToGround ExtAPI.SelectionManager.ClearSelection() selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) selection.Ids = [ver] spring.MobileAppliedBy=RemoteApplicationType.DirectAttachment spring.MobileScopeLocation = selection if dir==0: spring.ReferenceXCoordinate = Quantity(xx+offset, "m") spring.ReferenceYCoordinate = Quantity(yy, "m") spring.ReferenceZCoordinate = Quantity(zz, "m") elif dir==1: spring.ReferenceXCoordinate = Quantity(xx, "m") spring.ReferenceYCoordinate = Quantity(yy+offset, "m") spring.ReferenceZCoordinate = Quantity(zz, "m") else: spring.ReferenceXCoordinate = Quantity(xx, "m") spring.ReferenceYCoordinate = Quantity(yy, "m") spring.ReferenceZCoordinate = Quantity(zz+offset, "m")