SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
38 stars 10 forks source link

Unable to save active section plane to a scene using the SketchUp C API #1015

Open Whaat opened 1 week ago

Whaat commented 1 week ago

Using current version of SketchUp C API as of today (Nov 25, 2024). SDK_WIN_x64_2024-0-594 - Windows 11

It does not seem possible to save the active section plane to a scene using the C API. I have tried doing it multiple ways (order of operations) and it never works so I suspect a bug.

I HAVE been able to save camera properties to a scene using the C API but using a similar approach does not work when saving an active section to a scene.

The test program is a simple modification of one of the sample projects 'WritingToAskpFile'.

In my test program, I create two section cuts and two scenes. The expected result is that one scene will have an active cut and the other scene will have the other active cut.

But the actual result is that both scenes have NO active section cut. The sections are created but are not made active when the scene is activated.

See attached main.cpp which is a simple modification to the sample project 'WritingToAskpFile'. You should be able to recreate by opening the sample project and replacing main.cpp with the attached version.

The output skp created is called 'new_model.skp'. Inspect this file after running the program to see the results which will show that when clicking on scene, there is no active section cut.

image

This bug is a problem for me because I am working on a feature to export components as individual SKP files and then automatically add section cuts / scenes to the SKP using the C API so I can then reference these SKP files / models in a Layout Document that is generated using the Layout Ruby API. This bug is preventing me from being able to implement this feature.

main.zip

sketchup[bot] commented 1 day ago

Logged as: SKEXT-4414