A Distance Measuring -system comprising a DM-device and a computer unit, wherein the computer unit is configured for generating a layout of a room, said DM-device comprising - a measuring beam unit configured for determining a value of a distance between an object and the DM-device by transmitting a measuring beam and receiving a reflection of the measuring beam from the object, and - an Inertial Measurement Unit configured for determining □ an absolute first rotational position of the DM-device with respect to a first axis, said first axis being parallel to the measuring beam, and □ an absolute second rotational position of the DM-device with respect to a second axis, said second axis being parallel to the gravity field (g), wherein said computer unit is configured for - receiving from the DM-device □ a plurality of measured distance values, □ for each of the plurality of measured distance values, a sequence indicator, □ for at least one of the plurality of measured distance values, an absolute first rotational position of the DM-device at the time of a respective distance measurement, and □ for each of the plurality of measured distance values, an absolute second rotational position of the DM-device at the time of a respective distance measurement; - determining, for each of the at least one absolute first rotational position, whether one of a first and a second criterion (Roll Position 1, Roll Position 2) is met, wherein the first and second criteria relate to the absolute first rotational position; and - generating the layout by consecutively linking the measured distances based on the plurality of measured distance values, the sequence indicators, the absolute second rotational positions and the respective met criterion. - a measuring beam unit configured for determining a value of a distance between an object and the DM-device by transmitting a measuring beam and receiving a reflection of the measuring beam from the object, and - an Inertial Measurement Unit configured for determining □ an absolute first rotational position of the DM-device with respect to a first axis, said first axis being parallel to the measuring beam, and □ an absolute second rotational position of the DM-device with respect to a second axis, said second axis being parallel to the gravity field (g), wherein said computer unit is configured for □ an absolute first rotational position of the DM-device with respect to a first axis, said first axis being parallel to the measuring beam, and □ an absolute second rotational position of the DM-device with respect to a second axis, said second axis being parallel to the gravity field (g), - receiving from the DM-device □ a plurality of measured distance values, □ for each of the plurality of measured distance values, a sequence indicator, □ for at least one of the plurality of measured distance values, an absolute first rotational position of the DM-device at the time of a respective distance measurement, and □ for each of the plurality of measured distance values, an absolute second rotational position of the DM-device at the time of a respective distance measurement; □ a plurality of measured distance values, □ for each of the plurality of measured distance values, a sequence indicator, □ for at least one of the plurality of measured distance values, an absolute first rotational position of the DM-device at the time of a respective distance measurement, and □ for each of the plurality of measured distance values, an absolute second rotational position of the DM-device at the time of a respective distance measurement; - determining, for each of the at least one absolute first rotational position, whether one of a first and a second criterion (Roll Position 1, Roll Position 2) is met, wherein the first and second criteria relate to the absolute first rotational position; and - generating the layout by consecutively linking the measured distances based on the plurality of measured distance values, the sequence indicators, the absolute second rotational positions and the respective met criterion.