Referenced file in Outliner

Sure, that sounds useful.

A bit faster workflow. (The OP’s opening this FR is evidence that it is desirable.)

The above code will also open distro’d component library definitions (which may not be so desirable.)
Perhaps limiting to Xref definitions that have the manager’s attribute assigned would keep the UI a bit cleaner?

You can always have manager option(s) to toggle various context commands on / off. (Let the user use it their way.)


Oh, and I said “Windows Only” in the example above because the API docs mention encoding issues on Mac platform pre-2019.3 for UI.openURL(). Have no Mac to test with and decided to let someone else “weigh in” on this.

My extension has no custom attributes but relies on SketchUp’s native path property of the definition. This is how this manager functions on models created without it being installed.

I’m thinking it could have an entry in the context menu for Open Model, to allow for this option without cluttering the toolbar on manager window (both native context menu and inside the manager window).

2019-10-19_13h26_56

Regarding, no attribute … interesting idea. That would also then work with Xref models created with other extensions that did write attributes but without messing them up. (They’d just need to resync any modtime info next time that extension was used. Not that users are likely to use more than one xref extension.)

I see your’s keeps track of when a xref model needs to be reloaded by reading the GUID of external skp files.)


Oh, and I just noticed a booboo in the API docs. It says definition#path returns false if the path is unsaved (ie, created in the model proper.) But testing shows it actually returns an empty string.
So, I was using a boolean test that doesn’t really matter …

if cpath && File.exist?(cpath)

… as "" resolves to true and File.exist? will return false for empty pathnames.

Could be just …

if File.exist?(cpath)

But is better practice as …

if !cpath.empty? && File.exist?(cpath)

… so Ruby doesn’t try to create a File::Stat object.

I’m checking definition.internal? to see if the component has an associated path. Only after I know a component is supposed to be linked to a file I check the path and whether a file exists.

To get back to the original topic, Eneroth Reference Manager could be changed to have an Open Model entry in the context menu, accessible in the context menu. It will however need some error handling and pedagogically phrased messages for internal components as well as missing files. I have other projects with higher priority but this is absolutely something I’ll take note of.

1 Like

In the absence of attributes, the another way would be an option to only add the context command if the clicked instance’s definition path matches the model proper’s path. (Ie, they are in the same folder.)

I can see scenarios where users accidentally modify library components for a specific project not realizing they’re editing a library file.

I think such increased complexity would be more in the way than helpful. Editing assets shared between projects, or shared between different parts withing the same projects, is a valid use case. Hiding the command for certain components could lead to the user thinking the plugin isn’t properly installed or malfunctioning.

Version 2.1.0 of Eneroth Reference Manager is submitted for review and will likely be live in a few days (may take a little longer now right after decamp though). This version lets you open any component from the context menu, and if the component is internal you are asked for a location to save it to.

Hi, i am very late to the party, i ask for a feature to handle xref in the same way 3dsmax / autocad handles xref as external files that dont add to the file size of the master file, does the Eneroth extension was able to do this?

example: xref_doors.skp(25mb), xref_main_buildings.skp(125mb), master_file.skp(2mb) is this posible?

SketchUp doesn’t support this kind of references, only embedded files. The reference manager can however help reload and organize, e.g. when cooperating.

Does anyone in the community asked or better get an answer from SketchUp team directly why they refrain from introducing this basic feature?

Does your reference (Xref) manager:

  • lock the Xref when inserted in the main model from being edited? as per AutoCAD (ignoring Refedit)
  • allow unlocking then editing of the Xref (via some form of Refedit) and which then saves the changes made back to the reference file?

Nope, no locking. The extension is intended to be useful both for loading in components from files and saving them out again. Some models are compositions with assets loaded in while others are collections with items being saved out. I have thought of ways to optionally impose rules here to avoid mistakes, but for the time being the extension is as simple as possible to allow for as many use cases as possible.

Thanks for the reply.

If a change is made to a reference file (Xref) within the main Model (as per Refedit) is that change then saved back and overwrites the original reference file (Xref)? i.e. as would happen within AutoCAD. I’m looking for this behaviour as AutoCAD’s Xref system always worked well.

Eneroth reference Manager only saves out to file or reload from file when you explicitly tells it to do so. When either the component or file changes it can ask you if you want to reload/save out, but it doesn’t do anything by itself.

But it can do it from within the app, even if you have to instigate it manually? If that’s the case that’s cool. Changing an Xref within the model and it then being out of sync with the original is a huge PITA.

Also, what’s the reason your app doesn’t automatically save the changes made to the Xref within the main model back to the original file? A technical programming thing?

If the extension silently wrote over external files it would be a huge risk for accidental data loss. The extension can just as well be used for models that drive the external files as models that passively consume the external files, and currently doesn’t know what way you are using it.

Just to clarify, my question is whether your app can directly save changes made to an Xref within the main model directly back to the originally Xref file? even if this is done activated manually? I’m not looking for it to work automatically as per Refedit within AutoCAD.

And is there a trial version?

The extension has buttons for saving out and loading in components. When editing the external file or the internal component, you also get a notification asking if you want to reload or save out respectively.

There is also a 14 day trial on all of my extensions.

Perfect. Thanks for the info.

Trimble Connect has been available since version 2015 or 2106, I believe. It manages reference files in the cloud on a project basis.
Referenced objects are ‘locked and greyed out’ in Outliner, Updating and alignment belongs to the ‘Collaboration Panel’ of the Trimble Connect Extension.

There are some quirks, I would like to manage the visibility in outliner as well, now it is controlled with an added Tag per Reference (the ‘nested Tags’ come along, too)

While the project is hosted ‘in the cloud’ you can set up the project folder structure on your local machine too and sync overnight with Trimble Connect Sync.

@MikeWayzovski I believe this is only cloud solution and it does not solve the problem.

I really wish SketchUp had xref functionality which saves reference of the inserted external skp file only not full model with all its data.

Managing the same hi-res objects and saving them in every project file eats disk space in no time and makes the file heavy and duplicates data - so Sketchup Developers where is your DRY principle?
Same would be great for materials. I understand the original idea of SketchUp in early 2000 to keep all in in one file it was good for making a model of the new table but not for advanced architectural designs we use Sketchup for. I would suggest an option to store bitmaps /skp files in a file or as a link to an external source.