sorry there are no internet connection in mars. wow…you know everything. what food you eat, what book you read. i learn ruby sketchup 3 years. but i dont know anything. i just read book Automatic SketchUp by Matthew Scarpino. btw thank you very much much much for the respond…sorry my english
He actually is trying to redraw and replace the entities of a definition when the user chooses a different design or size. (He showed me a pier footing as an example.)
You cannot add a group directly into model.entities AND add objects into it at the same time as you define it.
You can only do that with model.active_entities
Your temp = e.entities.add_group(old) will almost certainly give a bugsplat when ‘old’ is not in the model.active_entities context…
In fact I can’t see why you do it this way anyway ??
If you simply collect all groups which have your attribute_dictionary and add the new face, pushpull etc, then where is your ‘temp’ step needed ???
You make it and erase it without ever needing it - except when it bugsplats !
You can clear each group’s existing faces etc before adding the new ones by using e.entities.clear! immediately before adding the new faces etc back into the group…
This is only 1 in a series of attempts. The others were either in another topic thread or a PM thread.
I asked the same question. But the OP insists on trying to replace the entities of a group, instead of replacing the old group with a new group (or component.)
There’s nothing wrong with replacing the contents of a group. This is the foundation to many parametric extensions. It keeps properties, attributes, references in other extensions etc.
That wasn’t the purpose of creating the temp group. It was (I think) mainly to prevent merging of new geometry. (But perhaps also there was some data attached to the old geometry that needed to be copied to the new geometry? [I can’t remember.] The condensed snippet above does not show this.)
But yes, I would have cleared and just added a temp cpoint if the code had the undesired effect of GC’ing the group before the new geometry could be added. (And yea, rather attach data if possible at the group level than the element level.)
But again, this is related to a bunch of his other topic threads. You’d have to go through his recent activity to try to understand what he’s trying to do.
i have did it. because of help from this forum specially DanRathbun. Thank you for you all. my plugin almost complete. i hope i can share in this forum. before that i must find “what is poor”. sorry my english