We describe a strategy for fabricating devices on perforated silicon nitride membranes that is ideal for systems with modulated structure, in particular for nanotubes with endohedral inorganic compounds or molecules, or nanotubes externally functionalized with soft materials. It uses dynamic nanostenciling and focussed ion beam while avoiding nanotubes' exposure to chemicals or beams. Physical properties and high resolution transmission electron microscopy are then correlated. Devices with individual single-walled carbon nanotubes partially filled with potassium iodide (KI) showed negative differential resistance (NDR). We attribute the NDR to electrostatic potential modulation on the nanotube due to permanent dipoles in the KI chain. (c) 2007 American Institute of Physics.