if you were wondering this is how i worked around the update \ change existing MLeaderStyle..
<CommandMethod("cml")> _
Public Sub CloneCopyMleaderStyle()
Dim sourceName As String = BS_Acad.GetAutoCadPath + "\Braden_Support\ProgramBlocks\BrdnDimStyle.dwg"
Dim mlStyle As String = "standard"
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim mlStyleID As ObjectId = CloneMLeaderStyle(db, sourceName, mlStyle, db.Dimscale)
End Sub
Public Function CloneMLeaderStyle(ByVal TargetDatabase As Database, ByVal sourceFileName As String, ByVal mLeaderStyleName As String, ByVal dscale As Double) As ObjectId
Using TargetTrans As Transaction = TargetDatabase.TransactionManager.StartTransaction
Dim ThisDrawing As Autodesk.AutoCAD.Interop.AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
Dim Targetdict As DBDictionary = TryCast(TargetTrans.GetObject(TargetDatabase.MLeaderStyleDictionaryId, OpenMode.ForWrite), DBDictionary)
Using sourceDatabase As New Database(False, True)
sourceDatabase.ReadDwgFile(sourceFileName, FileOpenMode.OpenForReadAndAllShare, True, Nothing)
Try
Using sourceDbTr As Transaction = sourceDatabase.TransactionManager.StartTransaction()
Try
Dim Sourcedict As DBDictionary = TryCast(sourceDbTr.GetObject(sourceDatabase.MLeaderStyleDictionaryId, OpenMode.ForRead), DBDictionary)
If Not Sourcedict.Contains(mLeaderStyleName) Then
Return ObjectId.Null
End If
Dim SourceMLeaderStyleID As ObjectId = Sourcedict.GetAt(mLeaderStyleName)
Dim ids As New ObjectIdCollection()
ids.Add(SourceMLeaderStyleID)
Dim idMap As New IdMapping()
If Not Targetdict.Contains(mLeaderStyleName) Then
TargetDatabase.WblockCloneObjects(ids, TargetDatabase.MLeaderStyleDictionaryId, idMap, DuplicateRecordCloning.Replace, False)
ThisDrawing.ActiveDocument.SetVariable("MLeaderScale", dscale)
TargetTrans.Commit()
Return idMap(SourceMLeaderStyleID).Value
Else
TargetDatabase.WblockCloneObjects(ids, TargetDatabase.MLeaderStyleDictionaryId, idMap, DuplicateRecordCloning.MangleName, False)
Dim TempMLeaderStyleID As ObjectId = idMap(SourceMLeaderStyleID).Value
Dim TempMLeaderStyle As MLeaderStyle = TryCast(TargetTrans.GetObject(TempMLeaderStyleID, OpenMode.ForRead), MLeaderStyle)
Dim TargetMLeaderStyleID As ObjectId = Targetdict.GetAt(mLeaderStyleName)
Dim TargetMLeaderStyle As New MLeaderStyle
TargetMLeaderStyle = TryCast(TargetTrans.GetObject(TargetMLeaderStyleID, OpenMode.ForRead), MLeaderStyle)
TargetMLeaderStyle.UpgradeOpen()
TargetMLeaderStyle.ArrowSize = TempMLeaderStyle.ArrowSize
TargetMLeaderStyle.ArrowSymbolId = TempMLeaderStyle.ArrowSymbolId
TargetMLeaderStyle.ContentType = TempMLeaderStyle.ContentType
TargetMLeaderStyle.LeaderLineType = TempMLeaderStyle.LeaderLineType
TargetMLeaderStyle.ExtendLeaderToText = TempMLeaderStyle.ExtendLeaderToText
TargetMLeaderStyle.LandingGap = TempMLeaderStyle.LandingGap
TargetMLeaderStyle.LeaderLineColor = TempMLeaderStyle.LeaderLineColor
TargetMLeaderStyle.LeaderLineType = TempMLeaderStyle.LeaderLineType
TargetMLeaderStyle.LeaderLineTypeId = TempMLeaderStyle.LeaderLineTypeId
TargetMLeaderStyle.LeaderLineWeight = TempMLeaderStyle.LeaderLineWeight
TargetMLeaderStyle.DoglegLength = TempMLeaderStyle.DoglegLength
TargetMLeaderStyle.DrawLeaderOrderType = TempMLeaderStyle.DrawLeaderOrderType
TargetMLeaderStyle.DrawMLeaderOrderType = TempMLeaderStyle.DrawMLeaderOrderType
TargetMLeaderStyle.MaxLeaderSegmentsPoints = TempMLeaderStyle.MaxLeaderSegmentsPoints
TargetMLeaderStyle.FirstSegmentAngleConstraint = TempMLeaderStyle.FirstSegmentAngleConstraint
TargetMLeaderStyle.SecondSegmentAngleConstraint = TempMLeaderStyle.SecondSegmentAngleConstraint
TargetMLeaderStyle.TextAlignAlwaysLeft = TempMLeaderStyle.TextAlignAlwaysLeft
TargetMLeaderStyle.TextAngleType = TempMLeaderStyle.TextAngleType
TargetMLeaderStyle.TextHeight = TempMLeaderStyle.TextHeight
TargetMLeaderStyle.TextColor = TempMLeaderStyle.TextColor
TargetMLeaderStyle.TextStyleId = TempMLeaderStyle.TextStyleId
TargetMLeaderStyle.TextAttachmentType = TempMLeaderStyle.TextAttachmentType
TargetMLeaderStyle.TextAttachmentDirection = TempMLeaderStyle.TextAttachmentDirection
TargetMLeaderStyle.TextAlignmentType = TempMLeaderStyle.TextAlignmentType
TargetMLeaderStyle.DefaultMText = TempMLeaderStyle.DefaultMText
TargetMLeaderStyle.Annotative = TempMLeaderStyle.Annotative
TargetMLeaderStyle.BlockId = TempMLeaderStyle.BlockId
TargetMLeaderStyle.BlockConnectionType = TempMLeaderStyle.BlockConnectionType
TargetMLeaderStyle.BlockRotation = TempMLeaderStyle.BlockRotation
TargetMLeaderStyle.BlockScale = TempMLeaderStyle.BlockScale
TargetMLeaderStyle.BlockColor = TempMLeaderStyle.BlockColor
TargetMLeaderStyle.EnableLanding = TempMLeaderStyle.EnableLanding
TargetMLeaderStyle.EnableBlockRotation = TempMLeaderStyle.EnableBlockRotation
TargetMLeaderStyle.EnableBlockScale = TempMLeaderStyle.EnableBlockScale
TargetMLeaderStyle.EnableDogleg = TempMLeaderStyle.EnableDogleg
TargetMLeaderStyle.EnableFrameText = TempMLeaderStyle.EnableFrameText
TargetMLeaderStyle.BreakSize = TempMLeaderStyle.BreakSize
TargetMLeaderStyle.SetTextAttachmentType(TempMLeaderStyle.GetTextAttachmentType(LeaderDirectionType.LeftLeader), LeaderDirectionType.LeftLeader)
TargetMLeaderStyle.SetTextAttachmentType(TempMLeaderStyle.GetTextAttachmentType(LeaderDirectionType.RightLeader), LeaderDirectionType.RightLeader)
TargetMLeaderStyle.SetTextAttachmentType(TempMLeaderStyle.GetTextAttachmentType(LeaderDirectionType.UnknownLeader), LeaderDirectionType.UnknownLeader)
TargetMLeaderStyle.Scale = dscale
TargetMLeaderStyle.DowngradeOpen()
Targetdict.Remove(TempMLeaderStyleID)
ThisDrawing.ActiveDocument.SetVariable("MLeaderScale", dscale)
TargetTrans.Commit()
Return Targetdict.GetAt(mLeaderStyleName)
End If
Catch
Return ObjectId.Null
End Try
End Using
Catch
Return ObjectId.Null
End Try
End Using
System.Runtime.InteropServices.Marshal.ReleaseComObject(ThisDrawing)
End Using
End Function