public override void CreateAttributes() { //base.CreateAttributes(); //List<IGH_Attributes> attr = new List<IGH_Attributes>() { new Attributes_Custom(this) }; //base.Attributes.AppendToAttributeTree(attr); m_attributes = new Attributes_Custom(this); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { List <Point3d> ghPoints = new List <Point3d>(); Vector3d transSprints = new Vector3d(0, 0, 0); Vector3d rotSprints = new Vector3d(0, 0, 0); //TODO planes Not Implemented //Plane locPlane = Plane.WorldXY; DA.GetDataList(0, ghPoints); DA.GetData(1, ref transSprints); DA.GetData(2, ref rotSprints); //TODO Planes not implemented yet. //DA.GetData(3, ref locPlane); Attributes_Custom ca = m_attributes as Attributes_Custom; NodalSupport support = new NodalSupport(); if (!ca.SelectedButtons[0]) { support.SupportConstantX = transSprints.X * 1000; } else { support.SupportConstantX = -1; } if (!ca.SelectedButtons[1]) { support.SupportConstantY = transSprints.Y * 1000; } else { support.SupportConstantY = -1; } if (!ca.SelectedButtons[2]) { support.SupportConstantZ = transSprints.Z * 1000; } else { support.SupportConstantZ = -1; } if (!ca.SelectedButtons[3]) { support.RestraintConstantX = rotSprints.X * 1000; } else { support.RestraintConstantX = -1; } if (!ca.SelectedButtons[4]) { support.RestraintConstantY = rotSprints.Y * 1000; } else { support.RestraintConstantY = -1; } if (!ca.SelectedButtons[5]) { support.RestraintConstantZ = rotSprints.Z * 1000; } else { support.RestraintConstantZ = -1; } //support.UserDefinedReferenceSystem SupportInf container = new SupportInf(ghPoints, support); DA.SetData(0, new GH_ObjectWrapper(container)); }