Elements
Elements copied to clipboard
AddProfiles to Model
Make model.AddProfiles a public method. Currently using reflection to invoke the private method.
Can you explain the use case? Profiles are only added as necessary when elements are being added to the model. Allowing the user to add profiles would mean you could pack your model full of profiles without any associated elements. Another way of thinking about this is that profiles have no meaning except as they are used to define geometry for elements. But perhaps you're using them in an interesting and unintended way. Tell me more!
I am currently using profiles to give perspective on the elements I create as part of the Model(). Lets say I create a model made up of Element.Mass I want to add a simple profile into the Model that depicts the site boundary. A work around could be to create a floor for the boundary, but being able to render individual profiles would be ideal.
I see. You want to be able to render arbitrary curves. I think we need to make something akin to a Model Curve in Revit. That is, an element, which can just contain curves. It's possible that you could use a profile to construct a model curve. I can't really think of a better name than ModelCurve
. Sound about right?
Perfect!
public class ModelCurve : Element, ICurveProvider
{
public ICurve Curve{get;}
public ModelCurve(ICurve curve)
{
this.Curve = curve;
}
}
And while we're at it, I'd add ModelPoint
as well. This would allow users to represent both curves and points as elements, with properties, etc.
public class ModelPoint : Element, IPointProvider
{
public Vector3 Point{get;}
public ModelPoint(Vector3 point)
{
this.Point = point;
}
}
subscribing to this as we're still using reflection for now.
ModelCurve
and ModelPoints
were added a LONG time ago and I believe address this issue.