A method for producing a setting magnet adapted for aligning magnetic printing pigments in the production of security elements, with: - specifying a pattern for the alignment of the magnetic printing pigments in the security element, - defining, on the basis of the specified pattern, the magnetic stray field which aligns the magnetic printing pigments according to the pattern, and - producing the magnet according to the defined stray magnetic field for the pattern so that it generates a stray magnetic field which aligns magnetic printing pigments according to the specified pattern, wherein - the magnet is produced by means of an additive method, wherein magnetic particles having a specific location and a specific magnetic orientation are solidified so that the magnet generates the defined stray magnetic field; and wherein + magnetic particles are oriented individually or at least in sections by a controllable magnetic device so that a print head applies the aligned magnetic particles, or + already oriented magnetic particles are arranged with different magnetic orientation by a print head (12, 20) which can be controlled in its arrangement direction, or + already oriented magnetic particles are arranged by a print head and differently oriented magnetic particles are arranged by a further print head, or + in the region of a carrier on which the magnetic particles are solidified, a controllable magnetic device magnetically orientates the magnetic particles prior to the solidifying. - specifying a pattern for the alignment of the magnetic printing pigments in the security element, - defining, on the basis of the specified pattern, the magnetic stray field which aligns the magnetic printing pigments according to the pattern, and - producing the magnet according to the defined stray magnetic field for the pattern so that it generates a stray magnetic field which aligns magnetic printing pigments according to the specified pattern, wherein - the magnet is produced by means of an additive method, wherein magnetic particles having a specific location and a specific magnetic orientation are solidified so that the magnet generates the defined stray magnetic field; and wherein + magnetic particles are oriented individually or at least in sections by a controllable magnetic device so that a print head applies the aligned magnetic particles, or + already oriented magnetic particles are arranged with different magnetic orientation by a print head (12, 20) which can be controlled in its arrangement direction, or + already oriented magnetic particles are arranged by a print head and differently oriented magnetic particles are arranged by a further print head, or + in the region of a carrier on which the magnetic particles are solidified, a controllable magnetic device magnetically orientates the magnetic particles prior to the solidifying. + magnetic particles are oriented individually or at least in sections by a controllable magnetic device so that a print head applies the aligned magnetic particles, or + already oriented magnetic particles are arranged with different magnetic orientation by a print head (12, 20) which can be controlled in its arrangement direction, or + already oriented magnetic particles are arranged by a print head and differently oriented magnetic particles are arranged by a further print head, or + in the region of a carrier on which the magnetic particles are solidified, a controllable magnetic device magnetically orientates the magnetic particles prior to the solidifying.