Hello,
Can you expose C# APIs that relate to properties exposed to users (like piping properties, displacement properties, etc…)
Thank you,
jmv.
Hello,
Can you expose C# APIs that relate to properties exposed to users (like piping properties, displacement properties, etc…)
Thank you,
jmv.
using System;
using System.Reflection;
using Rhino;
using Rhino.Geometry;
using Rhino.DocObjects;
class Proxy_CurvePipingObjectParameters
{
static Type t_DisplacementDynamicAccess;
static MethodInfo t_DisplacementDynamicAccess_CurvePipingParameters;
static Type t_CurvePipingParameters;
static MethodInfo t_CurvePipingParameters_GetCurvePipingObjectParameters;
static PropertyInfo t_On;
static PropertyInfo t_Radius;
static PropertyInfo t_Segments;
static PropertyInfo t_Accuracy;
static PropertyInfo t_Weld;
static PropertyInfo t_CapType;
static Proxy_CurvePipingObjectParameters ()
{
var ass = typeof (Rhino.RhinoApp).Assembly;
t_DisplacementDynamicAccess = ass.GetType ("DisplacementDynamicAccess", throwOnError: true, ignoreCase: false);
t_DisplacementDynamicAccess_CurvePipingParameters = t_DisplacementDynamicAccess.GetMethod ("CurvePipingParameters");
t_CurvePipingParameters = ass.GetType ("CurvePipingParameters", throwOnError: true, ignoreCase: false);
t_CurvePipingParameters_GetCurvePipingObjectParameters = t_CurvePipingParameters.GetMethod ("GetCurvePipingObjectParameters");
var t_CurvePipingObjectParameters = ass.GetType ("CurvePipingObjectParameters", throwOnError: true, ignoreCase: false);
t_On = t_CurvePipingObjectParameters.GetProperty ("On");
t_Radius = t_CurvePipingObjectParameters.GetProperty ("Radius");
t_Segments = t_CurvePipingObjectParameters.GetProperty ("Segments");
t_Accuracy = t_CurvePipingObjectParameters.GetProperty ("Accuracy");
t_Weld = t_CurvePipingObjectParameters.GetProperty ("Weld");
t_CapType = t_CurvePipingObjectParameters.GetProperty ("CapType");
}
public static Proxy_CurvePipingObjectParameters From (Guid id)
{
var obj = RhinoDoc.ActiveDoc.Objects.FindId (id);
return From (obj);
}
public static Proxy_CurvePipingObjectParameters From (RhinoObject obj)
{
// var access = new DisplacementDynamicAccess ();
// var parameters = access.CurvePipingParameters (RhinoDoc.ActiveDoc.RuntimeSerialNumber)
// var piping = parameters.GetCurvePipingObjectParameters (obj)
var access = Activator.CreateInstance (t_DisplacementDynamicAccess);
var parameters = t_DisplacementDynamicAccess_CurvePipingParameters.Invoke (access, new object[] { RhinoDoc.ActiveDoc.RuntimeSerialNumber });
return new Proxy_CurvePipingObjectParameters (t_CurvePipingParameters_GetCurvePipingObjectParameters.Invoke (parameters, new object[] { obj }));
}
object m_instance;
Proxy_CurvePipingObjectParameters (object instance)
{
m_instance = instance;
}
public bool On
{
get {
return (bool)t_On.GetValue (m_instance);
}
}
public double Radius
{
get {
return (double)t_Radius.GetValue (m_instance);
}
}
...
}