# Revision history [back]

Do you want to split them in the model level, or an even lower level, like links?

If you want to split by models, you can put each model in a directory, then include them all into the same world SDF using the <include> tag. You can use the same idea to nest models into each other.

If you want a more granular split, you won't be able to do it without using another script language, since SDF doensn't support top-level tags besides <world>, <model>, <light> and <actor>.

Personally, I like using ERB (sudo apt install ruby2.3 ruby2.3-dev or the latest available version):

model.erb:

<%
# Relative path from where the script is being run to the script's directory
DIR = File.dirname(__FILE__)

# Helper function to import another erb file
def fromFile filename
end
%>

<model name="model_name">

link1.erb
<link name="link1">

Then run erb model.erb > model.sdf.