Elements icon indicating copy to clipboard operation
Elements copied to clipboard

AddProfiles to Model

Open MarkThorley opened this issue 5 years ago • 6 comments

Make model.AddProfiles a public method. Currently using reflection to invoke the private method.

MarkThorley avatar Mar 11 '19 11:03 MarkThorley

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!

ikeough avatar Mar 19 '19 14:03 ikeough

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.

MarkThorley avatar Mar 20 '19 16:03 MarkThorley

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?

ikeough avatar Mar 20 '19 16:03 ikeough

Perfect!

MarkThorley avatar Mar 20 '19 16:03 MarkThorley

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;
  }
}

ikeough avatar Mar 20 '19 16:03 ikeough

subscribing to this as we're still using reflection for now.

radumg avatar Apr 10 '19 19:04 radumg

ModelCurve and ModelPoints were added a LONG time ago and I believe address this issue.

ikeough avatar Apr 14 '23 23:04 ikeough