Change one instance of a component
-
This is the problem we face:
We have a model with a component and several instances.
Now we want to be able to change the appearance of one instance without changing the others.
But the 'link' between the component and the instance must be maintained.We were thinking of creating a temporary copy of the original component and refer the instance that needs another appereance to that temp. component. We can put it then back to the original component later.
We face 2 problems with this theory:- This can only be done of a component itself is not present in the drawing, only the instances, otherwise the temporary copy would also be visible in the model.
- We can't find where the link between the instance and the component is defined so we can change that link.
At this moment this is what we are thinking about. But maybe there are better ways to do this.
In short:
How can i temporary make the appereance of an instance different then the other instances of the same component. Without losing the link towards the original component.( I hope i make sense!)
regards and thanks -
Hi Pout,
You can change some attributes of a component intsance but these are limited to what you can do with it without entering its context;
- size (if scaled)
- alignment (rotation/orientation), mirroring
- place
- colour/material (when applied from outside)
- layer
If other than this (e.g. something affecting geometry or more than one material), you need to make the instance unique (right clik to acces this in the context menu). Now the "linkage" between this component and the original ones is broken forever.
If you want to define the other, remaining, original instances of this changed one later, you can save this component as a separate skp file (in the browser right click and "save as") then select all instances of the old definition and reload them with the new definition.
I am moving this topic to the SU Discussion at the same time.
-
thx Gaieus.
I see you mention colour/material. So does this mean i can change the color of one instance of a component without touching the link with the component?
The other method you descibe is to defficult to use.
The color changing is based upon a calculation and is only temporary in a certain mode we created in SU. So saving the component externally is not really an option. We would like to keep the original drawing as untouched as possible. -
Sure, you can paint an instance of a component differently than another instances. Just don't apply the material directly on the face/geometry within the component editing context but from outside of it.
The basic rule is:
- whatever you do inside the editing context of a component, will be reflected in every instance of it
- whatever (rather limited) changes you (can) do from outside, will change the appearance (not the definition) of that particular component instance only
See the very basic example of cars here (scroll down to the bottom - but the whole page is interesting, especially the "Component Instances and Definitions in this case):
http://download.sketchup.com/sketchuphelp/gsu6_win/Content/G-Entities/Ent-Component.htmHave a look at this model (the vaulting of a Gothic church) where I use one single component whose instances are scaled and placed differently (try to paint them one by one with different colours for instance).
-
ok thank you, i indeed see possibilities here.
Now it off course all depends if the creator of the drawing attached colors/materials before making it a component or after...If he defined them bore making a component i cannot change them without de-linking?
-
Then there are more steps involved;
- You need to get rid of the material (colour) definiotion on the geometry. A solution could be simply deleting that material/colour from the Material browser (or entering the component's editing contet, selecting all and repainting with the default material).
- Now select all instances and colour them with whatever you want.
- Now select the one you want to colour differently and paint that with a different colour.
-
thanks again
so in that case you:
- edit an instance so that it has no color/material definition
- this results in all other linked instances to also lose their color/material definition
- recolor the instances but instead of on entity level, do it on component level.
What about the solution we were thinking about, can we somewhere edit the component linking so we can set another component as the basic component?
-
@pout said:
so in that case you:
- edit an instance so that it has no color/material definition
- this results in all other linked instances to also lose their color/material definition
- recolor the instances but instead of on entity level, do it on component level.
Yes, exactly.
@unknownuser said:
What about the solution we were thinking about, can we somewhere edit the component linking so we can set another component as the basic component?
I'm not sure I can follow this. The link betwen the components either exists or doesn't at all (in this case you need to make certain component(s) unique but you can never reinstate that link again).
You can also use several components nested in other components or groups as well so the whole system is quite flexible.
-
well what we are looking for is this:
Somewhere there has to be defined that an instance is based upon a component. You can see that name in Entity info.
Now for example
We have 3 boxes which are instances of the same component.
Now we copy one of those boxes and make it a new component with the color red.
So we now still have 3 instances from the same component and one other, new component/instance who is exactly the same except color/material.Let's say that we want to make one of the 3 instances an instance of the copied component. So, we would like to edit the component-link information.
That way in the end we would have 2 instances from the basic component and 2 instances of the copied component.The question is: where is it defined on what component an instance is based and can this be edited.
Instance A--> base is component A
Instance B--> base is component AInstance C--> base is component B
Instance D--> base is component BWhere are those links defined and are they available for editting?
btw thanks alot for helping me on this
-
OK, I see.
Now if you have three instances of the same component and you insert a fourth one which you paint from outside, it will still remain an instance of the original component (i.e. you don't have a new component definition). You can check; in the omponent browser there will only be one component (and top of all; unpainted).
A component definition is stored within the component; that's the geometry itself (only SU has to remember this definition just once); and within each component since it is all the same if you edit this one or the other one; all instances will reflect the changes.
Now if you want to create a new component with an independent definition, you have to make it unique (different from the previous definition). later on you can save this as an skp file and select whichever component you want to define as such and reload them from this external file (as I described above).
Note however that these reloaded components won't inherit the attributes you assign to the original from outside of their context.
So you use either this method or the other but you cannot "mix" them.
To be honest, with a more concrete exmple (if you are allowed to share it) it could be made much more obvious.
-
i'll try to give a 'written' concrete example:
An apartement building. All columns are based upon the same component.
Now i want one instance (column) to recieve a different color. Temporary, for analysing purposes.
I don't want it to become a unique component or what so ever. When i hit a button it should be in it's original color again.Now when the individual elements in the component did not get a color/material before the component was created there is no problem. I can change the color/material just of that instance to red. The others stay how they were.
But, when the individual elements in the component did get a color/material before the component was created there is a problem. To change the color of the column i want i need to go into the component and edit. This results in all instances (all columns) turning red.
To solve this problem we were thinking about copying the component and making it unique and give it the color red. This has no influence, we just created a new component(column) with the same characteristics as the others except it is red.
Now if we could define that, temporary, the column we want to be in red is an instance of the newly created component the problem is solved. Then this column is not anymore an instance of the original, colorless component but an instance of the new red component.
Later (after hitting the button) this column should become an instance of the original, colorless component again.That's the theory. We now just need to know how we can alter (in code/ruby) that that specific column is now an instance of the red column component and then an instance of the original colourless component.
I hope i make sense, as always i have it in my head but writing it down is harder.
Off course i can imagine there are other , better ways to do this. So if you have an idea, please let me know.thx again
-
OK, it makes sense.
How about this:- You creat a layerA for the red component.
- you create another layerB for the component instance of the one you want to toggle red/original.
- now you create two scenes; in scene1 you have all the original instances displayed including the one on Layer B while layer A is hidden
- in scene 2 you have the original instances displayed except for the one on layerB and of course layer A is also displayed.
By clicking between the two scenes, you can display any changes like this. A way easier method than reloading and returning to previous definitions.
Is this for some presentation purposes mainly? Because if not, other approaches might be more useul.
-
ok thats sounds perfect.
but as you can imagine, if you want to do this seperately for each column you would have a huge amount of layers and a list next to your pc when you need to hide/unhide what layer in what scene.The fact a instance should be red or in it's original color is based upon a result of a script.
So all instances should have the possibility to become red or not...That's why we came up with the 'red version of a component' idea. If we could swap the link between instance and component based upon the script result we have a solid method to use without having to play with layers/scenes etc.
-
James, also thx for the feedback
-
Well, you can always make a plugin requet (maybe with a link to this discussion) in the Ruby Discussion here. Try to be as specific as you can to explain the Gurus down there what you exactly want to achive and watch...
-
thanks a lot! All help is really appreciated.
-
Advertisement