Hi Volvick,
You should always use one of NStyle.SetStyle static methods for setting the style of any element! These methods automatically check if the Style of the given element is null and create it if it is. In this way you will never have a null reference exception when setting one of the styles of an element but you forget to check if its Style property is null. The following is a simple example:
NRectanglePath rectPath = new NRectanglePath(300, 300, 100, 100);
// Always use one of the NStyle.SetStyle methods for setting the style of any element!
NStyle.SetFillStyle(rectPath, new NColorFillStyle(KnownArgbColorValue.Red));
NCompositeShape shape = new NCompositeShape();
shape.Primitives.AddChild(rectPath);
document.ActiveLayer.AddChild(shape);
Best Regards,
Nevron Support Team