Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComponentDefinition#save_copy changes the guid if #path is not empty #1019

Open
Whaat opened this issue Dec 9, 2024 · 3 comments
Open

ComponentDefinition#save_copy changes the guid if #path is not empty #1019

Whaat opened this issue Dec 9, 2024 · 3 comments

Comments

@Whaat
Copy link

Whaat commented Dec 9, 2024

This feels like a bug - was definitely a surprising discovery. Firstly, I was surprised that ComponentDefinition#save_as modifies the guid until I realized that it changes the path associated with the component. OK fine, I guess this makes some sense.

But why would calling save_copy also change the guid? (But only for components that have an associated path set)

SketchUp 2024 24.0.579 Windows

To reproduce, select a component (eg. Teddy) in the model using the Select Tool. Then run:

path = File.join(Sketchup.temp_dir, "test.skp")
defn = Sketchup.active_model.selection.first.definition
puts defn.guid
puts defn.path
defn.save_copy(path)
puts defn.guid
puts defn.path

If you run the above snippet when selecting a component with no associated path, the guid will NOT change.

@thomthom
Copy link
Member

But why would calling save_copy also change the guid? (But only for components that have an associated path set)

That doesn't sound right to me either. 🤔

@Eneroth3
Copy link

Eneroth3 commented Dec 10, 2024 via email

@sketchup
Copy link

sketchup bot commented Dec 16, 2024

Logged as: SKEXT-4436

@sketchup sketchup bot added the logged label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants