Layout and printed PDF discrepancy

When creating layouts and printing .pdfs from them, I came upon a series of inconsistencies regarding the display of dimensions.

Starting form an unrolled surface which was dimensioned using python and exported to a seperate file, the drawing was then used to create a detail and insert into an imported layout.

Below a screen capture of the file BEFORE anything else:

Below two screen captures AFTER creating a detail and inserting it into a layout, using a custom Dim-Style:


Below two screen captures AFTER rotating the drawing 90°, creating a detail and inserting it into a layout:


Now for the pdf outputs:

MS PDF Vector:

MS PDF Raster:

Rhino PDF Vector:

My code:

allobj = rs.AllObjects()    
for obj in allobj:
    if rs.IsDimension(obj):
        rs.DimensionStyle(obj, "DIM_20")

plan = rs.NormalObjects()    
rs.RotateObjects(plan, centerpoint(plan), -90, [0,0,1])

if not rs.ViewNames(False, 1):
    rs.Command(" -ImportLayout x:\\pathToLayout 1 _Enter")

layout_view = rs.ViewNames(False, 1)
rs.AddDetail(layout_view, [15,43], [415, 292], "title", 1)

rs.ZoomSelected("Top")
rs.CurrentView("Top")
rs.AddNamedView("Detail", "Top")

Bonus captures from the files that first made us aware of the issue, note how only Rhino PDF does a correct orientation of the dimensions, but every file has a different layout. The same files create different output once run again.


@MartinIC