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

Layout Ruby API is missing the Update Model Reference feature #590

Open
MrPaulch opened this issue Dec 21, 2020 · 6 comments
Open

Layout Ruby API is missing the Update Model Reference feature #590

MrPaulch opened this issue Dec 21, 2020 · 6 comments
Labels

Comments

@MrPaulch
Copy link

Use Case

A SketchUp Extension wants to modify a SketchUp file which is referenced by a Layout file.
The Layout Document needs to be told to update it's SketchUpModel Entities.
After that a PDF Export of the updated Layout file is performed.

Missing Feature

To update the SketchUpModel references in the Layout Document currently there is no option to perform a "Update Model References" like there is in the UI.

Example function names

Layout::SketchUpModel.update_model_references
and
Layout::SketchUpModel.relink_model_references

Current Workaround

A Workaround to this is to remove the SketchUpModel Entity and to insert it again.

However that workaround is buggy as described in this bug report

@DanRathbun
Copy link

I thought sure that this was mentioned before and logged, but I cannot find it.

@thomthom
Copy link
Member

thomthom commented Jan 4, 2021

Sounds like a duplicate of #324 (do I read this correctly?)

@MrPaulch
Copy link
Author

MrPaulch commented Jan 7, 2021

Sounds like a duplicate of #324 (do I read this correctly?)

They are not necessarily related.

The mentioned issue talks about the path. Which is only tangentially relevant here.

The update_model_reference would only perform the same task as the same-named context menu entry in Layout when right clicking on a SketchUpModel Entity. Meaning, if there were changes in the original SketchUp file, they are reflected in it's representation in the Layout Document.
Of course the path to the original SketchUp file is necessary for this task (internally) but not for the consumer of the API.

(I would not resist having the path attribute exposed, even though it would not help this issue.)

Currently the only way to programmatically update a SketchUpModel Entity in Layout is to remove it and instantiate it. And as mentioned, the procedure is bugged.

@DanRathbun
Copy link

(I would not resist having the path attribute exposed, even though it would not help this issue.)

I would myself prefer dedicated method(s) to refresh the viewport rather than a 2nd boolean "refresh" argument with a #set_path method.

We would expect a IOError or a Errno::ENOENT (No directory entry) exception if the SKP file does not exist at the previously set path location. (Ie, the internal model within the .layout archive needs to be overwritten with the updated SKP file.)

@thomthom thomthom added C API enhancement LayOut parity Missing functional parity with client Ruby API and removed need more info labels Sep 10, 2021
@sketchupbot
Copy link

Logged as: SKEXT-3180

@sketchupbot
Copy link

Logged as: SKEXT-3181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants