private static void CRhinoGripObject_SetWeight(uint serial_number, double weight) { CustomGripObject grip = GetCustomObject(serial_number) as CustomGripObject; if (grip != null) { grip.Weight = weight; } }
private static double CRhinoGripObject_GetWeight(uint serial_number) { CustomGripObject grip = GetCustomObject(serial_number) as CustomGripObject; if (grip != null) { return(grip.Weight); } return(RhinoMath.UnsetValue); }
private static void CRhinoObject_Destructor(uint serial_number) { CustomGripObject grip = GetCustomObject(serial_number) as CustomGripObject; if (grip != null) { grip.m_pRhinoObject = IntPtr.Zero; GC.SuppressFinalize(grip); } }
static RhinoObject GetCustomObject(uint serial_number) { if (m_prev_found != null && m_prev_found.m_rhinoobject_serial_number == serial_number) { return(m_prev_found); } for (int i = 0; i < m_all_custom_grips.Count; i++) { if (m_all_custom_grips[i].m_rhinoobject_serial_number == serial_number) { m_prev_found = m_all_custom_grips[i]; return(m_prev_found); } } return(null); }
static RhinoObject GetCustomObject(uint serialNumber) { if (g_prev_found != null && g_prev_found.m_rhinoobject_serial_number == serialNumber) { return(g_prev_found); } foreach (CustomGripObject grip in g_all_custom_grips) { if (grip.m_rhinoobject_serial_number == serialNumber) { g_prev_found = grip; return(g_prev_found); } } return(null); }
static RhinoObject GetCustomObject(uint serial_number) { if (m_prev_found != null && m_prev_found.m_rhinoobject_serial_number == serial_number) return m_prev_found; for (int i = 0; i < m_all_custom_grips.Count; i++) { if (m_all_custom_grips[i].m_rhinoobject_serial_number == serial_number) { m_prev_found = m_all_custom_grips[i]; return m_prev_found; } } return null; }