Revit.SDK.Samples.ObjectViewer.CS.GeometryData.AddInstance C# (CSharp) Method

AddInstance() private method

generate data of a Instance
private AddInstance ( GeometryObject obj, Transform transform ) : void
obj GeometryObject
transform Transform
return void
        private void AddInstance(GeometryObject obj, Transform transform)
        {
            GeometryInstance instance = obj as GeometryInstance;
            if (null == instance)
            {
                return;
            }
            //get a transformation of the affine 3-space
            Transform allTransform = AddTransform(transform, instance.Transform);

            GeometryElement instanceGeometry = instance.SymbolGeometry;
            if (null == instanceGeometry)
            {
                return;
            }
            //get all geometric primitives contained in the GeometryElement
            GeometryObjectArray instanceGeometries = instanceGeometry.Objects;
            AddGeometryObjects(instanceGeometries, allTransform);
        }