# Grouping objects and applying operation to the group

Forgive me for my perhaps naive questions, I am beginning to discover Tikz potentials. To ease certain operations as moving objects or transforming them, I want to know if there is a mechanism in Tikz that I can group certain operations and give a name to this grouping and use that name in doing operations on the whole collection of objects that are grouped. My first guess was perhaps scope will do this. But could not see how I can refer collectively to the scoped operations and/or objects. The best analogy, for give me to mention it, is the grouping operation in Power Point. Thanks for your help. Artimess

-

You can apply transformations to a scope, like for example:

\begin{tikzpicture}
\begin{scope}[rotate=45]
\draw (-1,-1) rectangle (1,1);
\draw (0,0) circle (1);
\end{scope}
\end{tikzpicture}


Whatever parameters and operations you specify in the [...] at the beginning of the scope environment is applied to every command inside the scope.

-

tikzpicture envionments can be nested. They behave like scope environments and support optional arguments for parameters. For instance, \begin{tikzpicture}[scale=0.5, transform shape] ... \end{tikzpicture} could be used inside a parent tikzpicture environment.

-
 I know that this works, but is it meant to work? I ask because in another question (which escapes me now), an answer was to nest tikz pictures but when I experimented then I found that the inner and outer pictures didn't properly know about each other (in particular, node names and co-ordinates couldn't be guaranteed to work). – Andrew Stacey Aug 16 '10 at 19:30 I used it but don't remember problems. But I wished also tikz matrices could be nested. – Stefan Kottwitz♦ Aug 16 '10 at 20:06