With the AutoCAD fields functionality, you can add automatic labels to your drawing which will display the current drawing name and drawing title. If you have a barcode text font installed in Windows (on your PC), these labels can also have a form of a barcode area.
Start the drawing properties command (DWGPROPS) and assign a title to your drawing - e.g. the job number, drawing number, etc. (CZ version shown here, MyDrawing.dwg, title="123-456-789"):
Drawing properties (incl. any added custom properties) can be referred in dynamic text fields. So you can use the FIELD command (or fields in block attributes) to transfer the drawing properties into drawing texts. The most useful drawing properties can be found in the Document category of field codes.
How to transfer all of this to barcodes? Install a barcode TrueType font (e.g. this free Code39 TTF) to your Windows fonts (Control Panels > Fonts > Add). Define a new text style using this font and simply write a text (or use a text field, uppercase only) in this text style - a barcode will be created.
You can find the required fields and text styles predefined in the sample BarCoder block downloadable from the "CAD Blocks Catalog" (it uses duplicate labels - one in barcode and another one in a plain text style). Have the barcode font installed and just insert this block to your drawing (or template) - if you rename your drawing the barcode will automatically update:
Of course you can use a similar approach also in Inventor or Revit.