Convert component to group

Robert, I wanted to convert components to groups in code, without exploding (which is slow).

I thought it was too easy, but after reading a related post, figured this was ‘other worldly’. In the '90s, when we needed code for websites or macros or something, we always copied it from elsewhere. Too complicated otherwise.

@Robert5643, if you look up at the topbar (with the topic title and icons on the right,) you’ll see under the title, a breadcrumb list of categories. It indicates that this thread is in the Ruby programming sub-category, of the Developers category.

So, we always are talking about doing things via code in here, and answering a question in these categories with a manual procedure is just “noise”. (So you’ve earned your first “off-topic” flag.)

This would be super helpful! Any progress on this plugin? My primary need is to be able to convert the 3000+ components that come in with a revit import into groups, thus speeding up the skp component library itself, which in-turn speeds up vray turnaround time… along with general housecleaning benefits. Thx for looking into this one.

2 Likes

Agreed that this would be very helpful. I also have the problem of dealing with really component heavy Revit Imports that freeze my component library and prevent me from further importing the updated model into 3ds Max because of some x86 limit. If anyone discovers a simple code or plugin to replace all components with groups, please post it here! Exploding is not an option either as it causes too many problems with faces, materials and layers… and just take too long. Thanks.

thank you so much

I agree with @jiminybillybob.

Real-world workflow situations frequently motivate the need to convert selected components to groups. While keeping components’ all relevant definition and instance properties intact. And being applicable in batch.

Well – have a look at @eneroth3 's fairly recent extension Eneroth Component to Group which includes source code as plain text and a dedicated forum thread.

Perhaps it can help.

Which obviously includes the .explode method, which would be good to avoid.(as requested ~five years ago) :wink:

(Ps.: Of course, the extension is absolutely good, beside this “weakness of Ruby API”. )

1 Like

Feel free to file a ticket in our GitHub issue tracker to help track this feature request.

We requested this years ago. viz

2 Likes

The fundamental issue of transferring between Revit and SketchUp via DWG or IFC is that it results in a zillion unique components with all their axis origins at the global origin point. I don’t know that converting to groups or exploding them brings any real benefit.

Posters above have said that all the unique components overload the Components inspector. (Groups are hidden from the inspector.)

The API documentation has long indicated that a definition’s hidden flag can control whether it is seen in the inspector. But it does not actually work. (I believe I’ve logged a bug issue concerning this.)

The inspector could be closed during the import, or it’s display type set to List, or changed to view one of the distribution disk libraries. This might increase import efficiency.

1 Like
1 Like

IMO this was something of a hack to stop DCs from spamming the component list with unique objects. In SketchUp itself groups represent unique objects (although sharing definitions until edited, but that is really an implementation detailed) and components represent classes of identical objects. Rather than using this attribute I’d stick to groups if an object is supposed to be unique. Not also does it hide the object from the component browser, but if the user copies the object it also prevents changes to one copy from affecting the other.