I'm not sure how to do this in ModelBuilder, but here's a Python script which should do what you're after.
>>> import arcpy, os # import libraries
...
... dwg_folder = r'C:\junk' # folder containing dwgs
... arcpy.env.workspace = dwg_folder
... dwg_files = arcpy.ListFiles('*.dwg') # list of dwgs in folder
...
... gdb_location = r'C:\junk\FILE_GDB.gdb' # path to GDB
... arcpy.env.workspace = gdb_location
... gdb_fcs = arcpy.ListFeatureClasses(feature_type='Polyline') # list of polyline feature classes in GDB
...
... for file in dwg_files: # loop through dwgs
... for fc in gdb_fcs: # loop through feature classes
... if file[:-4] == fc: # compare the dwg name (minus '.dwg') to the feature class name
... arcpy.Append_management(os.path.join(file,'Polyline'),fc,"NO_TEST") # append polyline layer inside dwg to matching feature class
General equivalences are:
- Iterate Files to arcpy.ListFiles()
- Iterate Feature Classes to arcpy.ListFeatureClasses
- you'll also need inline variable substitution and submodels