Wow, TIG, you have saved my day(s) Big thanks!
Posts made by jshal
-
RE: [REQUEST] Convert single instance components to groups
-
[REQUEST] Convert single instance components to groups
I was looking for quite while searching for the following problem:
Importing (Revit) DWG data into Sketchup creates a lot of single instance components. The trouble is that when copying multiple of these files together that Sketchup slows down to a crawl because it is trying to match components that are similar. Usually I end up with sketchup files with hundreds of single component instances. Sketchup works faster when these single instances are in fact groups, making copying between sketchup files way faster. Normally I explode the selected instance and group these again, but with hundreds of these, this is too cumbersome.
So what I need is the following:
- select all single instance components within my current SketchUp file (or current selection)
- convert these to standard groups
I think this is quite useful for anybody working with imported files and want to keep on working quick.
For number 2) I found the following code snippet from sdmitch (https://sketchucation.com/forums/viewtopic.php?f=323&t=17590&p=140679&hilit=single+instance+component#p623006)
@mod = Sketchup.active_model @ent = @mod.active_entities @sel = @mod.selection @vue = @mod.active_view cmps = @sel.grep(Sketchup;;ComponentInstance) cmps.each{|ci| grp = @ent.add_group(ci) grp.name = ci.definition.name ci.explode } @mod.definitions.purge_unused
[highlight=#ffffbf:39rhwwt6]Does anybody know how to realize part 1?[/highlight:39rhwwt6]
Thanks in advance!
-
Dynamic Compont Ceiling Error?
I have a problem creating a simple dynamic component. It is a square, where the user enters the square meters of this square. The X-value can be changed manually, so that the Y-value changes accordingly. The units in the model are in meters.
Size
LenX=ceiling(current("LenX"),30)
LenY=ceiling(Area*10000/LenX,30)Behaviors
ScaleTool: Scale along red. (X)
Custom
Area (User imput in m^2), Units:Text, Users can edit as an textbox, Display in: Whole NumberThe problem is that with the scale tool, the final X-value changes randomly.
When I remove LenX=ceiling(current("LenX"),30), the square behaves normally, but I want the X and Y value incremental every 300mm. Does anybody have a solution? TIA!See model: http://jshal.site88.net/wp-content/uploads/2009/07/dc_room.skp