I made an extension for an ISimComponent, which adds an ICylinderGeometry to the given component. I want to dynamically set the radius and height (input parameters).
The Feature gets added to the components and the necessary properties get set, but visually the geometry properties are not correct. If i change a property by adding .0 to it, the cylinder visually updates. What do i need to chance to the code so that it visually is correct with the given parameters?
I tried Feature.Rebuild and component.Update, but neither works
— code —
public static ICylinderFeature AddCylinderGeometry(this ISimComponent component, int radius, int height)
{
ICylinderFeature cyl = component.RootNode.RootFeature.CreateFeature();
var heightProperty = cyl.Properties.FirstOrDefault(x => x.Name == “Height”);
heightProperty.Value = $“{height}”;
var rad = cyl.Properties.FirstOrDefault(x => x.Name == “Radius”);
rad.Value = $“{radius}”;
return cyl;
}