Yes, what you’re asking can be done. I admit it is not as straightforward as the ESRI implementation, but I had to do the very same thing, and I used Shapefile Categories. I had to create a category for each shape in the table, but in my case, there are never more than about 10. I’m not sure of the overhead involved if you have 1000’s of shapes… Following is a snippet of old VB6 code.
' we will assume count is small enough to create category for each shape
For i = 0 To pLayer.NumShapes - 1
EntityID = CLng(pLayer.CellValue(pLayer.FieldIndexByName("EntityID"), i))
Dim cat As ShapefileCategory
Set cat = .Categories.Add(EntityID)
cat.ValueType = cvExpression
' category is uniquely identified by the EntityID
cat.Expression = "[EntityID] = " & EntityID
' is there an assigned icon?
Dim IconFile As String
IconFile = pLayer.CellValue(pLayer.FieldIndexByName("Filename"), i)
If Len(IconFile) = 0 Then
' no icon, we need a small placeholder
.PointSize = 2
.PointType = ptSymbolPicture
.AlignPictureByBottom = False
' load specific picture for this Entity
.Picture = LoadImage(IconFile, True, True)
' set rotation for this Entity
.PointRotation = CDbl(pLayer.CellValue(pLayer.FieldIndexByName("Rotation"), i)
I should mention the weakness of this method is that you have to effectively redefine the categories as shapes are added or removed from the shapefile. Because of this, I would consider an enhancement that lets you more simply assign the rotation by field value, as ESRI does, without having to create distinct categories.
I hope this helps. Let me know if you need more clarification or if it would help to have sample code in another language.