C# wpf application using helixtoolkit (Importing stp file)

131 Views Asked by At

Need support on this

    private void LoadSTPModel()
    {
        var stpPath = "fileName.stp";
        if (File.Exists(stpPath))
        {
            try
            {
                var reader = new StLReader();
                var model3D = reader.Read(stpPath);
                var modelVisual3D = new ModelVisual3D
                {
                        Content = model3D};
helixViewport.Children.Add(modelVisual3D);                     
                if (helixViewport.Children.Count == 0)
                {
                    MessageBox.Show("ModelVisual3D not added to the viewport.");
                }

                Console.WriteLine();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error loading STP model: {ex.Message}\n\n{ex.StackTrace}");
            }
        }
    }

The .stp file is not displayed, am I missing something?The other 3d object like creating on the code itself is working fine, but while importing .stp file.

0

There are 0 best solutions below